Repository navigation
Improve PluginHeader and Header styles - #33504
Conversation
Signed-off-by: Charles de Dreuille <[email protected]>
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
🎨 Visual Testing with Chromatic
|
Signed-off-by: Charles de Dreuille <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR updates @backstage/ui header components’ styling and Storybook organization, focusing on improving PluginHeader/Header visuals (backgrounds, icon surface, actions-on-bg behavior) and moving combined usage examples into a dedicated recipe story.
Changes:
- Updated
PluginHeaderstructure to participate in the background context system (BgProvider) and adjusted title/link rendering. - Refined
PluginHeaderCSS (toolbar, icon surface, tabs wrapper) and updated theme overrides. - Reorganized Storybook stories, extracting combined
PluginHeader+Headerexamples into a new recipe file and simplifying component stories.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ui/src/recipes/PluginHeaderAndHeader.stories.tsx | Adds a dedicated “recipe” story showcasing combined PluginHeader + Header layouts. |
| packages/ui/src/components/PluginHeader/definition.ts | Removes toolbarWrapper from exported classNames. |
| packages/ui/src/components/PluginHeader/PluginHeader.tsx | Refactors markup (icon/title/actions/tabs) and adds bg-context provisioning for descendants. |
| packages/ui/src/components/PluginHeader/PluginHeader.stories.tsx | Removes combined layout stories and tweaks action button variants/spacing. |
| packages/ui/src/components/PluginHeader/PluginHeader.module.css | Moves toolbar layout styling to .bui-PluginHeaderToolbar, adds background styling, updates icon surface styling. |
| packages/ui/src/components/Header/Header.stories.tsx | Removes the old layout decorator-based story variant. |
| packages/ui/report.api.md | Updates API report to reflect removed toolbarWrapper className export. |
| .storybook/themes/spotify.css | Updates Spotify theme overrides to match new PluginHeader class structure. |
| .changeset/plugin-header-remove-toolbar-wrapper.md | Adds a changeset documenting the breaking change and behavior updates. |
Signed-off-by: Charles de Dreuille <[email protected]>
Naycon
left a comment
There was a problem hiding this comment.
Great improvment! Just some questions on if we can lean into the bg system and avoid having to manually manage it as much as we do now. Take a look and let me know what you think.
Signed-off-by: Charles de Dreuille <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
packages/ui/src/components/PluginHeader/PluginHeader.tsx:164
- The component computes
hasTabs = tabs && tabs.length > 0, but the render condition istabs && (...). If a caller passestabs={[]}, this still renders an empty tabs wrapper (whiledata-has-tabsis false). Consider usinghasTabs(ortabs?.length) for the conditional render too.
{tabs && (
<Box className={classes.tabs}>
<Tabs onSelectionChange={onTabSelectionChange}>
<TabList>
{tabs?.map(tab => (
<Tab
key={tab.id}
id={tab.id}
href={tab.href}
matchStrategy={tab.matchStrategy}
>
{tab.label}
</Tab>
))}
</TabList>
</Tabs>
</Box>
)}
Signed-off-by: Charles de Dreuille <[email protected]>
Signed-off-by: Charles de Dreuille <[email protected]>
Signed-off-by: Charles de Dreuille <[email protected]>
|
Thank you for contributing to Backstage! The changes in this pull request will be part of the |
Hey, I just made a Pull Request!
This improves the styles of both the
PluginHeaderandHeader. The icon is now wrapped into a squared surface and both component backgrounds are working as expected. This also improved the title link to look as expected.Another big improvement is the stories. This moves stories that used both components into a separate recipe file.
Actions inside the PluginHeader are now reacting to their background.
✔️ Checklist
Signed-off-byline in the message. (more info)