Skip to content

Theme files: choose a light and a dark theme with their colors and fonts - #254

Merged
MHohlios merged 7 commits into
mainfrom
wiffletree/theme-files-light-and-dark-themes-with-colors-an
Nov 2, 2026
Merged

MHohlios merged 7 commits into
mainfrom
wiffletree/theme-files-light-and-dark-themes-with-colors-an

Conversation

@MHohlios

@MHohlios MHohlios commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Wiffletree reads themes from JSON files in <data dir>/themes/. Settings › Appearance now has a Light theme and a Dark theme menu below Mode; System shows the light theme when macOS is light and the dark theme when it is dark, and Light and Dark hold one. Tidal stays built in and is the default on both sides. The approved study is openspec/changes/archive/2026-11-02-theme-files/ui/mockups.html.

A theme file has Tidal's shape: a name, a light variant, a dark variant or both, with Tidal's 14 color names, and an optional fonts block (ui, mono, size from 11 to 20). A theme is listed in each menu whose variant it has. A color a variant leaves out comes from Tidal's same variant, and unknown keys are ignored, so Tidal's own file is a valid theme. The Celadon port (celadon-theme/celadon-theme#16) ships its four variants in this format.

  • themes.rs parses files over Tidal, reporting a bad value with its line, lists each side, resolves each choice with Tidal fallback per key and per side, and re-reads the chosen files when a theme is picked and when a window becomes active. It also writes Open themes folder and New theme from Tidal.
  • palette.rs holds both looks at runtime; palette(dark) keeps its signature, so its callers did not change. ui_font() and mono_font() replace every hard-coded system font name, including the Space rows' count added in List projects by Space, then by group #253, and apply_theme sets gpui-component's font, mono font and size from the theme on show. Tidal's mono font is Menlo, as gpui-component's default was, so code no longer falls back to Helvetica at the app's own mono call sites.
  • A broken, deleted or one-sided chosen file draws Tidal on that side and shows an error banner with Use Tidal; a missing font shows a warning and uses the system font. Installed fonts are relisted at most once per missing name, not on every activation.
  • preferences.rs adds light_theme and dark_theme; a missing or unknown value reads as Tidal and keeps the rest of the file.
  • The OpenSpec change is archived with four requirements added to openspec/specs/native-workspace; design/README.md and docs/PRD.md describe the study and themes.

The sidebar's Appearance menu keeps only System, Light and Dark.

Tests: 16 themes::tests cover complete, light-only, dark-only and partial files, a bad color's line, neither variant, size limits, unknown keys, Tidal itself, per-side listing, a deleted chosen file, a one-sided mismatch, shared and separate font warnings and a new theme's name; theme_choices_survive_a_relaunch_and_unknown_ones_read_as_tidal covers preferences. cargo fmt --check, cargo clippy -p workspace-desktop --all-targets -- -D warnings, cargo test -p workspace-desktop (442 passed) and openspec validate --specs --strict are clean. Driven on a scratch data folder, a dark-only and a light-only theme switched live with Mode, and a broken accent showed its banner with Tidal on that side. Clicking the Settings menus and a real macOS appearance flip were not driven, since automation reaches only the main window.

Reviewed with Wiffletree: 1 full review and 2 re-checks, 4 rounds (Tests, Claude, Codex, Style)

@MHohlios
MHohlios force-pushed the wiffletree/theme-files-light-and-dark-themes-with-colors-an branch from 651722b to b5c7fd7 Compare November 2, 2026 21:10
@MHohlios
MHohlios merged commit 31b3f09 into main Nov 2, 2026
9 checks passed
@MHohlios
MHohlios deleted the wiffletree/theme-files-light-and-dark-themes-with-colors-an branch November 2, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant