Skip to content

feat(theme): unlock light/dark with animated theme toggler - #323

Draft
zjy365 wants to merge 3 commits into
mainfrom
feat/theme-light-dark
Draft

feat(theme): unlock light/dark with animated theme toggler#323
zjy365 wants to merge 3 commits into
mainfrom
feat/theme-light-dark

Conversation

@zjy365

@zjy365 zjy365 commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Parent spec / tickets

What

  • Unlock next-themes (light+dark, default dark, persisted); no more forcedTheme.
  • Port magicui AnimatedThemeToggler into @workspace/ui (controlled via next-themes; View Transitions circular reveal + motion Sun/Moon crossfade; graceful direct-switch fallback without VT).
  • Sidebar footer row above the account entry, matching nav-row geometry (hover sheet, w-9 icon column, collapsed-rail tooltip).
  • Shell color literals paired for light mode with pixel-identical dark resolution (neutral-50/400 → semantic foreground/muted-foreground; blues get blue-600 dark:blue-400).
  • DB Access: dropped hard-coded dark wrappers; --db-access-sticky-header-surface / new --db-access-row-selector-surface / --main-action-surface-bg + glow tokens paired (light sheet, dark canvas navy pixel-identical).
  • Billing: canvas-glow material shares the paired surface/glow tokens; forced-dark tooltip removed; white overlays/blue accents paired.
  • Canvas (.canvas-surface tokens) and registry previews keep their intentional dark appearance (untouched; chart palette theme-invariant).

Evidence

  • packages/ui component tests: 147 pass / 0 fail (7 new toggler tests).
  • bun typecheck 6/6 green; bun check green.
  • Browser verification (local dev, 1440×900, computed-style probes):
    • Dark zero-regression: body lab(2.75381 0 0) = neutral-950; sidebar text lab(98.26 0 0) = neutral-50; DB Access sticky #161e33; row selector #0c1120; chrome base #080a11; billing glow lab(36.9089 …) = blue-700 — all pixel-identical to pre-change values.
    • Light: body white; sidebar/DB Access/Billing readable (muted surfaces, transparent glow); canvas tokens stay dark by design; chart-1 #49aeff theme-invariant.
    • Toggle: class flip + localStorage persistence + colorScheme; VT lifecycle verified (scoped attrs set/cleared, re-entrancy guarded).
  • apps/ui suites: failure sets byte-identical to clean origin/main baseline (pre-existing, none introduced).

Screenshot evidence (#142)

18 Playwright captures (branch dark/light + origin/main dark baseline, dev-mock fixtures) with pixelmatch diff: every page differs by 59–72 px, all inside the sidebar footer = the new theme-toggle row's sun glyph. No other dark pixel changed. Gist: https://gist.github.com/zjy365/9d322a1c39513f6cd14beea9d68e72b3

Fixed during verification

TooltipTrigger render injects its own onClick into the toggle button; the toggler now composes caller onClick instead of being silenced by it.

🤖 Generated with ZCode

Unlock the next-themes provider (light+dark, default dark, persisted),
port magicui's AnimatedThemeToggler into @workspace/ui as a controlled
component (View Transitions circular reveal + motion icon crossfade,
graceful fallback without VT), and mount it in the app sidebar footer
above the account row.

Shell color literals are paired so dark resolves pixel-identical:
neutral-50/400 become the semantic foreground/muted-foreground (exact
dark matches), blues get light values with dark: originals. The
project-chrome-surface base moved into .dark with a light value in
:root. Canvas surfaces and registry previews keep their intentional
dark appearance.

Refs: labring/sealos-private#138 #139
Drop the hard-coded `dark` wrappers from DataBrowserPane and the main
action surface frame so the DB Access experience follows the theme.
Pair the dark-only component tokens so dark resolves pixel-identical
while light gets readable values:

- --db-access-sticky-header-surface / new --db-access-row-selector-
  surface: navy originals moved to .dark, light uses --muted.
- --main-action-surface-bg / --main-action-surface-glow-color: the
  overlay paints the canvas navy + blue glow in dark, a plain sheet
  with no glow in light.
- White-overlay chips and zinc text in export/backup dialogs get light
  semantic bases with dark: originals.

Test contract updated: the surface no longer carries a literal
bg-neutral-950 class (background is token-driven now).

Refs: labring/sealos-private#138 #140
The Billing tab shell / cost drawer / plan-change dialog use the
canvas-glow material; it now shares the theme-paired
--main-action-surface-bg / --main-action-surface-glow-color tokens
(light sheet, no glow; dark keeps the canvas navy + blue glow
pixel-identical).

- Drop the forced `dark` class from the checkout prorated-charge
  tooltip (it followed the page theme in dark anyway).
- Pair white-overlay skeletons/rows and blue-400 accents across
  billing surfaces (light: bg-muted / blue-600; dark: originals).
- Cost-chart legend dots fill with the paired surface token so the
  ring reads correctly in both themes.

Refs: labring/sealos-private#138 #141
@zjy365
zjy365 marked this pull request as draft September 8, 2026 03:59
@zjy365

zjy365 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator Author

先搁置,已改为 Draft。暂不推进合并,后续恢复时再处理与 main 的冲突并重新验证。

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant