Skip to content

feat(ui): replace Header tabs with nav-based grouped navigation#33527

Merged
Naycon merged 2 commits intomasterfrom
bui-header-grouped-navigation
Mar 24, 2026
Merged

feat(ui): replace Header tabs with nav-based grouped navigation#33527
Naycon merged 2 commits intomasterfrom
bui-header-grouped-navigation

Conversation

@Naycon
Copy link
Copy Markdown
Collaborator

@Naycon Naycon commented Mar 23, 2026

Hey, I just made a Pull Request!

Replaces the RA Tabs/TabList/Tab rendering in the Header component with a <nav>-based approach. Flat items render as links via useLink, grouped items render as BUI MenuTrigger/Menu/MenuItem dropdowns. Active state is consumer-controlled via a new activeTabId prop.

Breaking change: The tabs prop type changes from HeaderTab[] to HeaderNavTabItem[]. See the changeset for migration details.

New files:

  • HeaderNav.tsx — internal nav component (flat links + group menus)
  • HeaderNavIndicators.tsx — animated active/hover/focus indicator
  • HeaderNavDefinition.tsdefineComponent definitions
  • HeaderNav.module.css — styles

Screenshots

image

✔️ Checklist

  • A changeset describing the change and affected packages.
  • 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.

Copilot AI review requested due to automatic review settings March 23, 2026 11:56
@Naycon Naycon requested a review from a team as a code owner March 23, 2026 11:56
@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:large Large pull requests receive a slightly lower 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 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 23, 2026

🎨 Visual Testing with Chromatic

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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’s Header navigation to use a semantic <nav> with flat links and optional grouped dropdown menus, moving active state control to a new activeTabId prop and introducing new internal nav components/styles to support indicators and grouping.

Changes:

  • Replace Header’s Tabs/TabList/Tab rendering with a new HeaderNav implementation (links + dropdown groups).
  • Introduce new HeaderNavTabItem union types (flat vs group) plus activeTabId to control highlighted state.
  • Update public API exports, docs, and changeset/migration notes for the breaking tabs prop change.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/ui/src/components/Header/types.ts Introduces new nav tab/group types + activeTabId prop; adds isTabGroup guard.
packages/ui/src/components/Header/index.tsx Exports new Header nav definitions/types and isTabGroup.
packages/ui/src/components/Header/definition.ts Adds activeTabId to component definition propDefs.
packages/ui/src/components/Header/HeaderNav.tsx New <nav> renderer for flat and grouped header navigation items.
packages/ui/src/components/Header/HeaderNavIndicators.tsx New indicator positioning logic via CSS custom properties.
packages/ui/src/components/Header/HeaderNavDefinition.ts New defineComponent definitions for nav root/item/group.
packages/ui/src/components/Header/HeaderNav.module.css New styles for nav layout plus active/hover indicators.
packages/ui/src/components/Header/Header.tsx Switches Header from Tabs to the new HeaderNav.
packages/ui/src/components/Header/Header.stories.tsx Updates Storybook stories to drive activeTabId and demonstrate grouped tabs.
packages/ui/report.api.md Updates API report for new exported types/definitions and prop changes.
docs-ui/src/app/components/header/props-definition.tsx Updates docs prop definitions for new tabs type and adds activeTabId.
.changeset/chatty-cups-create.md Adds breaking-change changeset with migration instructions.

Comment thread packages/ui/src/components/Header/HeaderNavIndicators.tsx
Comment thread packages/ui/src/components/Header/HeaderNav.module.css
@Naycon Naycon force-pushed the bui-header-grouped-navigation branch from f72287f to 7897f29 Compare March 23, 2026 14:04
Copilot AI review requested due to automatic review settings March 23, 2026 14:44
@Naycon Naycon force-pushed the bui-header-grouped-navigation branch from 7897f29 to 7859f15 Compare March 23, 2026 14:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 12 out of 12 changed files in this pull request and generated 2 comments.

Comment thread packages/ui/src/components/Header/HeaderNav.tsx
Comment thread packages/ui/src/components/Header/HeaderNavIndicators.tsx Outdated
@Naycon Naycon force-pushed the bui-header-grouped-navigation branch 2 times, most recently from 32f2670 to d010b73 Compare March 23, 2026 16:15
Copilot AI review requested due to automatic review settings March 23, 2026 16:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 15 out of 15 changed files in this pull request and generated 2 comments.

Comment thread packages/ui/src/components/Header/HeaderNav.module.css
Comment thread packages/ui/src/recipes/PluginHeaderAndHeader.stories.tsx
Naycon added 2 commits March 23, 2026 17:23
Replace the RA Tabs/TabList/Tab rendering in the Header component
with a nav-based approach that supports grouped dropdown items via
BUI Menu. Active state is consumer-controlled via a new activeTabId
prop. The indicator system follows the TabsIndicators CSS custom
property pattern for animated active/hover/focus states.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
Signed-off-by: Johan Persson <johanopersson@gmail.com>
@Naycon Naycon force-pushed the bui-header-grouped-navigation branch from d010b73 to a13c5ae Compare March 23, 2026 16:26
@Naycon Naycon enabled auto-merge (rebase) March 24, 2026 07:56
Copy link
Copy Markdown
Collaborator

@cdedreuille cdedreuille left a comment

Choose a reason for hiding this comment

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

Great workaround on this one 🙏

@Naycon Naycon merged commit 3d67aeb into master Mar 24, 2026
27 checks passed
@Naycon Naycon deleted the bui-header-grouped-navigation branch March 24, 2026 08:32
@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.

@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 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:large Large pull requests receive a slightly lower 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