Skip to content

feat(ui): add dark/light/system theme toggle#69

Merged
dbfx merged 2 commits intomainfrom
feat/theme-toggle
Mar 24, 2026
Merged

feat(ui): add dark/light/system theme toggle#69
dbfx merged 2 commits intomainfrom
feat/theme-toggle

Conversation

@dbfx
Copy link
Contributor

@dbfx dbfx commented Mar 24, 2026

Summary

  • Adds a three-way theme selector (Dark / Light / System) to Settings > General, with dark mode as the default
  • Introduces ~40 semantic CSS custom properties with .light class overrides, replacing all hardcoded dark-theme colors across 50+ components
  • Persists theme preference through the full IPC pipeline (renderer → main → config.json) with proper validation
  • Fixes SVG gauge/ring track backgrounds and chart grid lines that were invisible in light mode

Details

Core infrastructure:

  • theme: 'dark' | 'light' | 'system' added to KuduSettings type and both settings stores
  • App.tsx applies dark/light class on <html> with matchMedia listener for system preference
  • globals.css defines complete variable system: surfaces, text, borders, glass effects, gauge tracks, grid lines, scrollbars
  • IPC validation allowlist updated with theme key + value validation

Component migration (52 files):

  • All rgba(255,255,255,...) → semantic CSS variables (--bg-subtle, --border-default, etc.)
  • All hardcoded hex colors (#16161a, #0a0a10, #9e9ea6, etc.) → appropriate CSS variables
  • SVG stroke attributes → var(--gauge-track) / var(--grid-line)
  • Semantic/status colors (green, red, blue, amber) intentionally preserved

Test plan

  • Toggle between Dark, Light, and System in Settings > General
  • Verify theme persists after navigating away from Settings and back
  • Verify theme persists after app restart
  • Check all pages in light mode for invisible elements (gauge tracks, progress bars, text, borders)
  • Set to System and verify it follows OS preference
  • Verify toast notifications match active theme

🤖 Generated with Claude Code

Add a three-way theme selector (Dark, Light, System) to Settings with
dark mode as the default. Introduces ~40 CSS custom properties for
semantic color tokens with .light class overrides, migrates all 50+
components from hardcoded dark-theme colors to CSS variables, and
persists the preference via IPC to the settings store.

- Add `theme` field to KuduSettings type and both settings stores
- Add ThemeSelector segmented control to Settings > General
- Apply dark/light class on <html> with system preference listener
- Define comprehensive CSS variable system (surfaces, text, borders,
  glass effects, gauge tracks, grid lines, scrollbars)
- Migrate all hardcoded rgba/hex colors across components and pages
- Add `theme` to IPC validation allowlist with value checking
- Fix SVG gauge/ring tracks and chart grid lines for light mode
- Update Sonner toast theming to follow active theme

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ff2e5cbc8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- Add .light .text-zinc-100 override (used in 8 places for primary labels)
- Change .light .bg-white/5 from hover-only to persistent so non-hover
  backgrounds get the dark tint in light mode
- Add .light .bg-white/10 override for CveScannerPage active tab state

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dbfx dbfx merged commit c57bffb into main Mar 24, 2026
8 checks passed
@dbfx dbfx deleted the feat/theme-toggle branch March 24, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant