Skip to content

Revert "perf(Breadcrumbs): rebuild overflow menu for fewer renders, c… - #8747

Open
francinelucca wants to merge 1 commit into
mainfrom
revert-8683-mattcosta7-breadcrumbs-perf-rewrite
Open

francinelucca wants to merge 1 commit into
mainfrom
revert-8683-mattcosta7-breadcrumbs-perf-rewrite

Conversation

@francinelucca

Copy link
Copy Markdown
Member

…heaper l…"

This reverts commit 32d5061. Found regressions when testing in dotcom so removing.

Closes #

Changelog

New

Changed

Removed

Rollout strategy

  • No changes needed in github/github-ui
  • Needs changes in github/github-ui
  • Ships with feature flag(s)
  • Not sure
  • None

Testing & Reviewing

@francinelucca
francinelucca requested a review from a team as a code owner November 13, 2026 15:13
@francinelucca
francinelucca requested review from siddharthkp and a balanced review from Copilot November 13, 2026 15:13
@changeset-bot

changeset-bot Bot commented Nov 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f1713a2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions github-actions Bot added the staff Author is a staff member label Nov 13, 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. 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 Nov 13, 2026

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.

🟡 Changes recommended

The collapse loop can remove the only breadcrumb and run indefinitely, freezing rendering, while stale measurements and empty overflow menus introduce additional defects.

3 open issues
What changed in this PR

Reverts the Breadcrumbs overflow performance rewrite after regressions were found in GitHub testing, restoring the previous implementation in @primer/react.

Changes:

  • Restores the <details>-based overflow menu and measurement-driven collapse logic.
  • Removes pre-hydration layout rules and associated real-layout and server-rendering tests.
  • Reverts the related Vitest dependency override and removes the performance changeset.
File Description
packages/​react/​vitest.config.mts Removes the Octicons dependency-inlining override.
packages/​react/​src/​Breadcrumbs/​Breadcrumbs.tsx Restores the previous overflow menu and width calculations.
packages/​react/​src/​Breadcrumbs/​Breadcrumbs.module.css Removes collapsed-item measurement and pre-hydration styles.
packages/​react/​src/​Breadcrumbs/​__tests__/​BreadcrumbsOverflow.test.tsx Deletes the added real-layout, performance, and hydration tests.
packages/​react/​src/​Breadcrumbs/​__tests__/​Breadcrumbs.test.tsx Updates menu selectors to target <details> elements.
packages/​react/​src/​__tests__/​ssr.test.tsx Removes Breadcrumbs server-rendering assertions.
.changeset/​breadcrumbs-overflow-performance.md Removes the release note for the reverted optimization.

Review effort: Balanced

Comment on lines +203 to +204
(overflow === 'menu' || overflow === 'menu-with-root') &&
(visibleItemsWidthTotal > availableWidth || currentVisibleItemWidths.length > MIN_VISIBLE_ITEMS)
Comment on lines +264 to +266
if (listElement && listElement.children.length > 0 && listElement.children.length === childArray.length) {
const widths = Array.from(listElement.children).map(child => (child as HTMLElement).offsetWidth)
setChildArrayWidths(widths)
const visibleItems = childArray.slice(menuItemCount)

// In 'menu-with-root' mode the root stays visible, so drop it from the menu.
const effectiveMenuItems = effectiveHideRoot ? menuItems : menuItems.slice(1)

This branch was successfully deployed

2 active deployments
storybook-preview-8747 — f1713a29 Deployed Nov 13, 2026 by github-actions[bot]
github-pages — f1713a29 Deployed Nov 13, 2026 by francinelucca via deploy-preview #34271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants