Repository navigation
fix(desktop): truncate long base-branch name in 'from' label - #5985
Conversation
The base-branch name in the changes sidebar's 'from <branch>' button wrapped to multiple lines when long. Give the trigger button min-w-0 and wrap the branch name in a truncating span (mirroring the active branch's min-w-0 truncate pattern), keeping the 'from' label and chevron non-shrinking. Apply the same truncation to the matching 'from <branch>' row in the project new-task card. Fixes ParadevAI#5506
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughBranch and base branch labels now use overflow-aware layouts and ChangesBranch label overflow handling
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
|
Ready to review this PR? Stage has broken it down into 2 individual chapters for you:
Chapters generated by Stage for commit f317e5e on Jul 27, 2026 1:11pm UTC. |
Match the existing truncated-branch pattern (title attribute, as in PRDetailCard/V2WorkspaceTitle) so truncated branch names remain recoverable on hover in the changes-tab header and project new-task card.
effectiveCompareBaseBranch is string | null, but the title prop expects string | undefined, so tsc failed on the new-task branch preview's title attribute. Claude-Session: https://claude.ai/code/session_013tjs7dqQy8NC6VJsUGBKpz
There was a problem hiding this comment.
No issues found across 3 files
Architecture diagram
sequenceDiagram
participant User as User
participant Renderer as React Renderer
participant Sidebar as Workspace Sidebar
participant BBS as BaseBranchSelector
participant CH as ChangesHeader
participant Card as New-Task Card
Note over Renderer,Card: Client-side branch label rendering
Renderer->>Sidebar: Render workspace changes tab
Sidebar-->>BBS: Pass currentValue (base branch name)
Sidebar-->>CH: Pass currentBranch.name (active branch name)
Renderer->>Card: Render new-task branch row
BBS->>BBS: Render min-w-0 truncate span + shrink-0 chevron
CH->>CH: Render min-w-0 truncate active branch
Card->>Card: Render min-w-0 truncate on both branch spans
opt Long branch name
BBS-->>Renderer: Ellipsized label with title=full branch
CH-->>Renderer: Ellipsized label with title=full branch
Card-->>Renderer: Ellipsized labels with title=full branch
end
User->>Renderer: Hover over truncated label
Renderer-->>User: Tooltip reveals full branch name
Problem
In the workspace changes sidebar, the active branch name truncates, but the base branch in the
from <branch>selector wraps onto multiple lines when it is long. That stretches the header row. Reported with screenshots in #5506. The cause: the branch name is a bare text node inside aninline-flexbutton with nomin-w-0/truncate, so it can't ellipsize.Fix
Pure CSS (Tailwind classes) plus hover
titletooltips. No logic, state, or markup-structure changes.BaseBranchSelector.tsx— the reported UI. (The issue pointed atChangesHeader.tsx, but the wrapping text lives in this child selector.) Addsmin-w-0to the trigger button, wraps the branch name in amin-w-0 truncatespan, and marks the chevronshrink-0— the same truncation the active branch name right next to it already uses.project/$projectId/page.tsx— the new-task card's branch preview uses the samefrom <branch>pattern and had the same bug. Fixed the same way:min-w-0 truncateon both branch spans,shrink-0on thefromlabel and icon.ChangesHeader.tsx— one line: atitleon the already-truncating active branch name.Truncated names stay recoverable: every truncated span gets a
titletooltip, matching the sidebar's existing pattern (PRDetailCard,V2WorkspaceTitle,V2WorkspaceRow).Prior art
One earlier attempt exists; nothing else references #5506. (Checked
gh pr list --state all --search 5506, "truncate branch", "BaseBranchSelector", the issue's cross-reference timeline, andgit ls-remote origin 'refs/heads/triage/issue-5506*'— only #5507 and this PR come up.)triage/issue-5506-28918887630) — closed unmerged on 2026-07-11; the branch still exists on the remote. Verified against its diff: it made the same core CSS fix toBaseBranchSelector.tsx(min-w-0trigger,truncatespan,shrink-0chevron) plus arenderToStaticMarkupunit test asserting the Tailwind class strings appear in the markup.What this PR adds beyond #5507:
BaseBranchSelector. The new-task card inproject/$projectId/page.tsxrenders the samefrom <branch>row with the same bug; this PR fixes it too.titletooltips on every truncated span, including the already-truncating active branch inChangesHeader.Why this PR matters
titleattributes only — no type, runtime, or behavior risk. Review takes a glance.scripts/check-*.shgates pass locally.Summary by CodeRabbit