Admin UI: Fix Page Header not rendering with only actions and add stories#76695
Admin UI: Fix Page Header not rendering with only actions and add stories#76695
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +6 B (0%) Total Size: 7.73 MB
ℹ️ View Unchanged
|
|
Flagging that we have an issue with page header specs — in that sense, code and Storybook examples should ideally align with the scenarios. From a quick look:
|
Fair enough, my goal here was to actually have a sample of how things look so you don't have to implement custom code to see it, it would be on the storybook itself. Then again, maybe the storybook is not meant for that but only to represent the specs. I'll remove the mentioned stories and look at specs for any missing stories. Thanks! |
a76fd0a to
58781e1
Compare
|
Flaky tests detected in 72d2d17. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23760484918
|
|
@ciampo @jameskoster While this PR doesn't really solve anything, do you think it'd be worth merging? More cases/examples on the Storybook seems like a good way to offer easy testing and keeping an eye on things |
There was a problem hiding this comment.
Assuming that all new examples follow the design specs linked above, I think they can be useful additions.
Let's update the PR description so that it's up to date with the code changes, and consider adding a CHANGELOG entry to the admin-ui package listing the fix?
| */ | ||
| import type { Meta, StoryObj } from '@storybook/react-vite'; | ||
| import { __experimentalText as Text } from '@wordpress/components'; | ||
| import { __experimentalText as Text, Button } from '@wordpress/components'; |
There was a problem hiding this comment.
Should we use Button and Text from @wordpress/ui ?
There was a problem hiding this comment.
Thanks for pointing it out! Added your suggestion and a changelog
There was a problem hiding this comment.
I'm still seeing the old imports from @wordpress/components, maybe you didnt' push your changes?
There was a problem hiding this comment.
Sorry, ESLint rule @wordpress/use-recommended-components is blocking me from commit/push. Even if I use --no-verify I think the CI is gonna block it. Any ideas?
There was a problem hiding this comment.
Right. I'd be ok with disabling that ESLint rule specifically for that line of code.
@mirka Should we start allowing Button and Text from @wordpress/ui?
There was a problem hiding this comment.
Neither are ready yet, unfortunately. Remaining blockers (#76135) relevant to those two specifically:
Button: Global CSS defense, and overflow behavior. Probably could also use a migration guide for style variants.Text: Global CSS defense.
There was a problem hiding this comment.
Gotcha, I added the skip comment, hopefully CI will follow it as well.
… stories The Page component Header was not rendered when only the actions prop was provided, because actions was missing from the render condition. This adds actions to the condition and introduces new Storybook stories covering more prop combinations: without header, badges, actions, and a full header example. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
28fc8bd to
e22b60a
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ciampo
left a comment
There was a problem hiding this comment.
Thank you for the patience in iterating 🙏
…ries (#76695) * Admin UI: Fix Page Header not rendering with only actions and add new stories The Page component Header was not rendered when only the actions prop was provided, because actions was missing from the render condition. This adds actions to the condition and introduces new Storybook stories covering more prop combinations: without header, badges, actions, and a full header example. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Remove off-spec stories and drop title from FullHeader Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * rebase and fix conflicts * Use Button and Text from @wordpress/ui in Page stories Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: CGastrell <cgastrell@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org>
…ries (#76695) * Admin UI: Fix Page Header not rendering with only actions and add new stories The Page component Header was not rendered when only the actions prop was provided, because actions was missing from the render condition. This adds actions to the condition and introduces new Storybook stories covering more prop combinations: without header, badges, actions, and a full header example. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Remove off-spec stories and drop title from FullHeader Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * rebase and fix conflicts * Use Button and Text from @wordpress/ui in Page stories Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: CGastrell <cgastrell@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org>
What?
Fix a bug in the Page component and add new Storybook stories for better coverage of prop combinations.
Why?
The Page component Header was not rendered when only the
actionsprop was provided, becauseactionswas missing from the render condition atpackages/admin-ui/src/page/index.tsx. Additionally, the existing stories only covered a few combinations of Page props, leaving gaps in visual documentation.How?
actionsto the Header render condition:( title || breadcrumbs || badges || actions )Testing Instructions
npm run storybook:devactionswas provided)Testing Instructions for Keyboard
Use of AI Tools
This PR was authored with assistance from Claude Code (Claude Opus). All changes were reviewed and approved by the contributor.