Skip to content

Add dark mode toggle to the viewer(Viewer 加暗色主题切换) #1

Description

@Kaka-cheaper

Goal

Add a dark/light theme toggle in the top bar so users can switch between the warm-ivory default and a dark variant.

Why

Roadmap "Dark theme" item. Long review sessions on a bright canvas can be tiring; many AI IDE users work in dark themes already.

Scope (what is in)

  • Add a button in TopBar.tsx (sun/moon icon from lucide-react)
  • Define dark variant of all theme tokens in index.css (under .dark class on <html>)
  • Persist preference to localStorage (codesee.theme)
  • Honor system preference on first visit (prefers-color-scheme)

Out of scope

  • Theming the React Flow control panel (use defaults)
  • Dark variant for screenshots in README

Files likely involved

  • viewer/src/app/TopBar.tsx
  • viewer/src/index.css
  • viewer/src/App.tsx (toggle state at top level)

Acceptance criteria

  • Toggle button visible in top bar
  • Click switches all colors immediately (no reload)
  • Reload preserves selection
  • First visit on a dark-mode OS shows dark by default
  • No regression in npm run build

Estimated effort

~3-4 hours / ~3 files

Hints

The existing palette uses oklch() lightness values; mirror them around 0.5 for dark mode. Look at how accent and accent-soft are layered.

Want to take this?

Comment "I'd like to take this" and I'll confirm within 24h.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomersviewerViewer (frontend canvas, interaction, layout)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions