Skip to content

Style improvements on PluginHeader - #33085

Merged
cdedreuille merged 2 commits into
masterfrom
cdedreuille/merge-plugin-header-toolbar
Mar 3, 2026
Merged

cdedreuille merged 2 commits into
masterfrom
cdedreuille/merge-plugin-header-toolbar

Conversation

@cdedreuille

Copy link
Copy Markdown
Collaborator

Hey, I just made a Pull Request!

Removes the internal PluginHeaderToolbar component by merging it directly into PluginHeader. Since PluginHeaderToolbar was only ever used as an implementation detail of PluginHeader, keeping it as a separate component added unnecessary indirection.

Changes:

  • Deleted PluginHeaderToolbar.tsx and inlined its JSX into PluginHeader.tsx
  • Removed PluginHeaderToolbarDefinition from definition.ts and merged the toolbar classNames (toolbar, toolbarWrapper, toolbarContent, toolbarControls, toolbarIcon, toolbarName) into PluginHeaderDefinition
  • Removed internal types PluginHeaderToolbarOwnProps and PluginHeaderToolbarProps from types.ts
  • Updated Storybook Spotify theme overrides to use the correct bui-PluginHeader* class names
  • Simplified CSS in PluginHeader.module.css by removing the now-redundant bui-PluginHeaderToolbar pseudo-element and positioning hacks

No changes to the public API of PluginHeader.

✔️ 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]>
Copilot AI review requested due to automatic review settings March 2, 2026 19:08
@cdedreuille
cdedreuille requested review from a team as code owners March 2, 2026 19:08

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

Refactors PluginHeader by inlining the previously-internal PluginHeaderToolbar implementation and reshaping related styling/classname definitions.

Changes:

  • Inlined PluginHeaderToolbar JSX into PluginHeader and removed the standalone component/types/definition.
  • Consolidated toolbar-related classNames into PluginHeaderDefinition and updated Storybook Spotify theme overrides.
  • Simplified CSS by removing toolbar pseudo-element and positioning rules.

Reviewed changes

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

Show a summary per file
File Description
packages/ui/src/components/PluginHeader/types.ts Removes internal toolbar prop types after inlining.
packages/ui/src/components/PluginHeader/definition.ts Moves toolbar classNames into PluginHeaderDefinition and removes toolbar definition export.
packages/ui/src/components/PluginHeader/PluginHeaderToolbar.tsx Deletes internal toolbar component after inlining.
packages/ui/src/components/PluginHeader/PluginHeader.tsx Inlines toolbar markup and updates tabs wrapper classname accessor.
packages/ui/src/components/PluginHeader/PluginHeader.module.css Removes redundant/pseudo-element toolbar styling and absolute positioning.
packages/ui/report.api.md Updates API report to reflect new classNames shape.
.storybook/themes/spotify.css Updates selectors to bui-PluginHeader* overrides and adjusts spacing.
.changeset/odd-laws-attack.md Adds changeset documenting the internal refactor.
Comments suppressed due to low confidence (1)

.storybook/themes/spotify.css:197

  • The new hard-coded values (height: 32px and margin-left: -8px) introduce magic numbers that can drift from the design system. Prefer expressing these via existing design tokens (e.g., var(--bui-space-*)) or calc() with tokens (e.g., margin-left: calc(-1 * var(--bui-space-2))) so theme/layout tweaks stay consistent.
  .bui-PluginHeaderToolbarWrapper {
    padding: 0;
    border: none;
    height: 32px;
  }

  .bui-PluginHeaderTabsWrapper {
    margin: 0;
    padding: 0;
    margin-left: -8px;
    border: none;
  }

@backstage-goalie

Copy link
Copy Markdown
Contributor

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/ui packages/ui patch v0.12.1-next.0

@github-actions

github-actions Bot commented Mar 2, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Visual Testing with Chromatic

@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 2, 2026
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.

LGTM!

@cdedreuille
cdedreuille merged commit e8c8e0f into master Mar 3, 2026
25 checks passed
@cdedreuille
cdedreuille deleted the cdedreuille/merge-plugin-header-toolbar branch March 3, 2026 14:01
@github-actions

github-actions Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.49.0 release, scheduled for Tue, 17 Mar 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:review The PR needs a review and will be visible in the review queue unless already assigned an owner.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants