Repository navigation
feat(sidebar): show project name on worktree rows in header-less views - #6898
jtalborough wants to merge 1 commit into
Conversation
In the All / None / Status / PR views there is no project header above
the rows, so a project's primary worktree showed only its branch name
("main") and was indistinguishable from every other project's primary.
Worktrees created under a project (e.g. a `hawksbill` branch under
`orca`) likewise carried no project context.
Prefix the project name (bold) before the branch/worktree name (lighter
gray) on every worktree row in those views so each row is identifiable.
The primary worktree drops its status lane entirely so it sits
flush-left and the additional worktrees — which keep their branch glyph
in the status lane — read as a nested level. The grouped Group by →
Project view is unchanged; its header already names the project, so the
prefix and lane-omission are gated off there (hideRepoBadge).
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Ready to review this PR? Stage has broken it down into 2 individual chapters for you:
Chapters generated by Stage for commit 73c4b8c on Jun 30, 2026 12:20pm UTC. |
📝 WalkthroughWalkthrough
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/WorktreeCard.project-identity.test.tsx (1)
129-179: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the branch-identity behavior, not just slot presence.
These checks only prove whether the status-slot wrapper renders. The new
hasBranchIdentitybranch at Line 1397 can regress while this suite still passes, because both the primary and non-primary cases are asserted only withdata-worktree-card-status-slot. Please add one assertion that distinguishes the branch-identity rendering path from the plain status-dot path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 193801c8-bfbf-4ea6-893f-84fa8b5aa3ff
📒 Files selected for processing (2)
src/renderer/src/components/sidebar/WorktreeCard.project-identity.test.tsxsrc/renderer/src/components/sidebar/WorktreeCard.tsx
| // Why: in header-less views the primary worktree drops its status lane entirely so | ||
| // its content sits flush-left and the branch-glyph worktrees read as a nested level. | ||
| const primaryRowOmitsStatusLane = worktree.isMainWorktree && !isFolder && !hideRepoBadge |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Include primaryRowOmitsStatusLane in the new-card gutter calculation.
Line 1375 hides the slot, but Line 1297 still reserves the left offset whenever showCombinedStatusSlot is true. In experimentalNewWorktreeCardStyle, primary rows in header-less views will still keep a blank gutter instead of actually sitting flush-left.
Suggested fix
- const applyNewCardStyleStatusLaneOffset = newCardStyle && showCombinedStatusSlot
+ const applyNewCardStyleStatusLaneOffset =
+ newCardStyle && showCombinedStatusSlot && !primaryRowOmitsStatusLane📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Why: in header-less views the primary worktree drops its status lane entirely so | |
| // its content sits flush-left and the branch-glyph worktrees read as a nested level. | |
| const primaryRowOmitsStatusLane = worktree.isMainWorktree && !isFolder && !hideRepoBadge | |
| const applyNewCardStyleStatusLaneOffset = | |
| newCardStyle && showCombinedStatusSlot && !primaryRowOmitsStatusLane |
What
In the header-less workspace views (Group by → None / Status / PR) there is no project header above the rows, so a project's primary worktree showed only its branch name (e.g.
main) and was indistinguishable from every other project's primary. Worktrees created under a project (e.g. ahawksbillbranch underorca) likewise carried no project context.This prefixes the project name (bold) before the branch/worktree name (lighter gray) on every worktree row in those views, so each row is identifiable:
The primary worktree drops its status lane entirely so it sits flush-left, and the additional worktrees — which keep their branch glyph in the status lane — read as a nested level.
The grouped Group by → Project view is unchanged: its header already names the project, so the prefix and lane-omission are gated off there (
hideRepoBadge).Why
The flat "All" view is a common way to scan every workspace, but primary rows all read as just
mainwith no way to tell which project they belonged to.Review summary (cross-cutting checks)
connectionIdpaths touched.repo.displayNameandworktree.isMainWorktree.docs/STYLEGUIDE.md(existing tokens, no new colors); reuses the status-lane branch glyph rather than adding chrome.Tests
WorktreeCard.project-identity.test.tsx: project prefix + status lane on a worktree row; prefix shown and status lane omitted for the primary; grouped-view case (no prefix, primary keeps its lane).oxlint,tsgotypecheck, andoxfmtall clean.Visual
UI change — screenshots to be attached to the PR conversation (before/after of the All view).
🤖 Generated with Claude Code
ELI5
In sidebar views without project headers, each worktree row shows the project name next to the branch so rows from different repos are not ambiguous. Project grouping still uses headers as before.