Repository navigation
Conversation
…o one header A folder imported as a project group on this computer and again on a paired Orca server showed up as two groups with the same name, and the projects that exist on both machines landed in whichever copy anchored them. Under Group by Project the sidebar now draws one header for same-named groups from different hosts (same-host namesakes stay apart), with this computer's copy as the representative. Rows, folder workspaces, collapse and reveal keys, Cmd+1-9 order, header drag and the group dialogs read the same mapping, so a drop lands on the repo's own host and rename/delete reach every member. Persistence and the wire format are untouched. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
5b83e7c3-9358-4b68-b9ae-d91e10cd9b20
📒 Files selected for processing: 23
src/renderer/src/components/sidebar/WorktreeList.tsxsrc/renderer/src/components/sidebar/rendered-sidebar-worktree-order.tssrc/renderer/src/components/sidebar/worktree-list/drag/use-header-drag.tssrc/renderer/src/components/sidebar/worktree-list/grouping/build-rows.cross-host-project-groups.test.tssrc/renderer/src/components/sidebar/worktree-list/grouping/build-rows.tssrc/renderer/src/components/sidebar/worktree-list/grouping/cross-host-project-group-merge.test.tssrc/renderer/src/components/sidebar/worktree-list/grouping/cross-host-project-group-merge.tssrc/renderer/src/components/sidebar/worktree-list/grouping/folder-workspace-lanes.tssrc/renderer/src/components/sidebar/worktree-list/grouping/project-group-sections.tssrc/renderer/src/components/sidebar/worktree-list/listing/rendered-sidebar-row-keys.tssrc/renderer/src/components/sidebar/worktree-list/listing/use-collapsed-groups.tssrc/renderer/src/components/sidebar/worktree-list/listing/use-host-visible-scope.tssrc/renderer/src/components/sidebar/worktree-list/listing/use-section-rows.tssrc/renderer/src/components/sidebar/worktree-list/navigation/folder-reveal.cross-host.test.tssrc/renderer/src/components/sidebar/worktree-list/navigation/folder-reveal.tssrc/renderer/src/components/sidebar/worktree-list/navigation/pending-reveal-inputs.tssrc/renderer/src/components/sidebar/worktree-list/navigation/reveal-ancestors.tssrc/renderer/src/components/sidebar/worktree-list/navigation/use-pending-reveal.tssrc/renderer/src/components/sidebar/worktree-list/navigation/worktree-reveal-group-keys.tssrc/renderer/src/components/sidebar/worktree-list/rows/use-project-group-dialogs-cross-host.test.tsxsrc/renderer/src/components/sidebar/worktree-list/rows/use-project-group-dialogs.tssrc/renderer/src/components/sidebar/worktree-list/viewport/VirtualizedWorktreeViewport.tsxsrc/renderer/src/components/sidebar/worktree-list/viewport/viewport-props.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
The delete confirmation for a header folded across hosts collected the members' project ids into one set, so a repo id that both hosts carry showed as one project although confirming removes it on each host. Keep every (id, host) pair, and look names up by the same identity instead of the host-blind repo map. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ELI5
When the same folder of projects is checked out on two machines (say
~/code/aion this Mac and on a paired Orca server), the sidebar showed that folder twice: one "ai" group per machine. Now it shows one "ai" group with both machines' projects inside it.What Changed
Before: every host keeps its own project groups, and the sidebar listed each host's groups side by side. With a paired server that mirrors the same folders, "Group by Project" showed
ai(this computer) andai(server) as two headers, and the projects that exist on both machines landed in whichever of the two groups happened to anchor them.After: under "Group by Project", groups from different hosts that share a name (and the same parent group) fold into one header. The header holds every host's projects and folder workspaces, keeps one collapse state, and child groups fold the same way underneath it. The groups themselves are untouched on each host; only the sidebar draws them together.
Mechanism: the host-visible project groups now pass through a merge step (
cross-host-project-group-merge.ts) that picks one representative per set of same-named groups (this computer's copy when it has one) and maps every member id to it. Row building, folder-workspace placement, collapse and reveal keys, Cmd+1–9 ordering, header drag and the group dialogs all read that map, so:Groups on a single host are never merged with each other, and a name that exists on only one host renders exactly as before (the merge returns the input list untouched).
Why
Project groups are per-host data, and merging them server-side would mean inventing a cross-host identity for a folder. The sidebar already merges projects across hosts by their git identity, so the natural reading of "same-named group on another host" is "the same folder on another machine", and folding them in the view gives that without touching persistence or the wire format. Alternatives considered: merging by folder basename (surprising when two unrelated folders share a name on different hosts, and the name is what the user actually sees and edits), or an explicit "link groups" action (more UI for the common case where the user already named them the same).
Linked Issue
Fixes #29535
Visual Proof
Before / after of the row model replayed with the author's two real catalogs (49 local repos, 16 server repos):
Before:
ai(server, 8 projects) andai(local, 26 projects) as two headers; the 8 projects present on both machines sat under whichever group anchored them.After: one
aiheader (34 entries) with both hosts' checkouts under each shared project, followed bytomoro.(Screenshots to be attached from a local build.)
Testing
pnpm testforsrc/renderer/src/components/sidebar(new:cross-host-project-group-merge.test.ts,build-rows.cross-host-project-groups.test.ts,folder-reveal.cross-host.test.ts,use-project-group-dialogs-cross-host.test.tsx)pnpm tc,pnpm run check:code-quality:changedReplayed the sidebar row model with two real host catalogs (local + paired Orca server) through
buildRowsandaddHostSectionRows.Platforms: macOS (local) + macOS Orca server; the change is renderer-only and host-agnostic.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Drafted with Claude Code (Claude Fable 5.1); reviewed and tested by the author.
Review
Agent skill upstream boundary
Notes
Renderer-only; no wire or persistence change, so older servers and clients are unaffected. Mobile does not render project groups. Group actions on a merged header fan out one request per host, each routed to the group's owner as before.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code