Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/free-wasps-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Breadcrumbs overflow menu no longer appears when there are only two crumb items.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions e2e/components/Breadcrumbs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,32 @@ test.describe('Breadcrumbs', () => {
await expect(page).toHaveScreenshot('Breadcrumbs.OverflowMenuWithRoot.narrow.png')
})
})

test.describe('Two Items With Overflow Menu', () => {
test('narrow viewport @vrt', async ({page}) => {
await visit(page, {
id: 'components-breadcrumbs-features--two-items-with-overflow-menu',
globals: {
colorScheme: 'light',
},
})

await page.setViewportSize({width: viewports['primer.breakpoint.xs'] - 1, height: 768})
await expect(page).toHaveScreenshot('Breadcrumbs.TwoItemsOverflowMenu.narrow.png')
})
})

test.describe('Two Items With Overflow Menu With Root', () => {
test('narrow viewport @vrt', async ({page}) => {
await visit(page, {
id: 'components-breadcrumbs-features--two-items-with-overflow-menu-with-root',
globals: {
colorScheme: 'light',
},
})

await page.setViewportSize({width: viewports['primer.breakpoint.xs'] - 1, height: 768})
await expect(page).toHaveScreenshot('Breadcrumbs.TwoItemsOverflowMenuWithRoot.narrow.png')
})
Comment on lines +82 to +107
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

Test/screenshot naming here suggests an overflow menu should be present ("Two Items With Overflow Menu" / "TwoItemsOverflowMenu"), but the intended behavior is that no overflow menu renders for two items. Renaming the describe block and screenshot baselines to match the expected UI would make the VRT coverage easier to understand and maintain.

Copilot uses AI. Check for mistakes.
})
})
18 changes: 18 additions & 0 deletions packages/react/src/Breadcrumbs/Breadcrumbs.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,21 @@ export const SpaciousVariantWithOverflowWrap = () => (
</Breadcrumbs.Item>
</Breadcrumbs>
)

export const TwoItemsWithOverflowMenu = () => (
<Breadcrumbs overflow="menu">
<Breadcrumbs.Item href="#">Home</Breadcrumbs.Item>
<Breadcrumbs.Item href="#" selected>
Current Page
</Breadcrumbs.Item>
</Breadcrumbs>
)

export const TwoItemsWithOverflowMenuWithRoot = () => (
<Breadcrumbs overflow="menu-with-root">
<Breadcrumbs.Item href="#">Home</Breadcrumbs.Item>
<Breadcrumbs.Item href="#" selected>
Current Page
</Breadcrumbs.Item>
</Breadcrumbs>
)
Comment on lines +80 to +96
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

The new Storybook exports are named as if an overflow menu is expected to render, but the PR’s stated behavior is that the overflow menu should not appear when there are only two items. Consider renaming these stories to reflect the intent (e.g., that overflow="menu"/"menu-with-root" does not render a menu with two items) to avoid confusing future readers and consumers of the story IDs.

Copilot uses AI. Check for mistakes.
2 changes: 1 addition & 1 deletion packages/react/src/Breadcrumbs/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function Breadcrumbs({className, children, style, overflow = 'wrap', variant = '
let MIN_VISIBLE_ITEMS = 4
if (!eHideRoot) {
MIN_VISIBLE_ITEMS = 3
} else if (isNarrow) {
} else if (isNarrow && childArray.length > 2) {
MIN_VISIBLE_ITEMS = 1
}

Expand Down
Loading