Catch up Storybook preview, coverage, and story hygiene #67

Merged
an.di merged 1 commits from adilallo/maintenance/StorybookCatchup into main 2026-08-18 01:32:09 +00:00
Owner

Overview

Storybook had lapsed relative to the app: preview only wrapped MessagesProvider, so Top and every create-flow page story threw; @storybook/addon-docs was missing so autodocs tags did nothing; fonts/viewports didn’t match the DS; and several components and wizard screens had no stories.

This PR brings preview, config, coverage, and story hygiene in line with the current app in one change.

Changes

Preview / config

  • .storybook/preview.js now wraps MessagesProviderAuthModalProviderCreateFlowProvider (same stack as tests/utils/test-utils.tsx)
  • Dark canvas default; Figma/Tailwind viewports sm 430 / md 640 / lg 1024 / xl 1440
  • Fonts: Inter + Bricolage Grotesque + Space Grotesk CSS variables (matching app/layout.tsx)
  • Add @storybook/addon-docs and @storybook/addon-a11y; drop no-op webpackFinal
  • Remove dead storybook:github / storybook:build:github scripts and orphan .storybook/vitest.setup.js

Coverage

  • New stories: InputLabel, ListItem, Accordion
  • New create-flow page stories: Conflict management, Membership methods, Community structure, Core values, Published stakeholders
  • Move RailLockupAndInfoBox to stories/create-flow/
  • Delete duplicate HeroBannerSystem stories

Hygiene

  • Unify page titles under Pages/Create Flow/…
  • Drop duplicate MessagesProvider wrappers (Share, AddCustomField)
  • CSF3 conversion for remaining Template.bind() files
  • Wire argTypes from lib/propNormalization.ts *_OPTIONS where those consts exist
  • Token classes instead of story-local Inter/hex fallbacks (Vertical, InlineTextButton, Login)
  • Update .cursor/rules/storybook.mdc to match the above

How to Test

  1. npm run storybook
  2. Open Components/Navigation/Top (or Header) — should mount without useAuthModal errors
  3. Open Pages/Create Flow/Conflict management (and Community structure / Core values) — should mount without useCreateFlow errors
  4. Open Components/Buttons/ButtonDocs tab — autodocs should render
  5. Viewport toolbar: sm 430 / md 640 / lg 1024 / xl 1440
  6. Canvas default should be dark; Inter / Bricolage / Space Grotesk should load
  7. npm run storybook:build (already run locally — succeeded)

Notes

  • npx tsc --noEmit passed. npm run knip still reports pre-existing unused seedDataRoot in prisma/seed/seedDataPaths.ts (unrelated).
  • AskOrganizer stories keep a hardcoded variant list so use-case-detail is not dropped (ASK_ORGANIZER_VARIANT_OPTIONS omits it).
  • Published-stakeholders story stubs /stakeholders fetch to an empty list; add/resend is not fully exercised.
  • Not in this PR: remaining hardcoded argTypes on older stories, Storybook CI, or converting every story to TypeScript.
## Overview Storybook had lapsed relative to the app: preview only wrapped `MessagesProvider`, so `Top` and every create-flow page story threw; `@storybook/addon-docs` was missing so `autodocs` tags did nothing; fonts/viewports didn’t match the DS; and several components and wizard screens had no stories. This PR brings preview, config, coverage, and story hygiene in line with the current app in one change. ## Changes **Preview / config** - `.storybook/preview.js` now wraps `MessagesProvider` → `AuthModalProvider` → `CreateFlowProvider` (same stack as `tests/utils/test-utils.tsx`) - Dark canvas default; Figma/Tailwind viewports `sm` 430 / `md` 640 / `lg` 1024 / `xl` 1440 - Fonts: Inter + Bricolage Grotesque + Space Grotesk CSS variables (matching `app/layout.tsx`) - Add `@storybook/addon-docs` and `@storybook/addon-a11y`; drop no-op `webpackFinal` - Remove dead `storybook:github` / `storybook:build:github` scripts and orphan `.storybook/vitest.setup.js` **Coverage** - New stories: `InputLabel`, `ListItem`, `Accordion` - New create-flow page stories: Conflict management, Membership methods, Community structure, Core values, Published stakeholders - Move `RailLockupAndInfoBox` to `stories/create-flow/` - Delete duplicate `HeroBannerSystem` stories **Hygiene** - Unify page titles under `Pages/Create Flow/…` - Drop duplicate `MessagesProvider` wrappers (Share, AddCustomField) - CSF3 conversion for remaining `Template.bind()` files - Wire `argTypes` from `lib/propNormalization.ts` `*_OPTIONS` where those consts exist - Token classes instead of story-local Inter/hex fallbacks (Vertical, InlineTextButton, Login) - Update `.cursor/rules/storybook.mdc` to match the above ## How to Test 1. `npm run storybook` 2. Open **Components/Navigation/Top** (or Header) — should mount without `useAuthModal` errors 3. Open **Pages/Create Flow/Conflict management** (and Community structure / Core values) — should mount without `useCreateFlow` errors 4. Open **Components/Buttons/Button** → **Docs** tab — autodocs should render 5. Viewport toolbar: `sm` 430 / `md` 640 / `lg` 1024 / `xl` 1440 6. Canvas default should be dark; Inter / Bricolage / Space Grotesk should load 7. `npm run storybook:build` (already run locally — succeeded) ## Notes - `npx tsc --noEmit` passed. `npm run knip` still reports pre-existing unused `seedDataRoot` in `prisma/seed/seedDataPaths.ts` (unrelated). - `AskOrganizer` stories keep a hardcoded variant list so `use-case-detail` is not dropped (`ASK_ORGANIZER_VARIANT_OPTIONS` omits it). - Published-stakeholders story stubs `/stakeholders` fetch to an empty list; add/resend is not fully exercised. - Not in this PR: remaining hardcoded `argTypes` on older stories, Storybook CI, or converting every story to TypeScript.
an.di added 1 commit 2026-08-18 01:31:09 +00:00
Stories were throwing without AuthModal/CreateFlow providers, autodocs was a no-op, and several DS/create-flow screens had no stories.
an.di self-assigned this 2026-08-18 01:31:20 +00:00
an.di merged commit 0aceb58c13 into main 2026-08-18 01:32:09 +00:00
an.di deleted branch adilallo/maintenance/StorybookCatchup 2026-08-18 01:32:10 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CommunityRule/community-rule#67