Storybook: Fix component descriptions in manifest files#77112
Draft
Storybook: Fix component descriptions in manifest files#77112
Conversation
|
Size Change: 0 B Total Size: 7.74 MB ℹ️ View Unchanged
|
|
Flaky tests detected in 8169c59. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24103637878
|
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.
What?
Fixes published Storybook component manifest to ensure correct component descriptions are included.
Example: https://wordpress.github.io/gutenberg/manifests/components.html
"A badge component for displaying labels with semantic intent" is the wrong description.
Draft:
We should do one of the following:
Why?
So that component descriptions are accurate based on implementation documentation.
How?
These are documented correctly in code, so it appears to be an issue with how Storybook resolves components.
The proposed fix was based on an observation of how this wasn't problematic with the output of some components that already used this approach for importing components from its source (
Card,Collapsible,Dialog,Notice). It's a hacky fix around how Storybook (more specifically, likelyreact-docgen-typescript) is unable to follow the imports. The hypothesis is that it chooses Badge description because the previous code points to the root barrel index and Badge is the first export in that file.I went down a long rabbit hole of trying to find related issues and release notes about this problem in related packages. I'll plan to share those more completely as this takes shape. But my attempts to update to newer versions were unsuccessful due to some errors about package resolution. And while newer versions support Vite 8+, there may be some blockers for us to use that (e.g. Node/ESM support).
Testing Instructions
Verify manifest output:
npm run storybook:buildopen storybook/build/manifests/components.html)AlertDialog.Rootand other@wordpress/uicomponentsUse of AI Tools
Used Claude Code + Opus 4.6 in the troubleshooting process and implementing the import workaround based on the working convention of other components.