Skip to content

fix(storybook): drop Pre from MdComponents story to unblock chromatic#18262

Merged
pettinarip merged 1 commit into
stagingfrom
fix/storybook-decorator-hooks
May 22, 2026
Merged

fix(storybook): drop Pre from MdComponents story to unblock chromatic#18262
pettinarip merged 1 commit into
stagingfrom
fix/storybook-decorator-hooks

Conversation

@pettinarip
Copy link
Copy Markdown
Member

@pettinarip pettinarip commented May 22, 2026

Summary

feat(md): render fenced code via Codeblock (ba00561) changed the shared <Pre> wrapper in MdComponents to render the async server component Codeblock (it awaits shiki's highlight()). Chromatic's client-side test runner can't render async server components, so it bubbles up a generic "Storybook preview hooks can only be called inside decorators and story functions" error and fails the entire visual regression build.

Since Codeblock has its own dedicated story (with chromatic.disableSnapshot set for the same reason), the cleanest fix is to drop the <Pre> demo from MdComponents.stories.tsx. Every other md element (headings, paragraphs, title, divider, hr, featured text) is still covered visually.

Test plan

  • pnpm type-check passes
  • pnpm build-storybook succeeds
  • MdComponents story renders locally without <Pre>
  • Chromatic build goes green

@pettinarip pettinarip requested a review from wackerow as a code owner May 22, 2026 15:20
@netlify
Copy link
Copy Markdown

netlify Bot commented May 22, 2026

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 4138475
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/6a1077c9fb79ae0008f249b3
😎 Deploy Preview https://deploy-preview-18262.ethereum.it
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 66 (🟢 up 2 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (🟢 up 1 from production)
SEO: 98 (🔴 down 1 from production)
PWA: 59 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the tooling 🔧 Changes related to tooling of the project label May 22, 2026
wackerow
wackerow previously approved these changes May 22, 2026
The recent change that routed fenced code through Codeblock made the
shared <Pre> wrapper an async server component (Codeblock awaits
shiki's highlight()). Chromatic's client-side test runner can't
render async server components, which surfaces as a generic
"Storybook preview hooks can only be called inside decorators and
story functions" error and fails the whole build.

Codeblock has its own dedicated story (with chromatic snapshot
disabled), so removing the <Pre> demo from MdComponents keeps full
visual coverage of every other md element (headings, paragraphs,
title, divider, hr, featured text) without duplicating coverage of
Codeblock.
@pettinarip pettinarip force-pushed the fix/storybook-decorator-hooks branch from 68fc774 to 4138475 Compare May 22, 2026 15:35
@pettinarip pettinarip changed the title fix(storybook): import useEffect from storybook/preview-api in theme decorator fix(storybook): drop Pre from MdComponents story to unblock chromatic May 22, 2026
@pettinarip pettinarip merged commit de4395f into staging May 22, 2026
11 of 13 checks passed
@pettinarip pettinarip deleted the fix/storybook-decorator-hooks branch May 22, 2026 15:43
@github-actions
Copy link
Copy Markdown
Contributor

Page Performance Accessibility Best practices SEO PWA

Lighthouse scores are calculated based on the latest audit results

@pettinarip pettinarip mentioned this pull request May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tooling 🔧 Changes related to tooling of the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants