Skip to content

UnderlineNav: Show item icons above xsmall by default - #8260

Draft
liuliu-dev wants to merge 12 commits into
mainfrom
liuliu/underline-nav-icon-breakpoint
Draft

UnderlineNav: Show item icons above xsmall by default#8260
liuliu-dev wants to merge 12 commits into
mainfrom
liuliu/underline-nav-icon-breakpoint

Conversation

@liuliu-dev

Copy link
Copy Markdown
Contributor

Closes github/primer#6929

UnderlineNav previously defaulted hideIconsBreakpoint to xxlarge, hiding item icons in containers narrower than 87.5rem.

This changes the default to xsmall, keeping icons visible in typical layouts while still allowing consumers to configure a larger breakpoint or pass null to always show icons.

Changelog

Changed

  • Changed the default hideIconsBreakpoint from xxlarge to xsmall.
  • Updated the overflow story to explicitly use medium.
  • Updated snapshots.

Rollout strategy

  • Patch release

Testing & Reviewing

@changeset-bot

changeset-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6e9da2f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@liuliu-dev liuliu-dev added the Canary Release Apply this label when you want CI to create a canary release of the current PR label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

@github-actions github-actions Bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Aug 3, 2026
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8260 August 3, 2026 22:21 Inactive
@liuliu-dev
liuliu-dev marked this pull request as ready for review August 3, 2026 23:05
@liuliu-dev
liuliu-dev requested a review from a team as a code owner August 3, 2026 23:05

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 UnderlineNav’s default icon-hiding behavior so item icons remain visible in most layouts by default, while preserving consumer configurability via hideIconsBreakpoint (including null to always show icons).

Changes:

  • Changed hideIconsBreakpoint default from xxlarge to xsmall and updated the prop’s JSDoc accordingly.
  • Added unit coverage for the default behavior, a custom breakpoint, and the null “always show” configuration.
  • Updated the overflow Storybook story to explicitly set hideIconsBreakpoint="medium" and adjusted an e2e interaction to be more deterministic before taking a snapshot.
Show a summary per file
File Description
packages/react/src/UnderlineNav/UnderlineNav.tsx Switches the default hideIconsBreakpoint to xsmall and updates the prop documentation.
packages/react/src/UnderlineNav/UnderlineNav.test.tsx Adds tests validating the new default, a custom breakpoint value, and null behavior.
packages/react/src/UnderlineNav/UnderlineNav.features.stories.tsx Pins the overflow story to hideIconsBreakpoint="medium" to keep the example’s behavior intentional after the default change.
e2e/components/UnderlineNav.test.ts Improves interaction stability by waiting for the menu item to disappear and the overflow button label to update before snapshotting.
.changeset/underline-nav-icon-breakpoint.md Adds a patch changeset describing the consumer-visible default behavior change.

Review details

  • Files reviewed: 5/122 changed files
  • Comments generated: 0
  • Review effort level: Lite

Comment on lines +1 to +5
---
'@primer/react': patch
---

UnderlineNav: Keep item icons visible by default except below the xsmall breakpoint No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

when was the original default added? depending on the timeline this has been around, might be worth considering whether this is a major change👀

patch: we accidentally added the wrong default value in a recent release and are correcting it
major: we're changing the behavior of this component by changing this default

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this default was added recently in #8133 a month ago and first shipped in 38.32.0 three weeks ago. Since this is a recent change, would a patch be reasonable? 👀

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ok yeah SGTM!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

double checking that this diff is correct ? seems some shading around the "more" button is gone

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good catch! I reverted this snapshot change.

@liuliu-dev liuliu-dev added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Aug 4, 2026
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8260 August 4, 2026 17:06 Inactive
@github-actions github-actions Bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Aug 4, 2026
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8260 August 4, 2026 17:15 Inactive
@liuliu-dev liuliu-dev added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Aug 4, 2026
@github-actions github-actions Bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Aug 4, 2026
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8260 August 4, 2026 18:19 Inactive
@primer-integration

primer-integration Bot commented Aug 5, 2026

Copy link
Copy Markdown

Integration test results from github/github-ui PR:

Passed  CI   Passed
Running  VRT   Running
Passed  Projects   Passed

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

Labels

Canary Release Apply this label when you want CI to create a canary release of the current PR integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants