refactor(chrome): one SSOT per chrome shape — Panel, BottomNav, nav-state - #251
Closed
catomean wants to merge 1 commit into
Closed
refactor(chrome): one SSOT per chrome shape — Panel, BottomNav, nav-state#251catomean wants to merge 1 commit into
catomean wants to merge 1 commit into
Conversation
…ate)
Header/footer/nav/panels now follow one design + code pattern instead of
~30 hand-rolled variants. Establishes three primitives and migrates the
highest-value duplications onto them.
New SSOT primitives:
- lib/design/nav.ts — NAV_STATE + navLinkClass(): the ONE definition of
active/inactive per nav shape (sidebar/bottomTab/pill). Kills the
ring-action/20-vs-/30-vs-inline fragmentation. admin-ui.navActive
re-exports from it.
- components/ui/Panel.tsx — titled card-shell surface (title/subtitle/
icon/action header slot). Replaces hand-rolled
"bg-surface-base rounded-lg border p-5" + bespoke <h2>.
- components/layout/BottomNav.tsx — the byte-identical admin+dashboard
mobile tab bar, in a neutral home (dashboard can't import app/admin).
Consolidations:
- Fold redundant ResponsiveHero into PageHero (1 consumer migrated; drops
its inline-style dot-pattern, from-black gradient, color-ladder). Deleted.
- 6 panels -> <Panel>; RequestSidebar/TimecardHistorySidebar -> <Card>.
- Both bottom navs -> <BottomNav>; dashboard sheet pills -> navLinkClass('pill').
- AdminSidebar: 4x-repeated item -> navLinkClass('sidebar'); harmonize Hirn drift.
- NavItem: consume designPrimitive.focus (drop divergent inline ring).
- Fix duplicate-class "border border" typos in Contributions/Needs panels.
Docs: CLAUDE.md "Chrome & Navigation SSOT" section + audit greps.
Net -174 lines. verify green (typecheck, lint 0 err, i18n 16/16). Hero
migration visually confirmed light+dark.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Author
|
Shipped to main via fast-forward (rebased). Chrome SSOT (Panel/BottomNav/nav-state + hero unify) is live on prod. |
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.
Why
Header, footer, nav bars, and panels were following ~30 different hand-rolled patterns — the "everything is all over the place, no SSOT" problem. This makes every one of them follow one design + one code pattern, so retheming or fixing chrome is a single edit, not a codebase sweep.
Three subagent audits mapped every divergence first (sidebars/nav, panels, headers/heroes); this PR establishes the missing primitives and migrates the highest-value, lowest-risk duplications. Net −174 lines.
New SSOT primitives
lib/design/nav.ts—NAV_STATE+navLinkClass()sidebar/bottomTab/pill)ring-action/20vs/30vs inlinebg-action-muted text-actionvsborder-action …— 5 encodings of "current page"components/ui/Panel.tsxcard-shellsurface (title / subtitle / icon / action header slot)bg-surface-base rounded-lg border p-5+ bespoke<h2>(7 copies, each drifting on radius/border/shadow)components/layout/BottomNav.tsxapp/admin/*)z-40/z-50+border/border-subtleConsolidations
ResponsiveHerointoPageHero(its 1 consumer migrated) and deleted it — removes its inline-style dot-pattern,from-black/50gradient, and per-color text-color ladder. The page now matches the other 23PageHeropages.<Panel>: ResultsPanel, VotingPanel, TeamTasks/TeamProtocols, Contributions, Needs.<Card>: RequestSidebar (5×card-shell p-6), TimecardHistorySidebar (manualrounded-xl border …).<BottomNav>: admin + dashboard bars; dashboard sheet pills →navLinkClass('pill').navLinkClass('sidebar'); Hirn active-state drift harmonized.adminInteractive.navActivenow re-exportsNAV_STATE.sidebar.active(value lives in one place).designPrimitive.focus(dropped a divergent inline focus ring).border bordertypos in Contributions/Needs panels.Docs (the "reflect this in CLAUDE.md" ask)
Added a "Chrome & Navigation — one primitive per shape (SSOT)" section to
CLAUDE.md(decision table: which primitive for which shape) + audit greps for hand-rolled card shells / nav-active drift / deprecatedbg-opacity-*.Verification
typecheckclean ·lint0 errors ·test:i18n16/16.ResponsiveHero→PageHeromigration visually confirmed in light + dark (screenshots in the chat).Deliberately deferred to a focused follow-up PR
Higher-risk / subtler, kept out to keep this reviewable:
<Drawer>/<Sheet>primitive (MessageSidebar + MobileMenu + dashboard sheet, with focus-trap + scroll-lock) — also fixes MessageSidebar's deprecatedbg-opacity-50.AdminSectionHeader→SectionHeaderand migrateTimecardHeader/RequestHeader/DecisionHeaderCardonto it.DecisionHeaderCardgod-component.BlogNavigationClientinlinestyle={{ backgroundColor }}→ CSS var;mono-eyebrowtoken sweep (10+ files).🤖 Generated with Claude Code