Skip to content

UI: title-bar light/dark switch, File › Display theme, system appearance on first run (#194, #239) - #318

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
vangel76:fix/theme-toggle
Oct 11, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
vangel76:fix/theme-toggle

Conversation

@vangel76

Copy link
Copy Markdown
Contributor

Fixes #194, fixes #239

Root cause

Dark mode exists (View › Display theme: System / Light / Dark, view.theme, saved in ui.json since 10-09), but:

  • the only place to change it was a combo box at the end of the View tab, which is hard to find (the commenter on [Feature] Missing Darkmode #194 found it by searching);
  • the desktop app always started in Light, even on a dark desktop, because UiState::default() has system_theme: false (Dark mode seems missing? #239, "dark mode by default isn't a thing").

What changed

  • Title bar: a new light/dark button (half-filled circle, drawn in code: Icon::Appearance) next to Comments. A click switches between light and dark (view.darkMode, which flips what is shown, also when System chose it). Right-click opens System / Light / Dark. It is exposed to accessibility as a "Dark Mode" checkbox with its state.
  • File menu: a new File › Display theme submenu with System / Light / Dark (view.theme {mode}). Excel keeps this under File › Account › Office Theme, but GridCraft's File menu has no Account page.
  • First run follows the system: in apps/gridcraft load_prefs, the appearance follows the system until a theme is saved in ui.json. This works like the existing interface-language default. UiState::default() stays Light, so tests and headless renders don't depend on the host. Existing ui.json files keep the theme they already have.
  • No new strings: the labels ("Display theme", "System", "Light", "Dark", "Dark Mode") are already in every catalog.
  • Docs: docs/ui-parity.md row + revision row.

Overlap

Tests

  • New UI test title_bar_switch_and_file_menu_choose_the_theme (crates/ui-egui/tests/system_theme.rs): the title-bar switch flips light↔dark and saves a manual choice; File › Display theme › System returns to following the OS.
  • Commands run (Linux):
    • cargo test -p gridcraft-ui-egui --test system_theme (5 passed)
    • cargo test -p gridcraft-ui-egui --test file_menu (3 passed)
    • cargo clippy -p gridcraft-ui-egui -p gridcraft --all-targets -- -D warnings
    • cargo fmt -p gridcraft-ui-egui -p gridcraft -- --check
  • Looked at offscreen snapshots (--example snapshot, light and --dark): the button sits left of Comments and reads in both themes.

Not done

Unverified

  • First-run "follow the system" was checked by reading load_prefs, not by a fresh-profile run on macOS/Windows.

🤖 Generated with Claude Code

…nce on first run (storytold#194, storytold#239)

The theme could only be chosen in the View tab's Display theme box, and
the app always started light. Now:
- a title-bar button switches light/dark in one click (view.darkMode);
  right-click offers System / Light / Dark;
- File › Display theme offers the same three (Excel keeps it under
  File › Account › Office Theme);
- the desktop app follows the system appearance until a theme is chosen
  and saved in ui.json (UiState's default stays light for tests).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit d274eb6 into storytold:main Oct 11, 2026
h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 11, 2026
…ngside them; theme test goes through Backstage Options (#318 after #331)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 11, 2026
… combo (#318 after #331)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@echelon

echelon commented Oct 11, 2026

Copy link
Copy Markdown
Member

Merged — thank you for the contribution! (The File dropdown became the Backstage view in #331, so I updated your theme test to choose System from Backstage › Options › Display theme; the title-bar switch is unchanged.)

If you haven't already, come join us on the ArtCraft Discord: https://discord.gg/artcraft

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.

Dark mode seems missing? [Feature] Missing Darkmode

3 participants