Repository navigation
Fix sidebar grouping for paired remote projects - #16315
LuisUrrutia wants to merge 11 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:
📝 WalkthroughWalkthroughProject-group creation, movement, removal, and ordering now route through the repository’s execution host. Project groups are filtered by repository ownership before they appear as move targets. Drag sessions retain repository, host, and group identifiers. Store mutations validate repository and destination ownership before selecting local or runtime execution targets. Tests cover runtime routing, direct-SSH compatibility, duplicate repository IDs, worktree repository resolution, and sidebar drag behavior. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 18.42% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 38 functions across 40 files. (1 skipped: 1 unsupported.)
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
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 53b339bf-603c-4776-b703-51bac6b238fd
📥 Commits
Reviewing files that changed from the base of the PR and between 4f525f1 and 29ac59c55834e5a5203b3ed74986b92368eb66d6.
📒 Files selected for processing (10)
src/renderer/src/components/sidebar/WorktreeContextMenu.tsxsrc/renderer/src/components/sidebar/worktree-list/drag/use-header-drag.tssrc/renderer/src/components/sidebar/worktree-list/rows/repo-header-project-actions.tsxsrc/renderer/src/components/sidebar/worktree-list/rows/use-project-group-dialogs-owner-host.test.tsxsrc/renderer/src/components/sidebar/worktree-list/rows/use-project-group-dialogs.tssrc/renderer/src/store/slices/project-group-owner-routing.test.tssrc/renderer/src/store/slices/project-group-owner-routing.tssrc/renderer/src/store/slices/repos-remote-project-groups.test.tssrc/renderer/src/store/slices/repos.test.tssrc/renderer/src/store/slices/repos.ts
💤 Files with no reviewable changes (1)
- src/renderer/src/store/slices/repos.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
29ac59c to
208708b
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/components/sidebar/project-header-drag-contract.ts (1)
19-30: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftPreserve host identity for whole-repository reorders.
When
usesProjectGroupOrderingis false,onCommitRepoOrderreceives onlystring[]. DuplicaterepoIdvalues cannot identify the dragged host row. A drag can reorder the wrong host row.Pass a host-qualified repository identity, or the dragged source index, through whole-repository ordering. Add a duplicate-ID regression test with no project groups.
Also applies to: 39-42
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 263dde7d-ea02-436e-ad4a-94106050449c
📥 Commits
Reviewing files that changed from the base of the PR and between 29ac59c55834e5a5203b3ed74986b92368eb66d6 and 9ba577abf711dc32597d8bd4fdb234806b2ab288.
📒 Files selected for processing (8)
src/renderer/src/components/sidebar/project-header-drag-commit.test.tssrc/renderer/src/components/sidebar/project-header-drag-commit.tssrc/renderer/src/components/sidebar/project-header-drag-contract.tssrc/renderer/src/components/sidebar/project-header-drag-start.test.tssrc/renderer/src/components/sidebar/project-header-drag-start.tssrc/renderer/src/components/sidebar/project-header-drag.tssrc/renderer/src/components/sidebar/worktree-list/drag/use-header-drag.tssrc/renderer/src/components/sidebar/worktree-list/rows/SectionHeader.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
8001d7b to
6da43ba
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. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: cd737d3b-7ae3-4852-a3af-7061b2b3462b
📥 Commits
Reviewing files that changed from the base of the PR and between 8217e68 and 6da43ba1ede3bbfd8272bc279db4e290c044e816.
📒 Files selected for processing (19)
src/renderer/src/components/sidebar/project-header-drag-commit.test.tssrc/renderer/src/components/sidebar/project-header-drag-commit.tssrc/renderer/src/components/sidebar/project-header-drag-contract.tssrc/renderer/src/components/sidebar/project-header-drag-start.test.tssrc/renderer/src/components/sidebar/project-header-drag-start.tssrc/renderer/src/components/sidebar/project-header-drag.tssrc/renderer/src/components/sidebar/use-worktree-context-menu-commands.tssrc/renderer/src/components/sidebar/use-worktree-context-menu-model.tsxsrc/renderer/src/components/sidebar/worktree-list/drag/use-header-drag.tssrc/renderer/src/components/sidebar/worktree-list/rows/SectionHeader.tsxsrc/renderer/src/components/sidebar/worktree-list/rows/repo-header-project-actions.tsxsrc/renderer/src/components/sidebar/worktree-list/rows/use-project-group-dialogs-owner-host.test.tsxsrc/renderer/src/components/sidebar/worktree-list/rows/use-project-group-dialogs.tssrc/renderer/src/store/project-groups/project-group-mutations.tssrc/renderer/src/store/repos/repo-state.tssrc/renderer/src/store/slices/project-group-owner-routing.test.tssrc/renderer/src/store/slices/project-group-owner-routing.tssrc/renderer/src/store/slices/repos-remote-project-groups.test.tssrc/renderer/src/store/slices/repos.test.ts
💤 Files with no reviewable changes (1)
- src/renderer/src/store/slices/repos.test.ts
🚧 Files skipped from review as they are similar to previous changes (14)
- src/renderer/src/components/sidebar/worktree-list/drag/use-header-drag.ts
- src/renderer/src/store/slices/repos-remote-project-groups.test.ts
- src/renderer/src/components/sidebar/worktree-list/rows/use-project-group-dialogs.ts
- src/renderer/src/components/sidebar/project-header-drag-commit.ts
- src/renderer/src/store/slices/project-group-owner-routing.ts
- src/renderer/src/components/sidebar/project-header-drag-contract.ts
- src/renderer/src/components/sidebar/project-header-drag-start.ts
- src/renderer/src/store/slices/project-group-owner-routing.test.ts
- src/renderer/src/components/sidebar/project-header-drag-start.test.ts
- src/renderer/src/components/sidebar/worktree-list/rows/use-project-group-dialogs-owner-host.test.tsx
- src/renderer/src/components/sidebar/worktree-list/rows/repo-header-project-actions.tsx
- src/renderer/src/components/sidebar/worktree-list/rows/SectionHeader.tsx
- src/renderer/src/components/sidebar/project-header-drag-commit.test.ts
- src/renderer/src/components/sidebar/project-header-drag.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
6da43ba to
704c188
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 49069027-5c84-467a-854f-aa028a13c362
📥 Commits
Reviewing files that changed from the base of the PR and between 704c1883eee757d8b86c801e4842642fb8d8e515 and dbc06b457361ad988e881d1a1c91806e994c82c3.
📒 Files selected for processing (23)
src/renderer/src/components/sidebar/WorktreeContextMenu.tsxsrc/renderer/src/components/sidebar/WorktreeContextMenuView.tsxsrc/renderer/src/components/sidebar/project-group-menu-actions.tssrc/renderer/src/components/sidebar/project-group-menu-label.tssrc/renderer/src/components/sidebar/use-worktree-card-foundation.tssrc/renderer/src/components/sidebar/use-worktree-context-menu-commands.tssrc/renderer/src/components/sidebar/use-worktree-context-menu-model.tsxsrc/renderer/src/components/sidebar/worktree-card-surface.tsxsrc/renderer/src/components/sidebar/worktree-context-menu-props.tssrc/renderer/src/components/sidebar/worktree-list/drag/use-header-drag.tssrc/renderer/src/components/sidebar/worktree-list/grouping/build-rows.tssrc/renderer/src/components/sidebar/worktree-list/grouping/group-sections.tssrc/renderer/src/components/sidebar/worktree-list/grouping/row-types.tssrc/renderer/src/components/sidebar/worktree-list/listing/use-section-rows.tssrc/renderer/src/components/sidebar/worktree-list/rows/SectionHeader.tsxsrc/renderer/src/components/sidebar/worktree-list/rows/repo-header-project-actions.test.tsxsrc/renderer/src/components/sidebar/worktree-list/rows/repo-header-project-actions.tsxsrc/renderer/src/components/sidebar/worktree-list/rows/use-project-group-dialogs-owner-host.test.tsxsrc/renderer/src/components/sidebar/worktree-list/rows/use-project-group-dialogs.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/store/slices/project-group-owner-routing.test.tssrc/renderer/src/store/slices/project-group-owner-routing.tssrc/renderer/src/store/slices/repos-remote-project-groups.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/worktree-list/listing/host-filtering.ts (1)
26-39: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the shared helper in every repository filter.
src/renderer/src/components/sidebar/use-worktree-card-foundation.tsstill contains the same implementation. Import this helper there and remove the duplicate to prevent host-resolution behavior from diverging.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 540a7aaf-9d02-4864-bbcb-d5af0bb02422
📥 Commits
Reviewing files that changed from the base of the PR and between dbc06b457361ad988e881d1a1c91806e994c82c3 and 7aa6db9c404568317706fa228bef4fd52e74194b.
📒 Files selected for processing (10)
src/renderer/src/components/sidebar/WorktreeList.group-headers.test.tssrc/renderer/src/components/sidebar/project-group-menu-label.test.tssrc/renderer/src/components/sidebar/project-group-menu-label.tssrc/renderer/src/components/sidebar/use-worktree-card-foundation-project-group-label.test.tsxsrc/renderer/src/components/sidebar/use-worktree-card-foundation.tssrc/renderer/src/components/sidebar/worktree-list/listing/host-filtering.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/rows/repo-header-project-actions.test.tsxsrc/renderer/src/i18n/locales/en.json
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
be944c3 to
d7a9482
Compare
Greptile SummaryThe PR makes sidebar project-group operations catalog-aware so local, direct-SSH, and paired-runtime projects are routed and displayed according to their owning catalog.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains within the eligible follow-up review scope. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/renderer/src/store/project-groups/project-group-mutations.ts | Adds host-qualified mutation routing, catalog validation, mutation fences, owner-scoped upserts, and catalog-aware delete cascades. |
| src/renderer/src/store/slices/project-group-owner-routing.ts | Centralizes the distinction between client-owned local/SSH catalogs and isolated paired-runtime catalogs. |
| src/renderer/src/store/selectors.ts | Resolves repository rows for worktrees using host-qualified identity to handle cross-host ID collisions. |
| src/renderer/src/components/sidebar/project-group-menu-actions.ts | Routes contextual group actions through the selected project owner and reports unconfirmed mutations. |
| src/renderer/src/components/sidebar/project-header-drag-commit.ts | Preserves the dragged project's host and group identity through drag completion. |
| src/renderer/src/components/sidebar/worktree-list/listing/project-group-catalog-visibility.ts | Detects whether multiple visible catalogs require host-qualified group-menu labels. |
| src/renderer/src/components/sidebar/worktree-list/rows/repo-header-project-actions.tsx | Restricts project-header destinations to compatible groups and renders catalog-aware action labels. |
Sequence Diagram
sequenceDiagram
participant U as Sidebar user
participant UI as Project group UI
participant S as Renderer store
participant H as Owning catalog host
U->>UI: Create, move, remove, or drag project
UI->>UI: Resolve project and catalog owner
UI->>S: Mutation with owner host ID
S->>H: Local API or paired-runtime RPC
H-->>S: Confirmed group or project state
S->>S: Fence older refreshes and owner-scope update
S-->>UI: Render catalog-filtered groups
Reviews (2): Last reviewed commit: "fix(project-groups): keep catalog mutati..." | Re-trigger Greptile
89a6ece to
5113604
Compare
5113604 to
6c10780
Compare
Manual group creation followed the focused host while moves followed the repository owner. The all-host sidebar could therefore offer a client group that a paired runtime could not resolve. Route project-created groups and moves through the repository owner, and hide group destinations that belong to another catalog.
Project header drags re-resolved a bare repo ID through a map that can retain only one host. Duplicate local/runtime IDs could therefore persist order through the wrong catalog. Capture the source group and host when the drag starts, then carry both to the project-group mutation.
6c10780 to
972ffba
Compare
|
@LuisUrrutia is this still in progress? It still reproduces on v1.4.224, after #27288 landed. With a local #27288 rewrote most of the files this PR touches, so it probably needs a rebase. I have a much smaller change on current
|




ELI5
Grouping a project owned by a paired Orca server used to depend on the global Active Server setting. If Active Server was set to Local, creating or moving that remote project into a group could appear to work while leaving it ungrouped.
Group actions now follow the selected project's owner. The menu offers only compatible groups, names the catalog when more than one is visible, and reports an error when the owner cannot confirm the action.
What Changed
Localor the paired server's display name. Single-catalog menus keep the shorterMove to grouplabel.Why
The sidebar can show projects and groups from several Orca runtimes at once. Before this change, contextual group creation followed Active Server while moves followed the project's owner. A group ID created in the client catalog could then be sent to a paired server that had no such group.
The selected project already identifies the runtime that owns the mutation, so contextual actions now use that owner. Active Server remains the fallback for operations without project context.
Direct SSH projects execute on another machine but store their groups in the client catalog. Treating the physical SSH host as the catalog owner broke compatible moves and delete cleanup. The implementation now follows storage ownership for routing while preserving physical-host identity when deduplicating concurrent create responses.
Linked Issue
Related to #10755
Visual Proof
Before:
scriptsandtoolingstayed ungrouped after being moved intoREMOTE GROUP. The remotemonorepomenu also offered the client-ownedLuisUrrutiagroup and the remote-ownedREMOTE GROUPwithout identifying their catalogs.After (
Localcatalog): the localskillsproject showsMove to group: Localand only offers the localLuisUrrutiagroup.After (
Workcatalog): the pairedtoolingproject showsMove to group: Workand only offersTEST, a group owned by that server.When the sidebar contains projects from one catalog, the label remains
Move to group.Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
git range-diff 1d1b73c40850a0e362186e0f0ec593cf613caa84..6c10780bda9fecc557efd798094512d79e6c4f40 upstream/main..HEAD: 9 commits remained patch-equivalent. Commits 1 and 11 retainedmain's create/refresh deduplication while adding the PR's owner routing and catalog fences.pnpm testwith the PR's focused files plusmain's project-group creation race suite: 18 files and 148 tests passed.pnpm tc: passed all TypeScript projects.pnpm run check:code-quality:changed: 0 new standard, type-aware, or React Doctor findings across 42 analyzed files.pnpm run build:desktop: passed typecheck, Linux/macOS/Windows relay builds for x64 and arm64, WSL relays, CLI, Electron, skill verification, and the web projection. The optional/usr/local/bin/orca-devsymlink reported a non-fatal permission warning.git diff --check upstream/main...HEAD: passed.macOS Electron CDP before this rebase verified the
LocalandWorklabels, catalog-filtered destinations, and unconfirmed-move toast. The rebase changed only the create/refresh race integration, which the focused tests cover. Native Linux and Windows runtime validation is left to PR CI.AI Disclosure
OpenAI Codex (GPT-5.6 Sol) diagnosed, implemented, reviewed, rebased, and tested the change.
Review
build:desktopcompiled every Linux, macOS, and Windows relay target.main's rule that same-ID Local and direct-SSH rows remain distinct.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Project groups remain catalog-owned. The branch does not introduce groups that span the client catalog and paired runtime hosts, and the catalog suffix appears only when multiple catalogs are visible.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)