Skip to content

refactor breadcrumb to support duplicate labels#2479

Open
SaiYugandhar03 wants to merge 4 commits intosiemens:mainfrom
SaiYugandhar03:Refactor-breadcrumbs-to-support-duplicate-labels
Open

refactor breadcrumb to support duplicate labels#2479
SaiYugandhar03 wants to merge 4 commits intosiemens:mainfrom
SaiYugandhar03:Refactor-breadcrumbs-to-support-duplicate-labels

Conversation

@SaiYugandhar03
Copy link
Copy Markdown
Contributor

💡 What is the current behavior?

The ix-breadcrumb component cannot support duplicate item labels because it uses labels as unique identifiers.

Jira ticket: IX-4136

🆕 What is the new behavior?

The breadcrumb component works when multiple breadcrumb items have the same label.

🏁 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

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 3, 2026

🦋 Changeset detected

Latest commit: 59e9f8e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@siemens/ix-angular Major
@siemens/ix Major
@siemens/ix-react Major
@siemens/ix-vue Major
@siemens/ix-docs Major
@siemens/ix-aggrid 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

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the breadcrumb component to include an index in the itemClick event payload, enabling unique identification of items even when labels are duplicated. The changes span the core component, its tests, and the Angular, React, and Vue wrappers. Feedback includes a missing @element() decorator for hostElement in the breadcrumb item and a suggestion to use the map index for better efficiency when rendering dropdown items.

Comment thread packages/core/src/components/breadcrumb-item/breadcrumb-item.tsx
Comment thread packages/core/src/components/breadcrumb/breadcrumb.tsx Outdated
@lakshmi-priya-b
Copy link
Copy Markdown
Collaborator

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the breadcrumb component to support identifying items by index, which is particularly useful when duplicate labels exist. The itemClick event payload has been changed from a string to an object containing both the label and the index. This change is reflected across Angular, React, and Vue wrappers. Feedback highlights that this is a breaking change for consumers and suggests using textContent instead of innerText to ensure labels are correctly retrieved even when elements are hidden or styled.

* Crumb item clicked event
*/
@Event() itemClick!: EventEmitter<string>;
@Event() itemClick!: EventEmitter<{ label: string; index: number }>;
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.

high

Changing the itemClick event payload from a string to an object { label: string; index: number } is a breaking change for existing consumers of this component. While this is necessary to support duplicate labels, it will require updates in all applications using this event. Please ensure this is documented as a breaking change and consider if a migration path or a new event name (e.g., itemSelect) should be used to maintain backward compatibility.

Comment thread packages/core/src/components/breadcrumb/breadcrumb.tsx
Comment thread packages/core/src/components/breadcrumb-item/breadcrumb-item.tsx
@SaiYugandhar03 SaiYugandhar03 marked this pull request as ready for review April 7, 2026 08:49
@nuke-ellington nuke-ellington added this to the 5.0.0 milestone Apr 15, 2026
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Collaborator

@danielleroux danielleroux left a comment

Choose a reason for hiding this comment

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

Breaking changes documentation in the BREAKING CHANGES v5.md is missing. Please add.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Add a breaking changes section. Look into the other major changesets

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.

4 participants