Skip to content

feat(client): add Storybook with component stories#256

Merged
MartianGreed merged 5 commits intomainfrom
feat/storybook
Feb 10, 2026
Merged

feat(client): add Storybook with component stories#256
MartianGreed merged 5 commits intomainfrom
feat/storybook

Conversation

@MartianGreed
Copy link
Collaborator

@MartianGreed MartianGreed commented Jan 7, 2026

Summary

  • Set up Storybook with Vite and dark theme support
  • Add Chromatic CI workflow for visual regression testing
  • Create stories for 37+ UI components
  • Fix GameCard text color for cartridge preset compatibility

Changes

  • Storybook setup: .storybook/main.ts, preview.ts, storybook.css
  • CI workflow: .github/workflows/ci-chromatic.yml for Chromatic visual testing
  • 37 story files covering UI components: modules, marketplace, dashboard
  • Bug fix: Changed text-white to text-foreground-100 in GameCard for cartridge preset compatibility

Test plan

  • Run pnpm --filter @cartridge/client storybook to verify all stories load
  • Verify GameCard text displays correctly (white text)
  • Chromatic CI workflow will run on PR

Note

Adds a visual documentation and review workflow for the client UI.

  • Storybook setup: client/.storybook/* (Vite config filters PWA plugins, alias @, sets __COMMIT_SHA__, dark/light themes, shared CSS)
  • Chromatic CI: new workflow .github/workflows/ci-chromatic.yml to publish Storybook previews with caching and token guard
  • Component stories: 30+ stories across ui/, modules/, marketplace/, and dashboard (e.g., GameCard, CollectibleCard, filters, tabs, icons, forms, pagination)
  • Build/config updates: client/package.json (storybook/chromatic scripts + deps), turbo.json (storybook/chromatic tasks), client/tsconfig.app.json (exclude *.stories.*), client/biome.json and root .gitignore (ignore storybook-static)
  • Minor UI fix: GameCard.tsx uses text-foreground-100 instead of text-white

Written by Cursor Bugbot for commit 525ee3d. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Jan 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
arcade Ready Ready Preview Feb 10, 2026 9:52am

Request Review

/Users/valentindosimont/www/c7e/arcade/client/src/components/ui/modules/edition-actions.stories.tsx
/Users/valentindosimont/.claude/plans/zazzy-percolating-wreath.md
/Users/valentindosimont/www/c7e/arcade/.github/workflows/ci-chromatic.yml
/Users/valentindosimont/www/c7e/arcade/.github/workflows/ci-chromatic.yml
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Developer tracking file accidentally committed to repository

Medium Severity

The .claude-modified-files file contains absolute paths from a developer's local machine (e.g., /Users/valentindosimont/...) and references to internal Claude planning files in .claude/plans/. This appears to be an internal tracking file that was accidentally staged and committed. It exposes the developer's username, local directory structure, and internal tooling artifacts that shouldn't be in version control.

Fix in Cursor Fix in Web

<div className="w-[500px]">
<Story />
</div>
</MemoryRouter>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Story uses wrong router library for component

Low Severity

The LeaderboardRow component imports Link from @tanstack/react-router, but the story file wraps it with MemoryRouter from react-router-dom. These are incompatible router libraries. While the current stories don't pass the to prop (so the Link isn't rendered), any future story that tests the linking functionality would fail because TanStack Router's Link component requires a TanStack Router context, not a react-router-dom context.

Fix in Cursor Fix in Web


form.setError("password", {
message: "Password must be at least 8 characters",
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Form story calls setError in render causing potential loop

Low Severity

The FormWithErrorExample component calls form.setError() directly in the function body rather than in a useEffect hook. This state-modifying call executes on every render, which is incorrect React patterns and could cause infinite re-render loops depending on react-hook-form's internal implementation. To demonstrate an error state, the setError call needs to be wrapped in a useEffect with an empty dependency array to run only once on mount.

Fix in Cursor Fix in Web

- Set up Storybook with Vite and dark theme support
- Add Chromatic CI workflow for visual regression testing
- Create stories for 37+ UI components
- Fix GameCard text color for cartridge preset compatibility
- Exclude stories from production TypeScript build
- Merge latest main into feat/storybook
- Upgrade Storybook 8.5 → 10.2.8 (fixes Node 22 ESM require error)
- Apply automigrations: consolidated imports, addon cleanup, ESM fixes
- Resolve merge conflicts in .gitignore and GameCard.tsx
- Keep text-foreground-100 fix from original PR
- Fix AssetPreview stories: add required 'order' prop (set to null)
- Fix LeaderboardRow stories: migrate from react-router-dom MemoryRouter
  to @tanstack/react-router (matching the actual component)
- Add Tooltip stories (Default, LongContent, WithIcon)
- Add PositionCard stories (Default, NegativePnl, LargePosition, List)
- Add PredictCard stories (Default, TiedScore, HighStakes, CardGrid)

Skipped components with heavy provider dependencies:
- achievement-card (useAnalytics/PostHog)
- arcade-header (useDevice, useTheme, SidebarToggle)
- tabs/sub-tabs (useDevice, useAnalytics)
- price-footer (ListingWithUsd, erc20Metadata)
- summary (useAnalytics via game-header)
- CollectionHeader (useMarketplaceItemsViewModel, useShare)
@MartianGreed MartianGreed merged commit a193606 into main Feb 10, 2026
9 checks passed
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.

1 participant