Allow configuring tail character count for Breadcrumbs#245
Allow configuring tail character count for Breadcrumbs#245yelyzavetakhokhlova merged 1 commit intodevelopfrom
Breadcrumbs#245Conversation
WalkthroughThis PR adds a new optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/breadcrumbs/breadcrumbs.tsx (1)
83-84:⚠️ Potential issue | 🟠 Major
HiddenBreadcrumbsdoes not receivetitleTailNumChars, so the prop is silently ignored for hidden items.The
Breadcrumbcomponent has a defaulttitleTailNumChars = 8(line 17 of breadcrumb.tsx). All three direct<Breadcrumb>call sites in breadcrumbs.tsx passcustomTitleTailNumChars ?? titleTailNumChars, but<HiddenBreadcrumbs>on line 83 does not. SinceHiddenBreadcrumbsinternally rendersBreadcrumbcomponents (line 18 of hiddenBreadcrumbs.tsx) without forwarding the prop, hidden items will always use the default truncation width of 8, producing inconsistent behaviour.🐛 Proposed fix
- <HiddenBreadcrumbs descriptors={hiddenDescriptors} /> + <HiddenBreadcrumbs + descriptors={hiddenDescriptors} + titleTailNumChars={customTitleTailNumChars ?? titleTailNumChars} + />Update
HiddenBreadcrumbsPropsto accepttitleTailNumChars?: numberand pass it to theBreadcrumbcomponents rendered inHiddenBreadcrumbsContent.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/breadcrumbs/breadcrumbs.tsx` around lines 83 - 84, The HiddenBreadcrumbs component is not receiving or forwarding titleTailNumChars, causing hidden items to use Breadcrumb's default of 8; update HiddenBreadcrumbsProps to include titleTailNumChars?: number, accept that prop in HiddenBreadcrumbs (breadcrumbs.tsx) and pass it down into HiddenBreadcrumbsContent and ultimately into the Breadcrumb instances inside HiddenBreadcrumbsContent (ensure the Breadcrumb calls use the passed titleTailNumChars instead of relying on the default), matching how other Breadcrumb call sites pass customTitleTailNumChars ?? titleTailNumChars.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/components/breadcrumbs/breadcrumbs.tsx`:
- Around line 83-84: The HiddenBreadcrumbs component is not receiving or
forwarding titleTailNumChars, causing hidden items to use Breadcrumb's default
of 8; update HiddenBreadcrumbsProps to include titleTailNumChars?: number,
accept that prop in HiddenBreadcrumbs (breadcrumbs.tsx) and pass it down into
HiddenBreadcrumbsContent and ultimately into the Breadcrumb instances inside
HiddenBreadcrumbsContent (ensure the Breadcrumb calls use the passed
titleTailNumChars instead of relying on the default), matching how other
Breadcrumb call sites pass customTitleTailNumChars ?? titleTailNumChars.
Screen.Recording.2026-02-25.at.14.21.40.mov
Summary by CodeRabbit
titleTailNumCharsprop to breadcrumbs, allowing customization of title tail length per instance with automatic fallback to default behavior when not specified.