Skip to content

Allow configuring tail character count for Breadcrumbs#245

Merged
yelyzavetakhokhlova merged 1 commit intodevelopfrom
feature/breadcrumbs-max-descriptors
Feb 25, 2026
Merged

Allow configuring tail character count for Breadcrumbs#245
yelyzavetakhokhlova merged 1 commit intodevelopfrom
feature/breadcrumbs-max-descriptors

Conversation

@yelyzavetakhokhlova
Copy link
Contributor

@yelyzavetakhokhlova yelyzavetakhokhlova commented Feb 25, 2026

Screen.Recording.2026-02-25.at.14.21.40.mov

Summary by CodeRabbit

  • New Features
    • Added optional titleTailNumChars prop to breadcrumbs, allowing customization of title tail length per instance with automatic fallback to default behavior when not specified.

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

Walkthrough

This PR adds a new optional titleTailNumChars prop to the Breadcrumbs component, enabling per-instance customization of how many characters are displayed in breadcrumb titles. The implementation uses a nullish coalescing fallback to the existing computed value when no override is provided.

Changes

Cohort / File(s) Summary
Breadcrumbs customization
src/components/breadcrumbs/types.ts, src/components/breadcrumbs/breadcrumbs.tsx
Added optional titleTailNumChars prop to BreadcrumbsProps interface; updated rendering logic to use customTitleTailNumChars ?? titleTailNumChars with fallback to computed function for per-instance title length override.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • AmsterGet
  • maria-hambardzumian
  • allaprischepa
  • siarheirazuvalau
  • ViktorSoroka07

Poem

🐰 Whiskers wiggle with delight,
Breadcrumbs trimmed with custom might,
Override the tail with ease,
Character counts set to please! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding configuration capability for the tail character count in the Breadcrumbs component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/breadcrumbs-max-descriptors

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

HiddenBreadcrumbs does not receive titleTailNumChars, so the prop is silently ignored for hidden items.

The Breadcrumb component has a default titleTailNumChars = 8 (line 17 of breadcrumb.tsx). All three direct <Breadcrumb> call sites in breadcrumbs.tsx pass customTitleTailNumChars ?? titleTailNumChars, but <HiddenBreadcrumbs> on line 83 does not. Since HiddenBreadcrumbs internally renders Breadcrumb components (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 HiddenBreadcrumbsProps to accept titleTailNumChars?: number and pass it to the Breadcrumb components rendered in HiddenBreadcrumbsContent.

🤖 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.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9a6534a and 3a1a959.

📒 Files selected for processing (2)
  • src/components/breadcrumbs/breadcrumbs.tsx
  • src/components/breadcrumbs/types.ts

@yelyzavetakhokhlova yelyzavetakhokhlova merged commit 6ed75d8 into develop Feb 25, 2026
2 checks passed
@yelyzavetakhokhlova yelyzavetakhokhlova deleted the feature/breadcrumbs-max-descriptors branch February 25, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants