Repository navigation
fix(sidebar): show project name on status/PR-status grouped cards - #13938
PannenetsF wants to merge 5 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (6)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 8 remain after this review. 📝 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.
🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/worktree-card-model.ts (1)
25-26: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueReduce duplicated project-name comments.
Keep a comment only where the rationale is not clear from
showProjectName. Use one concise line where a comment remains.
src/renderer/src/components/sidebar/worktree-card-model.ts#L25-L26: Remove the duplicated rationale.src/renderer/src/components/sidebar/worktree-card-presentation.tsx#L79-L80: Remove or reduce the rationale to one line.src/renderer/src/components/sidebar/WorktreeList.tsx#L4883-L4885: Keep one concise view-specific rationale, if needed.src/renderer/src/components/sidebar/WorkspaceKanbanCard.tsx#L66-L67: Remove the duplicated rationale.src/renderer/src/components/sidebar/worktree-card-header.tsx#L170-L172: Remove or reduce the rationale to one line.src/renderer/src/components/sidebar/WorktreeCard.project-name.test.tsx#L78-L84: Reduce the fixture rationale to one line.src/renderer/src/components/sidebar/WorktreeCard.project-name.test.tsx#L150-L151: Reduce the test rationale to one line.src/renderer/src/components/sidebar/WorktreeCard.project-name.test.tsx#L197-L198: Reduce the test rationale to one line.As per coding guidelines, “Comments must be concise, non-obvious, and brief—prefer one line.”
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8bd49a57-ac53-4c00-bac2-501bbffbd83d
📥 Commits
Reviewing files that changed from the base of the PR and between e597136 and a44a528b55ced2888bfe04502326326ca0b1066c.
📒 Files selected for processing (7)
src/renderer/src/components/sidebar/WorkspaceKanbanCard.tsxsrc/renderer/src/components/sidebar/WorktreeCard.project-name.test.tsxsrc/renderer/src/components/sidebar/WorktreeCard.tsxsrc/renderer/src/components/sidebar/WorktreeList.tsxsrc/renderer/src/components/sidebar/worktree-card-header.tsxsrc/renderer/src/components/sidebar/worktree-card-model.tssrc/renderer/src/components/sidebar/worktree-card-presentation.tsx
|
Addressed the Docstring Coverage warning in 9e4fe71 — added docstrings to the four test helpers ( Note these helpers originate on #13830 (this PR is stacked on it), so the coverage figure will settle once #13830 merges and this branch rebases onto main. |
|
@coderabbitai review |
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/worktree-card-header.tsx (1)
170-172: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueShorten the new comments.
Keep each comment to one concise sentence when possible. Remove comments that restate the test name or adjacent code.
src/renderer/src/components/sidebar/worktree-card-header.tsx#L170-L172: Replace the detailed rendering explanation with one brief reason.src/renderer/src/components/sidebar/WorktreeCard.project-name.test.tsx#L67-L70: Reduce the fixture docstring to one sentence.src/renderer/src/components/sidebar/WorktreeCard.project-name.test.tsx#L81-L84: Reduce the fixture docstring to one sentence.src/renderer/src/components/sidebar/WorktreeCard.project-name.test.tsx#L89-L93: Reduce the fixture docstring to one sentence.src/renderer/src/components/sidebar/WorktreeCard.project-name.test.tsx#L160-L161: Remove or shorten the test rationale.src/renderer/src/components/sidebar/WorktreeCard.project-name.test.tsx#L207-L208: Remove or shorten the test rationale.As per coding guidelines, “Comments must be concise, non-obvious, and brief—prefer one line.”
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d0833531-e26c-40bf-b276-a6297cfcc24d
📥 Commits
Reviewing files that changed from the base of the PR and between e597136 and 9e4fe717253f07193b57b7670a4fd69754a1f45e.
📒 Files selected for processing (7)
src/renderer/src/components/sidebar/WorkspaceKanbanCard.tsxsrc/renderer/src/components/sidebar/WorktreeCard.project-name.test.tsxsrc/renderer/src/components/sidebar/WorktreeCard.tsxsrc/renderer/src/components/sidebar/WorktreeList.tsxsrc/renderer/src/components/sidebar/worktree-card-header.tsxsrc/renderer/src/components/sidebar/worktree-card-model.tssrc/renderer/src/components/sidebar/worktree-card-presentation.tsx
89ba73f to
a44a528
Compare
|
Update on the Docstring Coverage pre-merge warning (0.00%): I looked into it and it can't be meaningfully resolved on this branch as-is.
Given that, I've left the branch as the single focused sidebar commit. The coverage figure should recompute once #13830 merges and this branch rebases onto |
a44a528 to
ddbb145
Compare
Board lanes group by workspace status and mix projects, so each card is the only place its project is identified. In the new/compact card styles the repo shows as an icon-only chip (name in a hover tooltip), so cards whose title falls back to the branch — every project's primary reads `main`/`master` — are indistinguishable across projects. Add a board-only `showProjectName` prop, set from WorkspaceKanbanCard, that renders the repo display name as a muted inline label in the title row. The sidebar keeps the chip-only treatment. Scoped so it only fires in the icon-only title styles where the name text is otherwise absent. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The folder-workspace case passed repo={undefined}, which short-circuits
at !!repo before the !isFolder guard runs — so it tested missing-repo
behavior, not folder behavior. Pass a repo with kind:'folder' so the
inline project label is gated off through the actual folder path.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Extends the board fix (stablyai#13830) to the sidebar. When grouped by workspace-status or pr-status (or ungrouped), cards from different projects interleave in one group; in the new/compact card styles the repo is an icon-only chip and the title falls back to the branch (main/master for every primary), so cards are indistinguishable across projects. Wire the existing showProjectName lever at the sidebar render site for groupBy !== 'repo' (repo-grouped views use the group header). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…deRabbit) Collapse the repeated multi-line "name the project inline" rationale to one canonical line on the prop and brief one-liners at each use site. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
9123894 to
dcb0fe7
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
The test imported Repo, Worktree, and WorktreeCardProperty from a non-existent '../../../../shared/types' barrel. Split into the canonical per-file paths (repo-types, worktree/types, ui-chrome-types) matching sibling sidebar tests. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
@brennanb2025 Rebased onto the latest main and resolved all conflicts. Note this is stacked on #13830, which should merge first. Verified locally (typecheck + targeted tests pass); CI is pending maintainer approval to run. Ready for review whenever you have a moment — thanks! |
|
Thanks for catching this, @PannenetsF, and for covering both compact and new cards. The project-name fix has since landed in #28890: the shared card chip now shows the project name in mixed-project sidebar groups, and the board uses that same chip too. Project-grouped rows still avoid the extra badge. I checked the current chip and the sidebar/board wiring against the full stacked change, so I’m closing this as already fixed on main. I appreciate the work you put into making those cards easier to tell apart! |
Summary
Follow-on to #13830, extending its board fix to the sidebar. Closes #13937.
When the sidebar is grouped by workspace-status or PR-status (or ungrouped), cards from different projects interleave within one group. In the new/compact card styles the repo is an icon-only chip and the card title falls back to the branch (
main/masterfor every session-less primary), so cards are indistinguishable across projects. This wires the existingshowProjectNamelever (introduced in #13830) at the sidebar render site forgroupBy !== 'repo', surfacing a muted inline project-name label next to the icon chip. Repo-grouped views are unchanged (the repo group header already names the project); legacy card style and folder workspaces are unaffected (the label is gated behind the same icon-chip condition).Screenshots
No screenshots — no running build in this environment. Behavior change is a single muted inline label (
data-worktree-card-project-name) rendered next to the existing repo icon chip in the sidebar's status/PR-status/ungrouped views, matching the board treatment shipped in #13830.Testing
pnpm test src/renderer/src/components/sidebar/WorktreeCard.project-name.test.tsx— 4/4 pass (added a compact-card-style case; existing new-style, sidebar-omit, and folder-workspace cases still pass)pnpm typecheck— passes (exit 0)pnpm lint— passes (exit 0); changed files clean under strict--deny-warningsoxlintpnpm build— not run (nativenode-ptyrebuild fails under Node 26 in this environment; unrelated to this renderer-only change)The behavior itself (label rendering under both icon-only card styles) is covered by the card-level test. Rendering the full
WorktreeListfor a one-line boolean prop wasn't warranted — the existing harness is ~500 lines of mocks and the change isgroupBy !== 'repo'.AI Review Report
src/renderer/src/components/sidebar/WorktreeList.tsx(addshowProjectName={groupBy !== 'repo'}at the worktree render site) andWorktreeCard.project-name.test.tsx(add compact-style case). No plumbing/type changes — the prop already flows end-to-end viaWorktreeCardPropsfrom fix(board): show project name on Workspace board cards #13830.showProjectNameLabel = Boolean(showProjectName) && showInlineRepoBadge, whereshowInlineRepoBadgealready requires new/compact style + a real repo +!hideRepoBadge+!isFolder+!showPinnedRepoIcon. So it can only appear where the icon chip appears; it self-suppresses for folder workspaces (no repo), the pinned section, legacy style, and repo-grouped views.repo={undefined}, so the label never renders there. No remote wire-format change.Security Audit
No security-relevant surface: renderer-only UI change rendering an already-available
repo.displayNamestring (from local app state) into a text node. No new inputs, IPC, network, filesystem, or auth paths. No injection surface (React text child, notdangerouslySetInnerHTML).Notes
Same root cause as #13828; this addresses the sidebar gap that issue's proposal explicitly left open ("the sidebar keeps its chip-only treatment since it can already group by project" — which stops holding once the user groups by status/PR-status instead of project).
Co-Authored-By: Claude Opus 5 (1M context) [email protected]