Skip to content

fix(desktop): truncate long base-branch name in 'from' label - #5985

Merged
AviPeltz merged 3 commits into
ParadevAI:mainfrom
ethan0905:fix/truncate-from-branch-label
Aug 1, 2026
Merged

AviPeltz merged 3 commits into
ParadevAI:mainfrom
ethan0905:fix/truncate-from-branch-label

Conversation

@ethan0905

@ethan0905 ethan0905 commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #5506 — "from" branch name wraps instead of truncating

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 an inline-flex button with no min-w-0/truncate, so it can't ellipsize.

Before (from #5506) After (expected, from #5506)
from branch wraps to multiple lines from branch truncates on one line

Fix

Pure CSS (Tailwind classes) plus hover title tooltips. No logic, state, or markup-structure changes.

  • BaseBranchSelector.tsx — the reported UI. (The issue pointed at ChangesHeader.tsx, but the wrapping text lives in this child selector.) Adds min-w-0 to the trigger button, wraps the branch name in a min-w-0 truncate span, and marks the chevron shrink-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 same from <branch> pattern and had the same bug. Fixed the same way: min-w-0 truncate on both branch spans, shrink-0 on the from label and icon.
  • ChangesHeader.tsx — one line: a title on the already-truncating active branch name.

Truncated names stay recoverable: every truncated span gets a title tooltip, 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, and git ls-remote origin 'refs/heads/triage/issue-5506*' — only #5507 and this PR come up.)

  • PR fix: solve #5506 — 'from' branch name wraps instead of truncating #5507 (github-actions triage bot, branch 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 to BaseBranchSelector.tsx (min-w-0 trigger, truncate span, shrink-0 chevron) plus a renderToStaticMarkup unit test asserting the Tailwind class strings appear in the markup.

What this PR adds beyond #5507:

Why this PR matters

  • It closes a user-reported papercut in a high-traffic surface, with visual proof above.
  • 3 files, +21/−8, class names and title attributes only — no type, runtime, or behavior risk. Review takes a glance.
  • It follows the pattern already used one element over instead of inventing a new one.
  • Biome is clean (5457 files); all scripts/check-*.sh gates pass locally.

Open in Stage

Summary by CodeRabbit

  • UI Improvements
    • Improved branch name display in workspace and changes views.
    • Long branch names now truncate cleanly instead of overflowing.
    • Added hover tooltips to reveal full branch names and base branch names.

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
@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 28725bc5-9e26-4d52-bf74-ff69e15026be

📥 Commits

Reviewing files that changed from the base of the PR and between f317e5e and b93d494.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/project/$projectId/page.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/project/$projectId/page.tsx

📝 Walkthrough

Walkthrough

Branch and base branch labels now use overflow-aware layouts and title attributes to display full values when truncated.

Changes

Branch label overflow handling

Layer / File(s) Summary
Truncated branch label displays
apps/desktop/src/renderer/routes/_authenticated/_dashboard/project/$projectId/page.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/*
Branch and base branch labels use min-w-0, truncate, and non-shrinking layout styles. title attributes provide the full branch values.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary change: truncating long base-branch names in the desktop “from” label.
Description check ✅ Passed The description explains the problem and fix, includes screenshots, and reports local validation results.
Linked Issues check ✅ Passed The changes satisfy issue #5506 by truncating the “from” branch name within the workspace changes selector.
Out of Scope Changes check ✅ Passed All changes address related branch-name truncation and tooltip behavior across the documented desktop surfaces.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@ghost

ghost commented Jul 27, 2026 •

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 2 individual chapters for you:

Title
1 Truncate base branch name in workspace sidebar
2 Truncate branch names in project page card
Open in Stage

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.
@ethan0905
ethan0905 marked this pull request as ready for review July 27, 2026 14:12
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

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

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
Loading

Re-trigger cubic

@AviPeltz
AviPeltz merged commit c5ae671 into ParadevAI:main Aug 1, 2026
12 checks passed
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.

"from" branch name wraps instead of truncating

2 participants