Skip to content

Improve PluginHeader and Header styles - #33504

Merged
cdedreuille merged 8 commits into
masterfrom
bui-pluginheader
Mar 23, 2026
Merged

cdedreuille merged 8 commits into
masterfrom
bui-pluginheader

Conversation

@cdedreuille

@cdedreuille cdedreuille commented Mar 21, 2026 •

Copy link
Copy Markdown
Collaborator

Hey, I just made a Pull Request!

This improves the styles of both the PluginHeader and Header. 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.

CleanShot 2026-03-21 at 17 56 32@2x

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

Signed-off-by: Charles de Dreuille <[email protected]>
@backstage-goalie

Copy link
Copy Markdown
Contributor

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/ui packages/ui minor v0.13.0

@backstage-goalie backstage-goalie Bot added size:medium Medium-sized pull requests receive no change in priority for reviews. waiting-for:review The PR needs a review and will be visible in the review queue unless already assigned an owner. labels Mar 21, 2026
@github-actions

github-actions Bot commented Mar 21, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Visual Testing with Chromatic

Signed-off-by: Charles de Dreuille <[email protected]>
@cdedreuille
cdedreuille marked this pull request as ready for review March 21, 2026 18:01
@cdedreuille
cdedreuille requested a review from a team as a code owner March 21, 2026 18:01
Copilot AI review requested due to automatic review settings March 21, 2026 18:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PluginHeader structure to participate in the background context system (BgProvider) and adjusted title/link rendering.
  • Refined PluginHeader CSS (toolbar, icon surface, tabs wrapper) and updated theme overrides.
  • Reorganized Storybook stories, extracting combined PluginHeader+Header examples 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 Naycon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .storybook/themes/spotify.css Resolved
Comment thread .storybook/themes/spotify.css Resolved
Signed-off-by: Charles de Dreuille <[email protected]>
Copilot AI review requested due to automatic review settings March 23, 2026 14:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 is tabs && (...). If a caller passes tabs={[]}, this still renders an empty tabs wrapper (while data-has-tabs is false). Consider using hasTabs (or tabs?.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]>
Copilot AI review requested due to automatic review settings March 23, 2026 15:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

@Naycon Naycon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@backstage-goalie backstage-goalie Bot added waiting-for:merge The PR has been approved and is awaiting merge. and removed waiting-for:review The PR needs a review and will be visible in the review queue unless already assigned an owner. labels Mar 23, 2026
@cdedreuille
cdedreuille merged commit 6bfcd99 into master Mar 23, 2026
28 checks passed
@cdedreuille
cdedreuille deleted the bui-pluginheader branch March 23, 2026 15:48
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.50.0 release, scheduled for Tue, 14 Apr 2026.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:medium Medium-sized pull requests receive no change in priority for reviews. waiting-for:merge The PR has been approved and is awaiting merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants