Skip to content

feat(settings): in-app settings panel with live theme and terminal colours - #334

Open
guillaumejay wants to merge 2 commits into
mainfrom
feat/solarized-chrome-theme
Open

guillaumejay wants to merge 2 commits into
mainfrom
feat/solarized-chrome-theme

Conversation

@guillaumejay

Copy link
Copy Markdown
Collaborator

What

A settings panel — ⚙ in the sidebar header, or mod+, (open-settings,
rebindable) — with two pickers:

  • Interface theme: dark, light, and four new presets named after the
    terminal schemes (solarized-dark, solarized-light, gruvbox-dark,
    gruvbox-light), mapped to iced's built-in themes.
  • Terminal colours: Built-in or one of the four schemes.

A pick applies immediately and saves itself — no Apply button, no
restart:

  • the chrome follows on the next frame (Shell::theme reads it every frame);
  • every running terminal is recoloured: PtyManager now shares its palette with
    the terminal threads (Arc<RwLock<Palette>>) and set_palette sends each a
    Repaint. OSC 10/11 colour queries answer from the new palette too;
  • only the picked key (theme or terminal.colors.scheme) is written; the rest
    of settings.json — explicit colour overrides, unknown keys — is preserved.
    A file that is not a JSON object is left alone rather than rewritten.

The panel and saving go through an injected AppearanceSink port, so tests
neither recolour real terminals nor touch the user's settings.json.

Light themes made usable

  • theme now degrades alone on an unknown value (or null, which MCP
    set_option writes to unset) instead of failing serde for the whole file and
    resetting every setting.
  • Status dots darken on light surfaces; a test holds every status on every
    light theme to WCAG's 3:1 non-text floor (Busy on Solarized Light was 2.89
    before the tuning).
  • The unfocused-window scrim fades toward the grid's own background instead
    of black, which turned a light grid grey.

Known limit

A program reads the terminal's background once at startup to pick a light
or dark look — Claude Code does. A Claude session already running keeps its
look until restarted; the panel says so, and so does the book.

Docs

New book page workspace/settings-panel.md; keyboard reference
(open-settings), settings.md, stdio.md theme values, settings.example.jsonc,
README, sidebar diagram. Roadmap: new F-settings-panel, F-settings updated.

Testing

cargo fmt --check, clippy -D warnings, cargo test --workspace,
check-deps, check-arch, markdownlint, roadmark validate all pass
locally. New tests: settings round-trip and per-key persistence, lenient theme
parse, dot contrast, live repaint of a running PTY session, chord → panel →
escape, pick → repaint/persist via the sink. The overlay escape sweep covers the
new rung.

Not verified on screen: Windows' single-instance mutex prevents running a
second instance beside the one this was developed in. Needs a visual pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Br9mLSj4WaKSCWw7noUrAe

theme now accepts solarized-dark, solarized-light, gruvbox-dark and
gruvbox-light alongside dark/light, mapping to iced's built-in themes so
the chrome can match the terminal grid it frames.
…live

A gear in the sidebar header, or mod+, (open-settings), opens a modal panel
with the chrome theme and the terminal scheme. A pick applies at once — the
chrome on the next frame, every running terminal through a palette the PTY
manager now shares with its terminal threads and repaints on demand — and
persists only its own key to settings.json, leaving the rest of the file
(and any key this build does not understand) as written.

Light themes, made to read properly:
- the theme key degrades alone on an unknown value instead of resetting
  the whole file;
- status dots darken on a light surface, held to the WCAG 3:1 floor for
  UI components by a test over every light theme;
- the unfocused-window scrim fades toward the grid's own background
  rather than black, which turned a light grid grey.

The panel is a rung of the keyboard ladder, so escape leaves it and the
overlay sweep covers it.

This branch has not been deployed

No deployments
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