Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.
Implementation Plan: Selectable Colour Themes
Branch: 011-colour-themes | Date: 2026-10-13 | Spec: spec.md
Input: Feature specification from /specs/011-colour-themes/spec.md
Summary
Turn Nota's two fixed palette variants into a list of named, single-look colour themes: Studio Dark, Studio Light, Ember Graphite and Ember Paper. The user picks one in Preferences → Appearance, or uses follow system, which pairs a dark-mode theme with a light-mode theme. Only colour changes. Layout, type and behaviour stay Studio's.
The core move is to give colour one home: one JSON file per theme. Today every
colour exists twice, as a T("#dark","#light") slot in NotaPalette.cs and as a
Brush.* entry in both XAML ThemeDictionaries. Afterwards:
- Theme files (
Theme/Themes/*.json, embedded) hold one value per token for one theme (research R2, contracts/theme-file.md). NotaPalettedeclares slots by token name.Apply(theme)re-tints the long-lived slot brushes in place, as variant switches do today.- XAML stops holding colours. At startup the slot brushes themselves are published
into
Application.Resourcesunder theirBrush.*keys, so every{DynamicResource Brush.*}follows a switch with no XAML change (R1, R6). Shadows and the Fluent accent ramp are set as resources from theme tokens on each switch. NotaThemeServiceapplies a theme by id, setsRequestedThemeVariantfrom the theme's kind, and in follow-system mode swaps themes on the OS'sActualThemeVariantChanged(R4).- Settings gain
ColourTheme,SystemDarkThemeandSystemLightTheme. One pure resolver inNota.Applicationhandles migration and fallbacks, and the smoke test covers it (R5). - Preferences gets a theme list with previews and a follow-system row with two per-mode pickers (contracts/ui-contract.md § T1).
- Checks:
DesignTokenCheckvalidates every theme file against the token catalogue and the readability pairings (T3), keeps the Studio rules on the Studio themes, and tests the appearance resolver. - Ember is rebuilt from release 0.52.1 by slot name. The 8 Studio-only tokens are derived by role, and values failing T3 are nudged and documented (R8).
Nota: Read Before Planning
- UI work →
DESIGN.md(Studio) and thenota-designskill. This feature adds a "Colour themes" section there. - Anything →
CONTRIBUTING.md: SPDX headers on new files, no new dependency (System.Text.Jsonis in the base library).
Technical Context
Language/Version: C# / .NET 10 (managed app only). Python 3 for the design-page generator script.
Primary Dependencies: Avalonia 12.0.3 (existing), System.Text.Json (BCL). No new
dependency.
Storage:
settings.json(per machine): three new string fields; the legacyThemefield is kept and written in step.- Theme files are embedded resources.
- Project files: no change.
Audio-Thread Impact: None. This is a UI-only change; nothing crosses the C ABI, and the engine is untouched.
Testing:
tests/Nota.SmokeTest:DesignTokenCheckgainsRunThemes, andProgram.csgains the "design: themes" and "design: appearance" sections. Both read files as text and call the pure resolver; no UI needed.- Screenshot comparison per quickstart.md.
Target Platform: macOS 13+, Windows 10+, Linux (x64/arm64), as today.
Project Type: Desktop app (Avalonia).
Performance Goals: a theme switch repaints every window within 0.5 s (SC-001). Follow system reacts within 1 s (SC-008).
Constraints:
- Studio Dark and Studio Light render pixel-identical to 010 (SC-003). Their values are copied, not re-derived.
- No frame is drawn in the wrong theme at launch (SC-007).
- Slot brush identity is preserved across switches; existing aliases and caches keep working.
Scale/Scope:
- 106 tokens × 4 themes;
- ~10 files changed in
Nota.App/Theme,PreferencesWindow.cs,App.axaml.cs,Nota.Application/Settings.cs(+ newAppearance.cs); - 4 new JSON files;
DesignTokenCheck,Program.cs,scripts/design-html.py, docs.
Constitution Check
GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.
| Principle | Status | Note |
|---|---|---|
| I. Real-time audio safety | ✅ N/A | UI-only. No engine or audio-thread code touched. |
| II. Boundary discipline | ✅ | No C ABI change. No JUCE. |
| III. Licensing hygiene | ✅ | New .cs files carry the SPDX header. JSON files have none (JSON has no comments); they are data covered by the repo licence, like settings.json's schema. No new dependency. |
| IV. Verification gate | ✅ | The smoke test is extended (themes + appearance). The build scripts must pass. |
| V. One logical change per PR | ✅ | A single feature PR, stacked on 010 (PR #1). It doesn't merge before 006. |
| VI. Docs in sync | ✅ | CHANGELOG [Unreleased] Added entry, FEATURES.md (nota-features), DESIGN.md § Colour themes + Ember nudges, DESIGN.html regenerated, nota-design skill, nota-docs (Preferences page; the docs repo is unavailable in this environment, as for 010 T069). |
| VII. Spec-first | ✅ | spec + clarify (3 Q) done; this plan; tasks next. |
| VIII. Safety rules not weakened | ✅ | No rule touched. |
Post-design re-check: unchanged. The design adds no engine surface. The design-check rules are not loosened for Studio: the Studio rule (no Ember value) keeps applying to both Studio themes. Ember's exemption from that rule is required by the spec (FR-016).
Project Structure
Documentation (this feature)
specs/011-colour-themes/
├── plan.md # this file
├── research.md # R1–R10
├── data-model.md # theme, token catalogue, appearance setting, resolution
├── quickstart.md # gate, manual flows, screenshots, migration
├── contracts/
│ ├── theme-file.md # theme JSON format v1 (F1–F8)
│ └── ui-contract.md # Preferences UI (T1), switching (T2), readability (T3), Ember (T4)
└── tasks.md # /speckit-tasks
Source Code (repository root)
src/managed/
├── Nota.Application/
│ ├── Settings.cs # + ColourTheme, SystemDarkTheme, SystemLightTheme; legacy Theme kept
│ └── Appearance.cs # NEW — pure resolver: migration, fallbacks, built-in ids
└── Nota.App/
├── App.axaml.cs # apply the resolved appearance before the first window
├── Nota.App.csproj # EmbeddedResource Theme/Themes/*.json
├── PreferencesWindow.cs # theme list + follow-system row + per-mode pickers (T1)
└── Theme/
├── Themes/
│ ├── studio-dark.json # NEW — today's dark values, verbatim
│ ├── studio-light.json # NEW — today's light values, verbatim
│ ├── ember-graphite.json # NEW — 0.52.1 dark + R8 derivations, T3 nudges
│ └── ember-paper.json # NEW — 0.52.1 light + R8 derivations, T3 nudges
├── NotaColourTheme.cs # NEW — theme record, JSON loader + validation, built-in registry
├── NotaPalette.cs # slots by token name; Apply(theme); ColorIn(slot, theme); full KeyMap; washes
├── NotaThemeService.cs # apply by id/mode; publish brushes, shadows, accent ramp; follow system
└── NotaTheme.axaml # colour entries removed from ThemeDictionaries; header explains where colour lives
tests/Nota.SmokeTest/
├── DesignTokenCheck.cs # RunThemes (F1–F8, T3); Run reworked: keys → KeyMap; Studio checks read studio-*.json
└── Program.cs # "-- design: themes --", "-- design: appearance --"
scripts/design-html.py # palette from theme JSON; one section per built-in theme
DESIGN.md, DESIGN.html # § Colour themes, token roles, Ember nudge table
.claude/skills/nota-design/SKILL.md # where colour lives now; how to add a theme
CHANGELOG.md, FEATURES.md # Added: colour themes + follow system
Structure Decision: all code stays where theming already lives (Nota.App/Theme,
PreferencesWindow.cs). The only Application-layer addition is the pure resolver, which
lives next to Settings. That keeps it free of Avalonia and directly testable from the
smoke test, which does not reference Nota.App.
Approach notes for tasks
Extract, don't retype: a one-off script (scratch, not committed) generates
studio-dark.jsonandstudio-light.jsonfrom the currentT()pairs and XAML-only values, andember-*.jsonfromgit show f37f51e:…. The smoke test then proves the Studio files match the 010 values token for token, before the old pairs are deleted.Order:
- theme files + loader;
NotaPaletteby name, with Studio applied, still on today's ThemeDictionaries;- publish brushes and remove XAML colours;
- resolver + settings;
- service;
- Preferences UI;
- Ember tuning;
- checks/docs.
Studio must look identical after each of steps 1–5 (screenshot diff).
Risk: styles that read a
Colorresource rather than a brush (e.g.SystemAccentColor*in Fluent templates). These are set asColorresources on every switch. A grep for{DynamicResourcekeys that resolve to non-brush types is part of step 3.Risk:
StaticResource Brush.*: none today (verified: 0 uses). The check keeps it that way.Risk: popups already open during a switch: they are separate windows and are covered by
RepaintEverythingwalkingdesktop.Windows. Popup roots are added to the walk if the screenshot pass shows a stale one.
Complexity Tracking
No constitution violations to justify.