feat(review): add System option to the theme mode toggle#1047
Open
alexanderkreidich wants to merge 3 commits into
Open
feat(review): add System option to the theme mode toggle#1047alexanderkreidich wants to merge 3 commits into
alexanderkreidich wants to merge 3 commits into
Conversation
The review editor Options menu only offered Light/Dark, while the plan editor menu and Settings theme tab already exposed the System mode that ThemeProvider supports. Bring the review menu in line: - map over light/dark/system with the shared themeIcons (SystemIcon) - highlight the stored mode directly instead of collapsing system to the resolved mode, so the System button shows as selected - drop the local Sun/Moon SVG duplicates in favor of the shared icons
The Options dropdown defaults to w-56 (224px), which is too narrow for the Light/Dark/System segmented control — the System button clipped past the panel edge. Bump the default to w-64; PlanHeaderMenu and ReviewHeaderMenu are the only ActionMenu consumers and both render the three-button theme row.
Dark-only palettes silently ignore light mode (and vice versa) in ThemeProvider, letting the toggle no-op. Add getUnsupportedMode() to the theme registry and use it in both header menus to disable the dead button and highlight the mode actually rendered.
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
The code review editor's Options menu only offered Light/Dark, while
ThemeProvideralready supports asystemmode and the plan editor menu + Settings theme tab already expose it. This PR brings the review menu in line and fixes two issues surfaced along the way.Changes
ReviewHeaderMenu.tsx— theme picker now mapslight / dark / system, using the sharedthemeIcons(removed local duplicate Sun/Moon SVGs). Highlighting uses the stored mode directly instead of collapsingsystemto its resolved mode, so the System button highlights correctly.ActionMenu.tsx— widened the default dropdown panelw-56→w-64. The three-button segmented control overflowed the 224px panel (the "System" label clipped past the container edge).PlanHeaderMenuandReviewHeaderMenuare the onlyActionMenuconsumers, and both render the three-button row.themeRegistry.ts+ both header menus — addedgetUnsupportedMode()and disabled the incompatible mode button for dark-only/light-only color themes, instead of letting the toggle silently no-op. The highlight follows the mode actually rendered.Validation
bun run typecheck— cleanbun test— 1619 pass, 0 failapps/reviewbuild →build:hook) and manually verified in the browser: System option renders inside the container, follows macOS appearance changes live, and persists across reloads.UI verification