Skip to content

feat: add maxLabelLength truncation to Header breadcrumb for long labels - #976

Open
waterWang wants to merge 1 commit into
CalloraOrg:mainfrom
waterWang:feat/breadcrumb-middle-ellipsis-947
Open

feat: add maxLabelLength truncation to Header breadcrumb for long labels#976
waterWang wants to merge 1 commit into
CalloraOrg:mainfrom
waterWang:feat/breadcrumb-middle-ellipsis-947

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Adds maxLabelLength={28} to the Breadcrumb in the Header component so that long first and last breadcrumb labels are truncated with a middle-ellipsis when they exceed 28 characters.

Changes

  • src/pages/Header.tsx: Pass maxLabelLength={28} to the Breadcrumb component
  • src/pages/Header.test.tsx: Add 3 tests verifying:
    • First crumb label is truncated when it exceeds maxLabelLength
    • Current-page crumb label is truncated when it exceeds maxLabelLength
    • Short labels remain unchanged

Accessibility

The full label text is preserved in the title attribute and aria-label override on truncated elements, so screen-reader and hover users always see the complete value.

Closes #947

Adds maxLabelLength={28} to the Breadcrumb in Header so that the
first and last visible breadcrumb labels are truncated with a
middle-ellipsis when they exceed 28 characters. The full label is
preserved in title and aria-label for accessibility.

- Add maxLabelLength={28} to Breadcrumb in Header.tsx
- Add 3 tests for maxLabelLength truncation in Header.test.tsx

Closes CalloraOrg#947
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.

Polish Header breadcrumb overflow with middle-ellipsis [b#093]

1 participant