docs(storybook): restore story defaults dropped by the Storybook 9 upgrade#1093
Open
frankieyan wants to merge 9 commits into
Open
docs(storybook): restore story defaults dropped by the Storybook 9 upgrade#1093frankieyan wants to merge 9 commits into
frankieyan wants to merge 9 commits into
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
doistbot
reviewed
Jul 9, 2026
doistbot
left a comment
Member
There was a problem hiding this comment.
This PR fixes a Storybook 9 crash by migrating all argTypes.defaultValue entries into args blocks, and simplifies the storybook helper functions by dropping their defaultValue parameter.
Few things worth tightening:
- A few stories still rely on
selectWithNone()/selectSize()without matchingargs(e.g.,Columns/AlignmentStory,Stack/InteractivePropsStory, heading/text playgrounds). They'll still open with blank controls in Storybook 9 — either keep the helper default or add explicitargs: { …: 'none' }at each remaining site. space: 'medium'is now repeated across four story-levelargsblocks incolumns.stories.tsx. Hoisting it toexport default.argswould give a single source of truth and make future stories easier to get right.
I also included a few optional follow-up notes in the details below.
Optional follow-up notes (2)
src/utils/storybook-helper.tsx:24: Removing the implicit
'none'default here leaves a few stories regressed, because they still inheritselectWithNone()/selectSize()argTypes without defining matchingargs. For example,Columns/AlignmentStory(space,align,alignY),Stack/InteractivePropsStory(space,align,dividers), and the heading/text playgrounds (size,lineClamp,align) will still load with empty controls in Storybook 9. Either keep the helper default until each caller has explicitargs, or addargs: { ...: 'none' }at the remaining story/meta sites.src/columns/columns.stories.tsx:287:
space: 'medium'is now repeated in four story-levelargsblocks in this file. Sincespaceis already a file-level control andAlignmentStoryuses the same prop, hoisting this toexport default.argswould give the file one source of truth for the initial spacing and make future story additions less easy to miss.
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.
Short description
Box's Margin Story crashes because it expected a
marginarg to be provided, but it was never supplied. This is because it was passed in throughargTypes.margin.defaultValue, and Storybook droppeddefaultValueas a source of initial args in v7, in favour ofargs.On top of fixing the crash, we also remove all other defaultValues, and move them into args instead.
Reference
Demo
Margin Story crashed on mount. The empty
margincontrol in the "before" screenshot is the root cause:Interactive Props Story didn't crash, but rendered an empty canvas with every control unset:
Padding Story rendered, but with
paddingundefined:Test plan
PR Checklist