Skip to content

fix(review): show System in theme menu via shared mode list#1015

Merged
backnotprop merged 4 commits into
backnotprop:mainfrom
gwynnnplaine:fix/review-theme-system-ssot
Jul 16, 2026
Merged

fix(review): show System in theme menu via shared mode list#1015
backnotprop merged 4 commits into
backnotprop:mainfrom
gwynnnplaine:fix/review-theme-system-ssot

Conversation

@gwynnnplaine

@gwynnnplaine gwynnnplaine commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Small QoL fix. I've sent a couple of little patches before (#523); while using code review I hit a papercut worth fixing.

The papercut

The code-review Options → Theme menu only offers Light/Dark, but plan review, annotate, and Settings all offer System too — so "follow OS theme" silently wasn't available in review.

Root cause

Each surface hand-listed its own theme modes (PlanHeaderMenu, ReviewHeaderMenu, ThemeTab, ModeToggle). The review picker had dropped system, and its activeTheme memo collapsed system → the resolved light/dark, so a System button couldn't have shown as active anyway.

Changes

  • Added one shared list, packages/ui/components/themeModes.ts (THEME_MODES), carrying each mode's id + label + icon.
  • Mode is now derived from that list, so a mode can't exist without a render entry and no surface can omit one (no separate completeness guard needed).
  • All four pickers map the shared list; active state = the selected mode everywhere. Dropped ReviewHeaderMenu's activeTheme memo and its local Sun/Moon icons.

Verification

typecheck clean · apps/review build + build:hook green · manual: plannotator review now shows Light/Dark/System (System selectable, follows the OS); plan/annotate/Settings/landing unchanged.

Not in this PR

ThemeProvider still exposes redundant theme/setTheme and mode/setMode aliases — happy to collapse those separately if you'd like.

@gwynnnplaine

Copy link
Copy Markdown
Contributor Author

@backnotprop mind taking a look when you get a chance? hope it's ok I skipped the issue since it's tiny QoL stuff..

gwynnnplaine and others added 2 commits July 15, 2026 21:25
The review Options menu offered only Light/Dark while the plan, annotate,
and Settings surfaces offered System too. Four surfaces each hand-listed
the theme modes independently, so the review picker had silently dropped
`system` and could never highlight it (its `activeTheme` memo collapsed
system to the resolved light/dark).

Introduce `THEME_MODES` as one shared list of the mode set with each
mode's label and icon; derive `Mode` from it so a mode cannot exist
without a render entry, and no surface can omit one. All four pickers
(plan, review, Settings, landing toggle) now map the same list; active
state is the selected mode everywhere.

🩸 Co-Authored-By: Dexter - @gwynnnplaine's Pi (https://pi.dev/) assistant
Preserve the published Mode import, expose shared mode data through a supported package export, and keep System selection coherent with constrained palettes and live OS changes. Scope the wider menu geometry to the two theme pickers and add public-consumer and focused DOM coverage.

Co-authored-by: sasha <kredich05@gmail.com>
@backnotprop
backnotprop force-pushed the fix/review-theme-system-ssot branch from eb83531 to 8f7913d Compare July 16, 2026 04:49
@backnotprop

Copy link
Copy Markdown
Owner

Maintainer repair pushed at exact head 8f7913d70085d3bbba1cd43172ce68e4b312207d, rebased onto current main.

This keeps #1015's Light/Dark/System single source of truth while preserving the published Mode import, adding the supported @plannotator/ui/theme-modes export, making System persistence/live OS resolution coherent with constrained palettes, and scoping the wider three-button menu to the plan/review pickers only. Public-consumer compile coverage and focused provider/menu DOM tests are included.

Local validation is green: full typecheck; 1,946-test core suite; 108-test DOM CI suite; strict public-consumer compile; hook, review, OpenCode, Pi, VS Code, portal, marketing, and UI CSS builds. Browser checks covered plan, review, annotate, Settings, reload persistence, menu geometry, single-mode palettes, and populated Pierre shadow roots in Light/Dark/System. Live OS preference changes are covered by the focused matchMedia test.

Useful constrained-palette and menu-geometry design from #1047 was incorporated without its duplicated mode list or global ActionMenu widening. Its contributor, sasha (alexanderkreidich), is credited with a verified co-author trailer on the repair commit. Vladyslav Hrabovyi (gwynnnplaine) remains the author of this PR and its original implementation.

Two independent exact-head reviews (Standards and Spec) are green with no remaining findings. Waiting for GitHub CI before squash merge.

@backnotprop
backnotprop force-pushed the fix/review-theme-system-ssot branch from b08946e to 4fb9fe5 Compare July 16, 2026 05:30
@backnotprop
backnotprop merged commit 92c311a into backnotprop:main Jul 16, 2026
13 checks passed
@gwynnnplaine

gwynnnplaine commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@backnotprop 🫶

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.

2 participants