feat(titlebar): bring back the theme controls in the upper right - #915
Merged
svenmalvik merged 1 commit intoAug 8, 2026
Merged
Conversation
The family dropdown and light/dark toggle were dropped from the title bar in a1023f6 ("remove theme controls from TitleBar"), which reached main with the workspaces rebuild (#880). Theme switching survived only in Settings and the command palette. This restores both controls at the title bar's trailing edge, on every shell branch including the pre-setup and no-project screens, matching where they sat before. The family list is now derived from the theme registry (getThemeFamilies()) instead of the hardcoded array the old code carried. That array is precisely what would have gone stale here: it still listed Royal, a family this branch retires, so restoring it verbatim would have shipped a dead option. Switching family preserves the current light/dark variant and the toggle flips the variant within the family, so the two controls stay independent. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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
Restores the theme family dropdown and light/dark toggle to the title bar's trailing edge.
They were dropped in a1023f6 ("remove theme controls from TitleBar", 2026-07-27), which reached
mainwith the workspaces rebuild (#880) — so from a user's point of view they vanished in that merge. Theme switching survived only in Settings and the command palette. Both controls are back on every shell branch, including the pre-setup and no-project screens, matching where they sat before.The family list is now derived from the theme registry (
getThemeFamilies()) instead of the hardcoded array the old code carried. That array is exactly what would have gone stale here — it still listed Royal, the family the base branch retires, so restoring it verbatim would have shipped a dead option that silently resolved to nothing.Switching family preserves the current light/dark variant, and the toggle flips the variant within the family, so the two controls stay independent.
Stacked on #913
Targets
manifold-theme-palette-and-default, notmain. It depends on that branch's theme set: the derived family list is what keeps Royal out. Merge #913 first and this retargets tomaincleanly.Testing
npm test— 376 files / 2931 tests pass.npm run typecheck— clean across web, node, and plugins.HOME+CFFIXED_USER_HOME, asserting against the real DOM: families["Manifold","Garfield","Neon","Jade","Platinum"](no Royal), selectionmanifold, toggle labelled Switch to Light theme, and the select positioned inside the 38px title bar past the window midpoint — i.e. actually in the upper right, not merely present.New coverage:
TitleBar.test.tsx— selecting a family calls back with the family id; the option list contains Manifold and Jade but not Royal and holds one entry per family rather than per theme; the toggle offers and reports the opposite variant. The pre-existing "carries no controls" test encoded the removal, so it is now scoped to "omits the controls when no handlers are wired", with a separate test keeping search out of the title bar.registry.test.ts—themeFamilyOfstrips the variant suffix and is idempotent;getThemeFamilies()collapses each dark/light pair into one entry, stays in step with the shipped theme list, and every family combined with either variant names a real theme.docs/architecture/renderer.md(coverssrc/renderer) gains an entry forTitleBar.tsxdescribing the controls and why the family list is derived.🤖 Generated with Claude Code