Skip to content

feat(frontend): light/dark theme toggle#8

Open
DerekfromMadison wants to merge 4 commits into
SGudbrandsson:masterfrom
DerekfromMadison:feat/light-dark-theme
Open

feat(frontend): light/dark theme toggle#8
DerekfromMadison wants to merge 4 commits into
SGudbrandsson:masterfrom
DerekfromMadison:feat/light-dark-theme

Conversation

@DerekfromMadison
Copy link
Copy Markdown

@DerekfromMadison DerekfromMadison commented Apr 23, 2026

It's light mode. You know, like that button every app has had since 2014.

Flip it on in Settings → Display → Appearance. Dark is still the default because we're not monsters. System mode follows your OS. xterm re-themes live so your terminal stops glowing at you in a coffee shop.

Also snuck in the inline session-rename commits from the other branch so they ship together.

DerekfromMadison added 4 commits April 23, 2026 07:46
Double-click the session name in the drawer or tab bar to rename in place;
the gear menu's Rename item and the mux session pencil button use the same
inline input. Replaces the window.prompt flow with a single keystroke-friendly
editor (Enter to commit, Escape to cancel, blur to save).
Single-click on the name span was being swallowed by the dblclick
handler, breaking session selection. Move dblclick from the name span
to the row, and use a drawer-local inline-rename helper that swaps the
name node for an input (Enter commits, Escape cancels, blur saves).
Captures the CSS-var-based approach, mobile.css acceptance criterion,
xterm hot-swap, persistence + reconciliation, and explicit out-of-scope
list. rev4 — Codex APPROVE-WITH-NITS round 3, nits patched.
Adds App Settings → Display → Appearance with Dark/Light/System radio.
Applied instantly without reload; persisted per-user to ~/.codeman/settings.json
via existing /api/settings plus localStorage for flash-of-wrong-theme prevention.

Implementation:
- Theme-adaptive CSS vars on :root with html[data-theme="light"] override block.
  All literal hex/rgba color values in styles.css and mobile.css converted to
  var(--...) references (~900 hex replacements, 86 rgba replacements).
- rgba(var(--text-rgb), X) pattern for alpha borders/bgs/text that auto-flip
  between white-on-dark and dark-on-white without per-rule overrides.
- --text-on-accent invariant-white var for text on saturated accent/status
  buttons that kept white text in both modes (~49 button rules auto-migrated).
- Status color family (--green/--yellow/--red/--purple) uses darker shades in
  light mode so status text meets WCAG AA on white bg.
- XTERM_THEME_DARK / XTERM_THEME_LIGHT palettes with live hot-swap via
  terminal.refresh() for the main and all teammate terminals.
- Theme-boot inline <script> in <head> writes data-theme before any stylesheet
  loads to avoid flash-of-wrong-theme. Mirrored in upload.html.
- Two <meta name="theme-color"> tags with prefers-color-scheme media queries
  for iOS chrome.
- matchMedia listener installed only when mode === 'system'; proper cleanup
  and Safari <14 fallback to legacy addListener API.
- Server reconciliation via monotonic _themeActionVersion — last user action
  wins when server settings arrive after a local toggle.
- --border-light text-color misuse (50+ spots) replaced with --text-dim so
  dim labels stay readable in light mode.
- Welcome/run buttons with surface-2→accent gradients: solid accent bg in
  light mode so white text stays readable over the full button.
- upload.html themed via its own compact --u-* palette (kept standalone).

Schema: adds themeMode: z.enum(['dark','light','system']) to SettingsUpdateSchema.
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