Skip to content

feat: add 3-way dark mode toggle#70

Merged
nsheaps merged 4 commits intomainfrom
claude/add-dark-mode-toggle-62veZ
Mar 24, 2026
Merged

feat: add 3-way dark mode toggle#70
nsheaps merged 4 commits intomainfrom
claude/add-dark-mode-toggle-62veZ

Conversation

@nsheaps
Copy link
Copy Markdown
Owner

@nsheaps nsheaps commented Mar 24, 2026

Summary

  • Add a 3-way theme toggle (dark / system / light) with moon, computer, and sun icons
  • Toggle appears in Settings > Appearance section and in the "More" menu in the sidebar
  • Theme preference persists as themeMode in CeptSettings (default: system)
  • useTheme hook manages the dark class on <html>, listening to OS preference when in system mode
  • Enable class-based dark mode in Tailwind v4 via @custom-variant dark — without this, dark: utilities only respond to the OS media query, not the .dark class toggle
  • Complete dark mode CSS coverage across all components:
    • Sidebar, editor, settings, page header, toast, app menu
    • Command palette, search panel, knowledge graph, database views, git repo picker, breadcrumbs
    • Editor syntax highlighting (hljs tokens), callout block colors, settings file browser
    • Knowledge graph D3 inline colors (link strokes, node borders, label text) made theme-aware
  • Import git-styles.css in globals.css so git component styles are loaded

Test plan

  • Toggle dark (moon) — entire app switches to dark theme
  • Toggle light (sun) — app switches to light theme
  • Toggle system (computer) — app follows OS preference
  • System mode + OS dark preference — app renders in dark mode on load
  • Change OS dark mode setting while in system mode — app updates live
  • Refresh page — theme preference is preserved
  • Code blocks show readable syntax highlighting in both themes
  • Colored callouts (blue/green/yellow/red/purple) are visible in both themes
  • Knowledge graph node labels and links are visible in dark mode
  • All 1699 existing tests pass

https://claude.ai/code/session_01QddASAFJgFoPPTDS88nkq2

Add a ThemeToggle component with moon/computer/sun icons that appears in
both the Settings page (under a new Appearance section) and the "More"
menu in the sidebar. The toggle persists as themeMode in CeptSettings.

Convert all dark mode CSS from @media (prefers-color-scheme: dark) to
.dark class-based selectors so the theme can be controlled programmatically
via a useTheme hook that manages the dark class on <html>.

https://claude.ai/code/session_01QddASAFJgFoPPTDS88nkq2
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 24, 2026

Release Version Check

🟡 MINOR version bump

Version
Current 0.5.1
Next 0.6.0

This version will be released automatically when this PR is merged to main.

Changelog preview

0.6.0 (2026-03-24)

Features

  • add 3-way dark mode toggle (dark/system/light) (290cfc9)

Bug Fixes

  • add dark mode styles to all remaining components (2f65d19)
  • complete dark mode coverage for editor, settings, and graph (12cf365)
  • enable class-based dark mode in Tailwind v4 (35d4220)

@github-actions
Copy link
Copy Markdown
Contributor

Preview Deployment

The web app for this PR has been deployed:

Open Preview

Use this to verify the app works correctly, especially for dependency updates.

github-actions Bot added a commit that referenced this pull request Mar 24, 2026
Components missing dark mode coverage: command palette, search,
knowledge graph, database views, git/repo picker, and breadcrumbs.
Also imports git-styles.css in globals.css.

https://claude.ai/code/session_01QddASAFJgFoPPTDS88nkq2
github-actions Bot added a commit that referenced this pull request Mar 24, 2026
- Add dark mode syntax highlighting colors for code blocks (hljs tokens)
- Add dark mode callout block backgrounds (blue, green, yellow, red, purple)
- Add dark mode styles for settings file browser meta text and breadcrumbs
- Fix knowledge graph D3 inline colors to be theme-aware (link strokes,
  node borders, label text)

https://claude.ai/code/session_01QddASAFJgFoPPTDS88nkq2
github-actions Bot added a commit that referenced this pull request Mar 24, 2026
Tailwind v4 defaults to media-query-based dark mode, so `dark:` utilities
only respond to `prefers-color-scheme`. Our useTheme hook toggles the `.dark`
class on <html>, which requires the selector strategy.

Add `@custom-variant dark` to globals.css so both Tailwind utilities (dark:bg-*)
and custom CSS selectors (.dark .cept-*) work with the class toggle.

https://claude.ai/code/session_01QddASAFJgFoPPTDS88nkq2
github-actions Bot added a commit that referenced this pull request Mar 24, 2026
@nsheaps nsheaps marked this pull request as ready for review March 24, 2026 19:04
@nsheaps nsheaps merged commit 23abaf8 into main Mar 24, 2026
10 checks passed
@nsheaps nsheaps deleted the claude/add-dark-mode-toggle-62veZ branch March 24, 2026 19:04
github-actions Bot added a commit that referenced this pull request Mar 24, 2026
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.

2 participants