Skip to content

feat(web): light theme — three-way picker, paper tokens, AA xterm palette#89

Open
dchaudhari7177 wants to merge 1 commit into
burakgon:mainfrom
dchaudhari7177:feat/light-theme
Open

feat(web): light theme — three-way picker, paper tokens, AA xterm palette#89
dchaudhari7177 wants to merge 1 commit into
burakgon:mainfrom
dchaudhari7177:feat/light-theme

Conversation

@dchaudhari7177

Copy link
Copy Markdown
Contributor

Closes #67

Adds the light theme along the exact seams the issue points at:

pwa/theme.tsThemeName is now "dark" | "oled" | "light", with TERMINAL_BG and THEME_COLOR entries for light (#f6f6f7). loadTheme keeps the stored-value validation pattern: anything other than "oled"/"light" falls back to dark. applyTheme sets data-theme="light"; dark still removes the attribute so the :root default stays the single source of truth.

styles/tokens.css — a [data-theme="light"] block flips ink → paper: --bg #f6f6f7, white cards, black-wash hairlines, text at 15.9:1 / 6.2:1 / 4.7:1. Coral handling follows the issue's AA note: coral fills (primary buttons, brand glyph) keep brand coral — dark ink on coral reads ~7:1 — while coral used as text/status (--accent, --iris, --awaiting) darkens to #c2481d (4.6:1 on paper). color-scheme: light flips native form controls/scrollbars. Every ratio below was computed against #f6f6f7.

settings/SettingsPanel.tsx — the OLED checkbox becomes a three-way Theme select (Dark / True black (OLED) / Light), using the existing rc-settings__field + rc-settings__control idiom from Session order. Still applies instantly through setTheme (no save button, no reload).

chat/TerminalView.tsx — a full LIGHT_THEME xterm palette (same shape as THEME): ink-on-paper foreground #383a42 (10.5:1), selection #c9d0da, and ANSI hues darkened so ordinary terminal text meets WCAG AA — red 5.0, green 4.6, yellow 4.9, blue 5.0, magenta 5.7, cyan 5.5, white-gray 4.7. terminalTheme() resolves the palette at mount and in the rc-theme-change listener, so an open terminal restyles live without a remount. The .xterm-viewport seam already follows var(--bg).

Teststheme.test.ts extended per acceptance criteria: light round-trip + data-theme, unknown stored value ("solarized") falls back to dark, theme-color meta mirrors #f6f6f7, TERMINAL_BG covers all three themes.

Verification

  • pnpm typecheck clean; theme + storage-migration tests pass (10/10).
  • Full packages/web suite: the only failures are the known flaky-under-load Windows ones (App/TerminalView/SessionList timeouts + keeps compact stacked remaining-limit rows), reproduced identically on a clean main checkout on this machine.
  • Rendered the screenshot.html?scene=newsession harness with data-theme="light": body paints paper rgb(246,246,247), ink text rgb(27,27,31), picker surfaces flip to translucent white.

Left the stretch "system" (prefers-color-scheme) option out per the issue — happy to follow up with it as a separate PR.

Three-way theme choice in Settings (Dark / True black / Light),
replacing the OLED checkbox:

- theme.ts: ThemeName gains "light"; stored-value validation keeps
  unknown values falling back to dark; applyTheme sets data-theme for
  any non-default theme.
- tokens.css: a [data-theme=light] block — paper surfaces, ink text,
  darkened hairlines; the coral accent shifts to its deep value for
  contrast on paper; warn/err darkened for AA. The code card stays a
  dark panel deliberately.
- TerminalView: light mode swaps the FULL xterm palette (One
  Light-derived), not just the background — the dark ANSI ramp would
  be unreadable on paper. Live switch keeps working via rc-theme-change.
- theme.test.ts extended for the new value, fallback, and meta mirror.

Closes burakgon#67
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.

Theme: add a light terminal theme

1 participant