Repository navigation
feat(storybook): foundation governance stories (#406 PR7) - #426
Merged
Merged
Conversation
The Storybook palette toolbar only exposed 4 of the 11 THEME_PALETTES, so 7 palettes with full CSS definitions were invisible in review. The contract only checked the subset direction, which let the gap survive. Add all 11 palettes to the preview.tsx toolbar, tighten the contract to assert bidirectional equality (offered == allowed), and sync the stale smoke.md S10 section (5 → 11).
Auto-enumerate Phosphor icons (makeIcon products filtered by displayName) and bot brand icons (MAKA_BOT_ICON_BODIES keys) so the registry stays complete without manual maintenance. Contract locks the enumeration seam.
…e contract Add 6 Design System stories (Palette Matrix, Typography, Spacing, Elevation, Layering, Interaction States) covering the full CSS/token foundation surface. Extend the contract to lock required Design System story exports and catch undefined token references in foundation stories.
…z-index sort - Make default palette addressable via :root, [data-maka-theme="default"] selector so the Palette Matrix default tile renders real :root values even when the toolbar selects a non-default palette (Codex P2). - Update readCssToken regex to handle combined selectors. - Sort zScale array by numeric value to match the 'sorted by value' claim (Codex P3).
…oggle - Deduplicate Phosphor icon entries by displayName so alias exports (ChevronLeftIcon = ChevronLeft etc.) no longer render duplicate tiles in the Icons grid (subagent review P3). - Replace useState + MutationObserver with useSyncExternalStore in palette-matrix so dark-mode toggle re-renders synchronously without a one-frame stale flash (subagent review P3).
…n token guard, single-source palettes - Merge InteractionStates into PrimaryActions (loading slot added); remove the standalone story to eliminate default/disabled/icon duplication flagged in review. - Upgrade undefined-token guard: support var(--x, fallback), var( --x ), and double/backtick quotes; scan styles.css too; auto-discover story files via readdirSync instead of a hand- maintained list. - Generate palette toolbar items from THEME_PALETTES with a label map, removing the double-maintenance surface; contract now asserts the toolbar is single-sourced from @maka/core.
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
Make Storybook the visible, reviewable, lockable surface for the CSS/token foundation. This is PR7 of #406 — the acceptance pass that exposes foundation rules so PR2-PR6 can be reviewed in Storybook without driving the desktop app into product states.
Why
The design-system refactor (#406) needs a governance surface. Storybook had only 2 Design System stories (Tokens, Animation Catalog) and the palette toolbar exposed 4 of 11 palettes. The contract only checked subset, not completeness. PR2-PR6 (color, motion, radius, accent split, borders) have no visible review surface yet.
Scope
Changed:
THEME_PALETTES); contract upgraded from subset to bidirectional equalitydesign-tokens.stories.tsx: addedSemanticColorsexport (action/control/link/focus-ring/status-running/nav-active/toast-accent)animation-catalog.stories.tsx: addedDurationScaleandEasingScaleexportsstorybook-baseline-contract.test.ts: 3 new contract blocks (icon tracking, foundation story exports, undefined-token-reference guard)tests/smoke.md§S10: synced 5 → 11 palettesNew:
icons.stories.tsx— auto-tracks allmakeIconproducts via displayName filter + bot brand icons viaMAKA_BOT_ICON_BODIESkeyspalette-matrix.stories.tsx— 11 palettes × light/dark grid (per-blockdata-maka-theme+.dark)typography.stories.tsx— font-sans/mono, Markdown, code blockspacing.stories.tsx—--spacingstep scale + layout geometry tokenselevation.stories.tsx— 4 shadow recipes + border tokenslayering.stories.tsx— 10 z-index tokens sorted by valueinteraction-states.stories.tsx— default/disabled/loading/icon buttonsNot included:
Verification
npm run -w @maka/desktop test— 1648 pass (3 new contract it blocks)npm run typecheck— all workspaces passnpm run -w @maka/desktop build-storybook— builds successfullyReviewer notes
4 atomic commits:
fc88c306palette toolbar + bidirectional contract + smoke.md sync6c2cdd0bicon story (auto-tracked via displayName, zero-maintenance)f19551eaSemanticColors + DurationScale/EasingScale stories33d82d326 foundation stories + foundation-exports contract + token-reference guardThe token-reference contract scans all 9 Design System story files for
var(--*)and string-literal token references, asserting each resolves to a token defined inmaka-tokens.css. This catches future undefined-token drift structurally, without pixel assertions.