feat(portal-shell): align theme switcher trigger with locale switcher shape #164
Reference in New Issue
Block a user
Delete Branch "feat/portal-shell-theme-switcher-chip-shape"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Aligns the theme-switcher trigger on the same chip shape as the locale-switcher. Both controls live side-by-side in the footer's device-prefs cluster (#162); the visual mismatch (round icon button vs. chip) made them read as two unrelated widgets rather than one family.
The leading icon stays driven by
currentIcon()so a sun / moon / monitor glyph still flips with the selected mode — that's the visual feedback the original icon-only design existed for, and it's preserved.What lands
theme-switcher.htmlThe round Tailwind-utility icon button becomes a
.theme-switcher__triggerchip with three children — current-mode icon (size 14), localised mode label,chevron-down(size 12). Same children layout as.locale-switcher__trigger.theme-switcher.scssAdds
.theme-switcher__triggermirroring.locale-switcher__triggerrule-for-rule: same chip metrics (min-height 2.75rem for the AAA 44×44 tap target via vertical-padding overflow inside the thin footer), same hover/focus tokens, same dark-mode swap.Two copies rather than a shared
_chip-trigger.scsspartial — two switchers in one app is below the "three similar things" threshold CLAUDE.md sets for extraction. Promotes when a third switcher lands.Notes for the reviewer
button[aria-haspopup="menu"]+ the aria-label content ("Theme: <current> (open menu)"). Both preserved — the trigger button still hasaria-haspopup="menu"fromcdkMenuTriggerFor, andtriggerAriaLabel()is unchanged.currentLabel(), which already returnsLight/Dark/Systemfrom the existingtheme.mode.{light,dark,system}translation units (they were used in the dropdown menu items before this PR; now they also drive the trigger label). Prod i18n-strict build passes._chip-trigger.scssor a<lib-chip-trigger>component starts to pay off. The two copies today are mechanical and live next door — easy to keep in sync.portal-adminimpact. No theme switcher there (admin chrome is brand-primary-600 hardcoded for now); no change needed.Test plan
pnpm nx run-many -t lint test build --projects=portal-shell— green; 43 specs pass (unchanged from main).pnpm nx build portal-shell --configuration=production— i18n-strict prod build passes.pnpm nx serve portal-shell, open the home page in a browser, confirm:✓check.