Skip to content

Fix UnderlineNav tab list width in Safari#8164

Merged
jonrohan merged 1 commit into
mainfrom
jonrohan/underline-tab-list-flex-grow
Jul 14, 2026
Merged

Fix UnderlineNav tab list width in Safari#8164
jonrohan merged 1 commit into
mainfrom
jonrohan/underline-tab-list-flex-grow

Conversation

@jonrohan

@jonrohan jonrohan commented Jul 14, 2026

Copy link
Copy Markdown
Member
image

In Safari the UnderlineNav tab list wasn't stretching to fill the underline nav. The list is a flex child of the wrapper but didn't grow, so it collapsed to its content width. Adding flex-grow: 1 to .UnderlineItemList makes it fill the wrapper.

I scoped it to the data-overflow-mode='wrap' variant so it only applies to UnderlineNav. The base rule is shared with UnderlinePanels, which measures the list's natural width (via ResizeObserver contentRect.width) to decide whether tab icons fit. Growing that measured element would throw off the icons-visible calc, so keeping flex-grow off the base rule leaves UnderlinePanels untouched.

Changelog

New

Changed

  • UnderlineNav's tab list now uses flex-grow: 1 (scoped to the wrap variant) so it fills the underline nav width in Safari

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Scoped to UnderlineNav (always data-overflow-mode='wrap'), so UnderlinePanels is deliberately unaffected. I confirmed UnderlinePanels is the only consumer with the icon-visibility measurement, and per primer-query the only product surface using icon tabs is github/github-ui's Org Security Campaigns page, which this no longer touches. Worth a quick VRT pass on UnderlineNav to confirm no snapshot shifts.

@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 928816d

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

@github-actions github-actions Bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jul 14, 2026
@github-actions

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. If this doesn't work, you can also use the original workflow here. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

To publish a canary release for integration testing, apply the Canary Release label to this PR.

@jonrohan
jonrohan marked this pull request as ready for review July 14, 2026 18:04
@jonrohan
jonrohan requested a review from a team as a code owner July 14, 2026 18:04
@jonrohan
jonrohan requested review from Copilot and liuliu-dev July 14, 2026 18:04

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 adjusts the shared internal styling for UnderlineNav/UnderlinePanels to ensure the tab list stretches to the full available width in Safari, and adds a patch changeset to release the fix.

Changes:

  • Add flex-grow: 1 to the base .UnderlineItemList rule so the list can expand to fill its flex container.
  • Remove reliance on the wrap-only variant for list growth by making growth part of the base list styling.
  • Add a patch changeset describing the Safari width fix for both UnderlineNav and UnderlinePanels.
Show a summary per file
File Description
packages/react/src/internal/components/UnderlineTabbedInterface.module.css Makes the shared underline tab list a growing flex item so it can fill the wrapper width (Safari fix).
.changeset/underline-item-list-flex-grow.md Patch changeset documenting the Safari width fix for the shared underline tab list.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Low

@jonrohan
jonrohan force-pushed the jonrohan/underline-tab-list-flex-grow branch from a96461e to de8a96e Compare July 14, 2026 18:10
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8164 July 14, 2026 18:14 Inactive
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8164 July 14, 2026 18:22 Inactive
@jonrohan jonrohan added the integration-tests: skipped manually Changes in this PR do not require an integration test label Jul 14, 2026
@jonrohan
jonrohan added this pull request to the merge queue Jul 14, 2026
@jonrohan
jonrohan removed this pull request from the merge queue due to a manual request Jul 14, 2026
@primer-integration

Copy link
Copy Markdown

⚠️ Integration PR Outdated

This integration PR does not have the latest commit from the primer/react PR.

Integration PR references: a96461e17c43ed5b23f22c4c3240f114d280bd51
Latest commit on primer/react PR: de8a96e87bd04766f063d03c87dcba40444d80fb

Please update the integration PR to reference the latest commit from the primer/react PR before reviewing workflow results.

In Safari the UnderlineNav tab list wasn't stretching to fill the
underline nav. Add flex-grow: 1 to the list, scoped to the wrap variant
so it only applies to UnderlineNav. Keeping it off the shared base rule
leaves UnderlinePanels' icon-visibility measurement untouched.
@jonrohan
jonrohan force-pushed the jonrohan/underline-tab-list-flex-grow branch from de8a96e to 928816d Compare July 14, 2026 18:34
@jonrohan jonrohan changed the title Fix UnderlineNav/UnderlinePanels tab list width in Safari Fix UnderlineNav tab list width in Safari Jul 14, 2026
@jonrohan
jonrohan enabled auto-merge July 14, 2026 18:36
@github-actions

Copy link
Copy Markdown
Contributor

Uh oh! @jonrohan, at least one image you shared is missing helpful alt text. Check your pull request body to fix the following violations:

  • Images should have meaningful alternative text (alt text) at line 1

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.

@jonrohan
jonrohan disabled auto-merge July 14, 2026 18:37
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8164 July 14, 2026 18:46 Inactive
@jonrohan jonrohan added the Canary Release Apply this label when you want CI to create a canary release of the current PR label Jul 14, 2026
@jonrohan
jonrohan added this pull request to the merge queue Jul 14, 2026
Merged via the queue into main with commit f86e5a6 Jul 14, 2026
63 checks passed
@jonrohan
jonrohan deleted the jonrohan/underline-tab-list-flex-grow branch July 14, 2026 19:23
@primer primer Bot mentioned this pull request Jul 14, 2026
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 integration-tests: skipped manually Changes in this PR do not require an integration test staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants