feat(views): add theme switcher to user menu#5641
Open
josonzhao wants to merge 1 commit into
Open
Conversation
Add an Appearance submenu to the workspace-switcher user menu with Light/Dark/System options (DropdownMenuSub + RadioGroup, current option checked). Reuses next-themes useTheme - the same source as Settings > Preferences - so the two surfaces stay in sync without a new store. Theme option labels borrow settings.preferences.theme.* instead of duplicating keys; only sidebar.appearance is new (en/zh-Hans/ja/ko).
|
@josonzhao is attempting to deploy a commit to the IndexLabs Team on Vercel. A member of the Team first needs to authorize it. |
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
packages/views/layout/app-sidebar.tsx) with Light / Dark / System options, rendered as aDropdownMenuSub+DropdownMenuRadioGroup(current option auto-checked), inserted above the "Log out" group.useTheme()from@multica/ui/components/common/theme-provider(next-themes) — the same source as Settings > Preferences — so the two surfaces stay bidirectionally in sync with no new store, matching the client-view-state split in CLAUDE.md.settings.preferences.theme.{light,dark,system}(no key duplication); onlysidebar.appearanceis new, added to en / zh-Hans / ja / ko per the conventions glossary (Appearance → 外观 / 外観 / 모양).theme(may beundefinedon first frame) straight to the radio group — no item is checked until resolved, same fallback as the preferences tab.Files
packages/views/layout/app-sidebar.tsx—AppearanceSubmenucomponent + insertion before logout group.packages/views/layout/app-sidebar.test.tsx—useThememock, extended dropdown-menu mock with Sub/Radio primitives, 4 new cases.packages/views/locales/{en,zh-Hans,ja,ko}/layout.json—sidebar.appearance.Test plan
pnpm typecheck(full monorepo: ui/core/docs/views/web/desktop) — passpnpm test(views) — 2683 tests pass, incl. 4 new appearance-submenu cases and 162 locale-parity checksCloses the coding phase of WS-591. Test agent to run end-to-end verification.