Skip to content

Add dark mode#16

Merged
jedibrillo merged 2 commits into
mainfrom
feature/dark-mode
May 2, 2026
Merged

Add dark mode#16
jedibrillo merged 2 commits into
mainfrom
feature/dark-mode

Conversation

@jedibrillo
Copy link
Copy Markdown
Collaborator

Summary

  • Adds light / dark / system theme switching to the dashboard, with a navbar toggle that cycles through the three states and persists to localStorage.
  • Dark CSS variable tokens live under .dark in src/index.css. @theme inline was switched to @theme so Tailwind v4 utilities reference the variables at runtime instead of inlining the light values — that's what makes the override actually take effect.
  • An inline script in index.html applies the stored theme before paint to prevent flash-of-light-theme on initial load.
  • All hardcoded hex colors in App.tsx, SyncPanel, SyncPage, RecordingDetail, PeoplePage, and lib/tag-colors.ts were migrated to either semantic tokens (bg-primary, text-foreground, border-border) or dark: variants. Terminal/log panels stay intentionally dark in both modes (they're code surfaces, not chrome).

What's new

  • src/components/ThemeProvider.tsx — context + useTheme hook; reads localStorage, listens to prefers-color-scheme, toggles the dark class on <html>.
  • src/components/ThemeToggle.tsx — sun / moon / monitor icon button in the navbar.
  • 8 new vitest tests covering cycling, persistence, system-preference reaction, and accessible naming.

Test plan

  • npm run format:check && npm run lint && npm test — clean (92 vitest + 51 pytest passing; only pre-existing any warnings remain)
  • npm run build — clean
  • Manually verified in the browser: home / sync / people / settings pages all render correctly in light, dark, and system modes
  • Verified the toggle persists across reloads with no FOUC

🤖 Generated with Claude Code

Adds light/dark/system theme switching to the dashboard.

- ThemeProvider context (src/components/ThemeProvider.tsx) reads localStorage,
  listens to prefers-color-scheme, and toggles the `dark` class on <html>.
- ThemeToggle button in the navbar cycles light → dark → system.
- Dark color tokens added under `.dark` in src/index.css.
- Switched `@theme inline` to `@theme` so Tailwind v4 utilities reference
  the variables at runtime rather than inlining the light values, which
  is what lets the .dark override actually take effect.
- Inline script in index.html applies the stored theme before paint
  to prevent flash-of-light-theme on initial load.
- Migrated hardcoded hex colors in App.tsx, SyncPanel, SyncPage,
  RecordingDetail, PeoplePage, and lib/tag-colors.ts to either semantic
  tokens or `dark:` variants so every page renders correctly in both modes.

Tests: ThemeProvider and ThemeToggle covered by RTL tests (cycling,
persistence, system-pref change handling, accessible name).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jedibrillo jedibrillo requested a review from yoaquim May 1, 2026 03:22
The tag filter on the recordings page rendered all tags inline with no
overflow handling, so once a user had more tags than fit the viewport
the trailing chips were clipped off the right edge.

Switch the row to single-line horizontal scroll (overflow-x-auto +
flex-nowrap + whitespace-nowrap) and prevent the leading icon and
chips from shrinking. Type filter row above is intentionally left as-is
since it's small and its chips already fit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jedibrillo jedibrillo merged commit 99481d9 into main May 2, 2026
1 check passed
@jedibrillo jedibrillo deleted the feature/dark-mode branch May 2, 2026 02:34
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