Repository navigation
Style improvements on PluginHeader - #33085
Merged
Merged
Conversation
Signed-off-by: Charles de Dreuille <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors PluginHeader by inlining the previously-internal PluginHeaderToolbar implementation and reshaping related styling/classname definitions.
Changes:
- Inlined
PluginHeaderToolbarJSX intoPluginHeaderand removed the standalone component/types/definition. - Consolidated toolbar-related
classNamesintoPluginHeaderDefinitionand 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: 32pxandmargin-left: -8px) introduce magic numbers that can drift from the design system. Prefer expressing these via existing design tokens (e.g.,var(--bui-space-*)) orcalc()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;
}
Contributor
Changed Packages
|
Contributor
🎨 Visual Testing with Chromatic
|
Signed-off-by: Charles de Dreuille <[email protected]>
Contributor
|
Thank you for contributing to Backstage! The changes in this pull request will be part of the |
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.
Hey, I just made a Pull Request!
Removes the internal
PluginHeaderToolbarcomponent by merging it directly intoPluginHeader. SincePluginHeaderToolbarwas only ever used as an implementation detail ofPluginHeader, keeping it as a separate component added unnecessary indirection.Changes:
PluginHeaderToolbar.tsxand inlined its JSX intoPluginHeader.tsxPluginHeaderToolbarDefinitionfromdefinition.tsand merged the toolbar classNames (toolbar,toolbarWrapper,toolbarContent,toolbarControls,toolbarIcon,toolbarName) intoPluginHeaderDefinitionPluginHeaderToolbarOwnPropsandPluginHeaderToolbarPropsfromtypes.tsbui-PluginHeader*class namesPluginHeader.module.cssby removing the now-redundantbui-PluginHeaderToolbarpseudo-element and positioning hacksNo changes to the public API of
PluginHeader.✔️ Checklist
Signed-off-byline in the message. (more info)