Skip to content

fix(project-groups): say so when a project cannot join a group on another host - #30127

Merged
nwparker merged 1 commit into
mainfrom
nwparker/cross-host-move-to-group
Oct 17, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/cross-host-move-to-group

Conversation

@nwparker

@nwparker nwparker commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​137 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​137
Prod 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​66 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​59

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: new isProjectGroupJoinableFromCatalog(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 for local and direct ssh: projects, the paired server's catalog for runtime: 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.
  • After a move, if the host answers with the group cleared (it stores an id it does not hold as "no group" and still returns the row), the store keeps the host's row, shows the same toast and returns false instead of true.
  • Removing a project from its group (groupId: null) is unchanged.

Why

Root cause: group membership is projectGroupId on 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's moveProjectToGroup turns a group id it does not know into null and 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:

{"moved":false,"projectGroupId":"remote-group","rpcMethods":[]}
toasts ["Could not move project to group The computer this project runs on does not have this group. ..."]

after-b.png

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 on main.

  • Ran src/renderer/src/store and src/renderer/src/i18n (456 files, single worker), pnpm tc, and the static-analysis job steps from pr.yml locally, 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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

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

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

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

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

Project group moves now check whether the requested group is available on the project’s execution host. The mutation reports an error and returns false when the group is not joinable or the move response contains a different group ID. Tests cover cross-host rejection, a valid same-host move, a mismatched response, and group removal. Error messages were added in English, Spanish, French, Japanese, Korean, and Simplified Chinese.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 1e189

The change appears mergeable, but the new test would not catch a regression to the explanation users see when a cross-host move is refused.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (6 skipped: 6… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title is concise and clearly describes the main change: reporting when a project cannot join a group on another host.
Description check Passed The description is complete and covers the user impact, implementation, rationale, linked issue, visual proof, testing, compatibility considerations, and checklist items. It also identifies the untest…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is complete and covers the user impact, implementation, rationale, linked issue, visual proof, testing, compatibility considerations, and checklist items. It also identifies the untested live paired-server path.

Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (6 skipped: 6 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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/store/slices/repos-project-group-cross-host-move.test.ts: 1

87-99: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the cross-host toast payload.

moveProjectToGroup supplies both the title and description for this refusal. This test checks only that toast.error was 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
📥 Commits

Reviewing files that changed from the base of the PR and between d9a6143 and 1e1898f.

📒 Files selected for processing: 9
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/store/project-groups/project-group-mutations.ts
  • src/renderer/src/store/slices/project-group-owner-routing.ts
  • src/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.

@nwparker
nwparker merged commit 8a3dd28 into main Oct 17, 2026
31 checks passed
jbamlee added a commit to jbamlee/orca that referenced this pull request Oct 19, 2026
… 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]>
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.

1 participant