Skip to content

fix(core/breadcrumb): add missing aria-label to next items dropdown button of breadcrumb - #2683

Open
lakshmi-priya-b wants to merge 3 commits into
mainfrom
fix/breadcrumb-next-items-aria-label
Open

fix(core/breadcrumb): add missing aria-label to next items dropdown button of breadcrumb #2683
lakshmi-priya-b wants to merge 3 commits into
mainfrom
fix/breadcrumb-next-items-aria-label

Conversation

@lakshmi-priya-b

@lakshmi-priya-b lakshmi-priya-b commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

💡 What is the current behavior?

The next items dropdown button had no aria-label, making it unannounced and non-navigable for screen reader users.

JIRA: IX-4347

🆕 What is the new behavior?

The next items dropdown button had now aria-label, making it announced and navigable for screen reader users.

🏁 Checklist

A pull request can only be merged if all of these conditions are met (where applicable):

  • 🦮 Accessibility (a11y) features were implemented
  • 🗺️ Internationalization (i18n) - no hard coded strings
  • 📲 Responsiveness - components handle viewport changes and content overflow gracefully
  • 📕 Add or update a Storybook story
  • 📄 Documentation was reviewed/updated siemens/ix-docs
  • 🧪 Unit tests were added/updated and pass (pnpm test)
  • 📸 Visual regression tests were added/updated and pass (Guide)
  • 🧐 Static code analysis passes (pnpm lint)
  • 🏗️ Successful compilation (pnpm build, changes pushed)

👨‍💻 Help & support

Summary by CodeRabbit

  • Accessibility
    • Improved breadcrumb navigation with a descriptive label for the next-items dropdown button.
    • Ensured the label reflects the displayed breadcrumb content.
    • Added accessibility coverage to help prevent future breadcrumb usability regressions.

@netlify

netlify Bot commented Jul 30, 2026

Copy link
Copy Markdown

Deploy Preview for ix-storybook ready!

Name Link
🔨 Latest commit 5f8beb4
🔍 Latest deploy log https://app.netlify.com/projects/ix-storybook/deploys/6a7363dd80751e00089b115e
😎 Deploy Preview https://deploy-preview-2683--ix-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot

changeset-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5f8beb4

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

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The breadcrumb next-items dropdown derives the last breadcrumb label from its label property or trimmed text content. It sets an aria-label. Tests verify the label and axe compliance.

Changes

Breadcrumb accessibility

Layer / File(s) Summary
Dropdown label and regression coverage
packages/core/src/components/breadcrumb/breadcrumb.tsx, packages/core/src/components/breadcrumb/test/breadcrumb.ct.ts
The next-items dropdown derives the last breadcrumb label and sets an aria-label. Tests verify axe compliance and confirm the label is Show Item 3 next items.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main accessibility fix to the breadcrumb next-items dropdown button.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/breadcrumb-next-items-aria-label

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lakshmi-priya-b
lakshmi-priya-b marked this pull request as ready for review August 4, 2026 04:25

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with 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.

Inline comments:
In `@packages/core/src/components/breadcrumb/breadcrumb.tsx`:
- Line 211: Add a changeset for the consumer-visible accessibility update in the
core package, describing the breadcrumb aria-label behavior change and assigning
the appropriate release impact. If this requires a major release, include
migration guidance; otherwise, keep the changeset scoped to the relevant
package.
- Line 211: Update the last-item breadcrumb rendering to use the same trimmed
text fallback as BreadcrumbItem.render(), preferring label and then
hostElement.textContent?.trim() rather than innerText. Compute this fallback
once and reuse it for both the label at the surrounding render logic and the
aria-label, and add a regression case covering slotted text when the item is
invisible.

In `@packages/core/src/components/breadcrumb/test/breadcrumb.ct.ts`:
- Around line 20-30: Update the accessibility regression test around the
breadcrumb mount and axe analysis to provide nextItems so
ix-dropdown-button.next-button renders, then use a Playwright locator to assert
its inner button has the accessible name “Show Item 3” via getByRole before or
alongside the axe assertion. Keep the existing zero-violations check and ensure
the test covers the changed button behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cd3f2d81-9a18-403e-ae38-773308b2c51e

📥 Commits

Reviewing files that changed from the base of the PR and between 60d38b5 and 358adb1.

📒 Files selected for processing (2)
  • packages/core/src/components/breadcrumb/breadcrumb.tsx
  • packages/core/src/components/breadcrumb/test/breadcrumb.ct.ts

variant="tertiary"
enableTopLayer={this.enableTopLayer}
aria-current="page"
aria-label={`Show ${labelLastItem.label ?? labelLastItem.innerText}`}

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.

This change modifies consumer-visible accessibility behavior in packages/core. Add a changeset with the relevant package scope, or explicitly justify why the change is internal-only. Include migration guidance if this is a major release change.

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` at line 211, Add a
changeset for the consumer-visible accessibility update in the core package,
describing the breadcrumb aria-label behavior change and assigning the
appropriate release impact. If this requires a major release, include migration
guidance; otherwise, keep the changeset scoped to the relevant package.

Source: Path instructions


🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Reuse BreadcrumbItem's text fallback.

BreadcrumbItem.render() in packages/core/src/components/breadcrumb-item/breadcrumb-item.tsx uses label ?? hostElement.textContent?.trim(). This code uses innerText instead. When the last item uses slotted text and becomes invisible, innerText can omit that text. The dropdown can then expose aria-label="Show " or a different name.

Compute one trimmed fallback and reuse it for the label at Line 206 and this aria-label. Add a regression case with slotted text.

🤖 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` at line 211, Update
the last-item breadcrumb rendering to use the same trimmed text fallback as
BreadcrumbItem.render(), preferring label and then
hostElement.textContent?.trim() rather than innerText. Compute this fallback
once and reuse it for both the label at the surrounding render logic and the
aria-label, and add a regression case covering slotted text when the item is
invisible.

Comment thread packages/core/src/components/breadcrumb/test/breadcrumb.ct.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with 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.

Inline comments:
In `@packages/core/src/components/breadcrumb/breadcrumb.tsx`:
- Around line 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.

In `@packages/core/src/components/breadcrumb/test/breadcrumb.ct.ts`:
- Around line 20-39: Add a breadcrumb item without a label and provide its
visible text through slotted content in the accessibility fixture, so the
textContent fallback in the breadcrumb component executes. Keep the existing
Playwright locator assertion and verify the next button still has the accessible
name “Show Item 3 next items”.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6639d1ae-8d64-4c6a-9086-af37cc38f37b

📥 Commits

Reviewing files that changed from the base of the PR and between 358adb1 and b1ada79.

📒 Files selected for processing (2)
  • packages/core/src/components/breadcrumb/breadcrumb.tsx
  • packages/core/src/components/breadcrumb/test/breadcrumb.ct.ts

Comment on lines +208 to +213
label={labelLastItemText}
class="next-button"
variant="tertiary"
enableTopLayer={this.enableTopLayer}
aria-current="page"
aria-label={`Show ${labelLastItemText} next items`}

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

Comment thread packages/core/src/components/breadcrumb/test/breadcrumb.ct.ts Outdated
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with 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.

Inline comments:
In `@packages/core/src/components/breadcrumb/test/breadcrumb.ct.ts`:
- Around line 20-25: Update the accessibility fixture in
regressionTest('accessibility') to include a nextItems entry while preserving
the unlabeled slotted Item 3 text fallback, then assert the rendered inner
button using the Playwright locator getByRole('button', { name: 'Show Item 3
next items' }).
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6b8b3f1b-b92c-4b55-816b-0735aeb22e8a

📥 Commits

Reviewing files that changed from the base of the PR and between b1ada79 and 5f8beb4.

📒 Files selected for processing (1)
  • packages/core/src/components/breadcrumb/test/breadcrumb.ct.ts

Comment thread packages/core/src/components/breadcrumb/test/breadcrumb.ct.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant