Skip to content

fix(sidebar): show project name on status/PR-status grouped cards - #13938

Closed
PannenetsF wants to merge 5 commits into
stablyai:mainfrom
PannenetsF:yq/sidebar-project-name
Closed

PannenetsF wants to merge 5 commits into
stablyai:mainfrom
PannenetsF:yq/sidebar-project-name

Conversation

@PannenetsF

Copy link
Copy Markdown
Contributor

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/master for every session-less primary), so cards are indistinguishable across projects. This wires the existing showProjectName lever (introduced in #13830) at the sidebar render site for groupBy !== '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).

Stacked on #13830. This branch is built on top of yq/lucid-poitras-5a53d1, because it reuses the showProjectName / showProjectNameLabel mechanism that #13830 adds and which isn't on main yet. Until #13830 merges, this PR's diff will also show #13830's commits; once #13830 merges to main, this reduces to the single sidebar change (WorktreeList.tsx + test). Merge #13830 first.

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-warnings oxlint
  • pnpm build — not run (native node-pty rebuild 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 WorktreeList for a one-line boolean prop wasn't warranted — the existing harness is ~500 lines of mocks and the change is groupBy !== 'repo'.

AI Review Report

  • Scope: two files — src/renderer/src/components/sidebar/WorktreeList.tsx (add showProjectName={groupBy !== 'repo'} at the worktree render site) and WorktreeCard.project-name.test.tsx (add compact-style case). No plumbing/type changes — the prop already flows end-to-end via WorktreeCardProps from fix(board): show project name on Workspace board cards #13830.
  • Correctness: the label is gated by showProjectNameLabel = Boolean(showProjectName) && showInlineRepoBadge, where showInlineRepoBadge already 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.
  • Cross-platform (macOS / Linux / Windows): reviewed — pure renderer/React presentation logic, no platform-specific APIs, paths, or keyboard handling. No difference across OSes.
  • SSH / remote / folder-workspace: no host or wire interaction; the folder-workspace render site passes 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.displayName string (from local app state) into a text node. No new inputs, IPC, network, filesystem, or auth paths. No injection surface (React text child, not dangerouslySetInnerHTML).

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]

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f1916533-4e4d-4b59-8d46-0661c020e600

📥 Commits

Reviewing files that changed from the base of the PR and between 2f0f9a8 and dcb0fe7.

📒 Files selected for processing (7)
  • src/renderer/src/components/sidebar/WorkspaceKanbanCard.tsx
  • src/renderer/src/components/sidebar/WorktreeCard.project-name.test.tsx
  • src/renderer/src/components/sidebar/WorktreeCard.tsx
  • src/renderer/src/components/sidebar/worktree-card-header.tsx
  • src/renderer/src/components/sidebar/worktree-card-model.ts
  • src/renderer/src/components/sidebar/worktree-card-presentation.tsx
  • src/renderer/src/components/sidebar/worktree-list/rows/item-row.tsx
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/renderer/src/components/sidebar/WorktreeCard.tsx
  • src/renderer/src/components/sidebar/WorktreeCard.project-name.test.tsx
  • src/renderer/src/components/sidebar/WorkspaceKanbanCard.tsx
  • src/renderer/src/components/sidebar/worktree-card-model.ts
  • src/renderer/src/components/sidebar/worktree-card-header.tsx
  • src/renderer/src/components/sidebar/worktree-card-presentation.tsx

Included review availability: Your plan includes up to 10 reviews per rolling hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

WorktreeCard now accepts showProjectName and passes it through presentation data. The card header conditionally renders a truncated repository display name. Board cards and non-repository-grouped sidebar cards enable the label. Tests cover board, compact, sidebar, and folder-workspace behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the sidebar fix for project names on status and PR-status grouped cards.
Description check ✅ Passed The description covers the change, rationale, linked issue, visual-proof limitation, testing, compatibility impact, and build limitation, with minor template omissions.
Linked Issues check ✅ Passed The implementation satisfies [#13937] by showing project names for non-repository grouping while preserving repository, legacy, folder, and pinned behavior.
Out of Scope Changes check ✅ Passed All changes support [#13937] or the explicitly documented [#13830] prerequisite; no unrelated changes appear in the provided summary.

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.

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

🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/worktree-card-model.ts (1)

25-26: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Reduce 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.tsx
  • src/renderer/src/components/sidebar/WorktreeCard.project-name.test.tsx
  • src/renderer/src/components/sidebar/WorktreeCard.tsx
  • src/renderer/src/components/sidebar/WorktreeList.tsx
  • src/renderer/src/components/sidebar/worktree-card-header.tsx
  • src/renderer/src/components/sidebar/worktree-card-model.ts
  • src/renderer/src/components/sidebar/worktree-card-presentation.tsx

@PannenetsF

Copy link
Copy Markdown
Contributor Author

Addressed the Docstring Coverage warning in 9e4fe71 — added docstrings to the four test helpers (makeRepo, makeFolderRepo, makePrimaryWorktree, projectNameEl). To stay within this repo's "concise, non-obvious comments only" guideline, each docstring states the fixture's role in the test (folding in the prior inline // Why: rationale) rather than restating the obvious.

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.

@PannenetsF

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@PannenetsF

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

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

🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/worktree-card-header.tsx (1)

170-172: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Shorten 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.tsx
  • src/renderer/src/components/sidebar/WorktreeCard.project-name.test.tsx
  • src/renderer/src/components/sidebar/WorktreeCard.tsx
  • src/renderer/src/components/sidebar/WorktreeList.tsx
  • src/renderer/src/components/sidebar/worktree-card-header.tsx
  • src/renderer/src/components/sidebar/worktree-card-model.ts
  • src/renderer/src/components/sidebar/worktree-card-presentation.tsx

@PannenetsF
PannenetsF force-pushed the yq/sidebar-project-name branch from 89ba73f to a44a528 Compare August 12, 2026 05:43
@PannenetsF

Copy link
Copy Markdown
Contributor Author

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.

  • The check measures source functions in the PR's changed files, and ignores test files (*.test.tsx) — a full re-review confirmed that documenting the test helpers didn't move the metric, so I reverted that.
  • The functions it's counting come almost entirely from WorktreeList.tsx, which is only in this diff because the PR is stacked on fix(board): show project name on Workspace board cards #13830. Reaching 80% would mean adding docstrings to ~37 pre-existing functions across a 6.8k-line file — unrelated to this one-line change, and against this repo's "concise, non-obvious comments only" guideline (AGENTS.md).

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 main (at which point the diff is just WorktreeList.tsx +4 and the test +21). Happy to revisit if a maintainer would prefer a different approach (e.g. a repo-level .coderabbit.yaml docstring-coverage setting).

PannenetsF and others added 4 commits August 18, 2026 21:04
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]>
@PannenetsF
PannenetsF force-pushed the yq/sidebar-project-name branch from 9123894 to dcb0fe7 Compare August 18, 2026 13:14
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

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]>
@PannenetsF

Copy link
Copy Markdown
Contributor Author

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

@OrcaWin

OrcaWin commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

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!

@OrcaWin OrcaWin closed this Oct 27, 2026
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.

Sidebar: project name not shown on status/PR-status grouped cards (all read as main/master)

5 participants