Skip to content

feat(titlebar): bring back the theme controls in the upper right - #915

Merged
svenmalvik merged 1 commit into
manifold-theme-palette-and-defaultfrom
titlebar-theme-controls
Aug 8, 2026
Merged

feat(titlebar): bring back the theme controls in the upper right#915
svenmalvik merged 1 commit into
manifold-theme-palette-and-defaultfrom
titlebar-theme-controls

Conversation

@svenmalvik

Copy link
Copy Markdown
Collaborator

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 main with 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, not main. It depends on that branch's theme set: the derived family list is what keeps Royal out. Merge #913 first and this retargets to main cleanly.

Testing

  • npm test — 376 files / 2931 tests pass.
  • npm run typecheck — clean across web, node, and plugins.
  • Drove the built app under Playwright with an isolated HOME + CFFIXED_USER_HOME, asserting against the real DOM: families ["Manifold","Garfield","Neon","Jade","Platinum"] (no Royal), selection manifold, 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.tsthemeFamilyOf strips 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 (covers src/renderer) gains an entry for TitleBar.tsx describing the controls and why the family list is derived.

🤖 Generated with Claude Code

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>
@svenmalvik
svenmalvik merged commit e96b4c3 into manifold-theme-palette-and-default Aug 8, 2026
1 check passed
@svenmalvik
svenmalvik deleted the titlebar-theme-controls branch August 8, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant