Skip to content
Open
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: 4 additions & 1 deletion packages/core/src/components/breadcrumb/breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ export class Breadcrumb extends Mixin(...DefaultMixins) {

override render() {
const labelLastItem = this.items?.[this.items.length - 1];
const labelLastItemText =
labelLastItem?.label ?? labelLastItem?.textContent?.trim();

this.inheritAriaAttributes['aria-label'] =
this.inheritAriaAttributes['aria-label'] ?? 'Breadcrumbs';
Expand Down Expand Up @@ -203,11 +205,12 @@ export class Breadcrumb extends Mixin(...DefaultMixins) {

{this.shouldRenderNextDropdown && (
<ix-dropdown-button
label={labelLastItem.label ?? labelLastItem.innerText}
label={labelLastItemText}
class="next-button"
variant="tertiary"
enableTopLayer={this.enableTopLayer}
aria-current="page"
aria-label={`Show ${labelLastItemText} next items`}
Comment on lines +208 to +213

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

๐Ÿ“ Maintainability & Code Quality | ๐ŸŸ  Major | โšก Quick win

Add the required changeset before merge.

The new aria-label changes the consumer-visible accessibility contract of ix-breadcrumb. No changeset is included in the provided PR files. Add a changeset scoped to the core package with the accessibility behavior and release impact, or explicitly justify why this change is internal-only.

As per path instructions, changesets are required for accessibility and other consumer-relevant behavior changes.

๐Ÿค– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/core/src/components/breadcrumb/breadcrumb.tsx` around lines 208 -
213, Add a changeset for the core package to document the consumer-visible
accessibility change introduced in breadcrumb.tsx by the new aria-label on the
next button. Update the Breadcrumb component change and include the
accessibility behavior and release impact in the changeset, or if you believe it
is internal-only, explicitly justify that in the same changeset; use the
ix-breadcrumb/Breadcrumb symbols to keep the scope tied to this consumer-facing
API change.

Source: Path instructions

>
<ix-icon
slot="button-label"
Expand Down
36 changes: 36 additions & 0 deletions packages/core/src/components/breadcrumb/test/breadcrumb.ct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
import { Locator } from '@playwright/test';
import { regressionTest, expect } from '@utils/test';

regressionTest('accessibility', async ({ mount, makeAxeBuilder }) => {
await mount(`
<ix-breadcrumb>
<ix-breadcrumb-item label="Item 1" breadcrumb-key="item-1"></ix-breadcrumb-item>
<ix-breadcrumb-item label="Item 2" breadcrumb-key="item-2"></ix-breadcrumb-item>
<ix-breadcrumb-item breadcrumb-key="item-3">Item 3</ix-breadcrumb-item>
Comment thread
lakshmi-priya-b marked this conversation as resolved.
</ix-breadcrumb>`);

const results = await makeAxeBuilder().analyze();
expect(results.violations).toEqual([]);
});

regressionTest('renders', async ({ mount, page }) => {
await mount(`
<ix-breadcrumb>
Expand Down Expand Up @@ -223,3 +235,27 @@ regressionTest.describe('keyboard navigation', () => {
await expect(item2).toHaveVisibleFocus();
});
});

regressionTest(
'should set aria-label on next dropdown button matching last item label',
async ({ mount, page }) => {
await mount(`
<ix-breadcrumb>
<ix-breadcrumb-item label="Item 1" breadcrumb-key="item-1"></ix-breadcrumb-item>
<ix-breadcrumb-item label="Item 2" breadcrumb-key="item-2"></ix-breadcrumb-item>
<ix-breadcrumb-item label="Item 3" breadcrumb-key="item-3"></ix-breadcrumb-item>
</ix-breadcrumb>`);

const breadcrumb = page.locator('ix-breadcrumb');
await breadcrumb.evaluate((bc: HTMLIxBreadcrumbElement) => {
bc.nextItems = [{ label: 'Next Item 1', breadcrumbKey: 'next-item-1' }];
});

const nextButton = breadcrumb.locator('ix-dropdown-button.next-button');
await expect(nextButton).toBeVisible();
await expect(nextButton).toHaveAttribute(
'aria-label',
'Show Item 3 next items'
);
}
);
Loading