Repository navigation
fix(project-groups): say so when a project cannot join a group on another host - #30127
Conversation
…ther host A project's group membership is stored on the project's own host, and that host stores a group id it does not hold as 'no group' while still returning the row. Moving a remote-only project into a local group (menu or drag) therefore looked successful, and could even take it out of its current group. The store now refuses a move into a group that only exists in another host's catalog, and reports failure when the host answers with the group cleared. Refs #13699
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
🧹 Nitpick comments: 1
src/renderer/src/store/slices/repos-project-group-cross-host-move.test.ts: 1
87-99: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the cross-host toast payload.
moveProjectToGroupsupplies both the title and description for this refusal. This test checks only thattoast.errorwas called, so it would pass if either user-facing message changed or the description was removed.Suggested fix
expect(store.getState().repos).toEqual([remoteRepo]) expect(toast.error).toHaveBeenCalledTimes(1) + expect(toast.error).toHaveBeenCalledWith('Could not move project to group', { + description: + 'The computer this project runs on does not have this group. A project can only join groups saved on its own computer.' + })
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
6c77fb20-3881-4289-a5c7-e1db910173e5
📒 Files selected for processing: 9
src/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/store/project-groups/project-group-mutations.tssrc/renderer/src/store/slices/project-group-owner-routing.tssrc/renderer/src/store/slices/repos-project-group-cross-host-move.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
… rebasing onto main - isProjectGroupJoinableFromCatalog (stablyai#30127) reuses catalogHostIdFor instead of a second copy. - The card menu's host-aware repo and group lookup moves to use-worktree-menu-project-groups.ts so the menu model stays under max-lines. - The menu test fixture gains unifiedTabsByWorktree, which main's sleep check now reads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ELI5
A project can only join a group that is saved on the same computer as the project. When you dragged a remote-only project onto one of this computer's groups (or picked it from a menu), Orca acted as if it worked, but the project stayed where it was, and could even drop out of the group it was already in. Now Orca refuses the move and tells you why.
What Changed
Before: with a paired server, dragging a project that only lives on the server onto a group saved on this Mac (or choosing that group from Move to group) showed no error. The project stayed ungrouped. If it was already in a server group, the server took it out of that group too.
After: the move is not sent. A toast says "Could not move project to group: The computer this project runs on does not have this group. A project can only join groups saved on its own computer." The project keeps its current group.
Mechanism:
project-group-owner-routing.ts: newisProjectGroupJoinableFromCatalog(projectGroups, groupId, catalog). It returns false only when the group is known to this window and every copy of it lives in a different catalog than the project (this app's IPC catalog forlocaland directssh:projects, the paired server's catalog forruntime:projects). Unknown ids still go through, so a freshly created group is never blocked.project-group-mutations.ts(moveProjectToGroup): refuses such a move with the toast before any IPC or RPC. This covers every caller: drag-and-drop, both Move to group menus, and New group from project.falseinstead oftrue.groupId: null) is unchanged.Why
Root cause: group membership is
projectGroupIdon the project's own row, and each group lives in exactly one host catalog. The move is routed to the project's host (projectGroup.moveProject), and that host'smoveProjectToGroupturns a group id it does not know intonulland still returns a full row. The renderer treated any returned row as success.Alternatives considered:
Linked Issue
Refs #13699 (makes the silent failure visible and stops the accidental ungrouping; joining a group on another host is still not possible, so the issue stays open)
Visual Proof
Real Orca dev app (built from this branch, background launch, isolated profile). A runtime-hosted project in a server group, moved into a group saved on this Mac:
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
New
repos-project-group-cross-host-move.test.ts: a cross-host move is refused with a toast and sends nothing; a same-id copy on the project's host still moves; a host answer with the group cleared reports failure; removing from a group still succeeds. The refusal and the cleared-answer tests fail onmain.Ran
src/renderer/src/storeandsrc/renderer/src/i18n(456 files, single worker),pnpm tc, and the static-analysis job steps frompr.ymllocally, including the localization extraction and coverage checks.Verified live, on macOS only: the refusal path, through the store action that the drag and menu handlers call, in the real app with the seeded catalog shown above. Not verified live: the "host answered with the group cleared" path against a real paired server. That path is covered only by the unit test.
Review
Codex review (
gpt-6.1-sol, high): no findings.Agent skill upstream boundary
Notes
SSH: direct-SSH projects and their groups share this app's catalog, so moves between them are unaffected. Wire compatibility: nothing new is sent or published, and the check reads only the existing reply. Folder workspaces: not touched (they are not moved between groups by this action).
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)