Skip to content

build(deps): replace ladle with storybook 10 as the component workbench - #88

Merged
TheGreatAxios merged 2 commits into
corbitsdev:mainfrom
pratikbuilds:claude/zealous-mcnulty-3ed6f4
Oct 19, 2026
Merged

TheGreatAxios merged 2 commits into
corbitsdev:mainfrom
pratikbuilds:claude/zealous-mcnulty-3ed6f4

Conversation

@pratikbuilds

@pratikbuilds pratikbuilds commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

Storybook 10 (@storybook/react-vite) replaces Ladle as the component workbench. Ladle has had no release since Nov 2025 and is pinned to Vite 6. The existing stories are plain CSF and are indexed unchanged: 157 stories across 51 files.

  • bun run stories starts Storybook on 127.0.0.1:6006, and bun run stories:build writes the static build to build/.
  • A toolbar global switches the theme. A decorator sets the real .dark/.light class on <html> during render, so a story's first paint uses the selected theme. Light is pinned with .light because, with neither class set, theme.css follows the OS.
  • Controls are off, because stories express state through separate exports.
  • The tailnet host allowance (.ts.net) moves to core.allowedHosts in .storybook/main.ts, because Storybook replaces Vite's server block with its own.
  • vite.ladle.config.mjs is renamed to vite.stories.config.mjs.

Accessibility sweep

e2e/stories-a11y.spec.ts reads Storybook's index.json, loads each story's iframe in light and dark, and also fails when a story throws.

On main the Ladle sweep resolved [data-storyloaded] before the story mounted. At that point a form story had no controls on the page yet, so axe mostly scanned an empty page. The Storybook sweep waits for each story to settle, meaning the theme class is applied and enter transitions are finished, and then scans it. It finds 57 existing serious or critical violations, the same 57 on every run. Examples are unlabelled Textarea and Select stories, listitem in the sidebar panel, and scrollable-region-focusable in the page panel.

These are recorded in e2e/stories-a11y.known.json to fix in follow-ups. Only a violation not on that list fails the run.

Verification

  • bun run test:e2e: exit 0, 21 passed, including the axe sweep against the baseline.
  • Every story in the static build renders without an error display in both themes, and <html> carries the selected theme class at first paint. The exception is the theme-toggle story, whose own ThemeProvider pins light.
  • bun run typecheck, lint, format:check, test (240 pass) and dep-guard all pass.
  • Dev server: a *.ts.net Host header gets 200 and any other host gets 403. Switching the toolbar to dark repaints the canvas dark.

Closes #89

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA.
Posted by the CLA Assistant Lite bot.

@pratikbuilds

Copy link
Copy Markdown
Collaborator Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Oct 19, 2026
Ladle has had no release since Nov 2025 and is pinned to Vite 6.
Storybook 10 (react-vite) indexes the existing CSF stories unchanged.

The e2e axe sweep now loads each story from the Storybook index and
fails on render errors. It sees violations the Ladle sweep missed,
because that sweep ran before stories mounted; those are recorded in a
checked-in baseline to fix later, and only new ones fail the run.
@pratikbuilds
pratikbuilds force-pushed the claude/zealous-mcnulty-3ed6f4 branch from fc8d4d0 to 2d6a426 Compare October 19, 2026 10:39
@pratikbuilds

Copy link
Copy Markdown
Collaborator Author

I have read the CLA Document and I hereby sign the CLA

The sweep scanned as soon as Storybook showed the story, while sidebar
rows were still mounting or fading in, so contrast results depended on
runner speed and CI flagged rows that pass locally. It now waits for the
theme class, two frames and any finite transition before scanning.

The baseline drops the ten contrast entries that only came from scanning
mid-fade; the settled sweep gives the same 57 violations on every run.
@TheGreatAxios
TheGreatAxios merged commit ee759b7 into corbitsdev:main Oct 19, 2026
2 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.

Replace Ladle with Storybook as the component workbench

2 participants