Repository navigation
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
📥 Commits
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
82bc647 to
2f9d268
Compare
…e's host Repo ids repeat across hosts, and useRepoById resolves on the active workspace's host, so a card menu opened on another host's workspace showed and moved the wrong host's project. The menu now looks its row up on the workspace's own host (runtime owner, else host stamp, else local). Co-Authored-By: Claude Opus 5.5 <[email protected]>
2f9d268 to
98c0724
Compare
ELI5
The same project can be added on two connected computers, and both copies can have the same id. A workspace card's right-click menu found its project by that id alone. So when you right-clicked a workspace from the other computer, the menu could show and change the project on the computer you were working on. Now it uses the project on the clicked workspace's own computer.
What Changed
Before: a Mac is paired with another Orca host, and both have the same project (same repo id). The paired host's row is in one of its groups; the Mac's row is not. With a Mac workspace active, the right-click menu of a paired-host workspace card:
After: the card menu reads the clicked workspace's own row. Remove from group shows, the current group is marked, and Move to group moves the paired host's row. A workspace from older local metadata with no host stamp uses this Mac's row.
Mechanism:
use-worktree-menu-repo.ts(useWorktreeMenuRepo): looks the row up withfindIndexedRepoOwnerForHoston the workspace's host. That is the runtime owner when there is one, otherwisegetWorktreeExecutionHostId(worktree, undefined)(the host stamp, or local). This is the same ruleWorktreeMetaDialogDraftuses.use-worktree-context-menu-model.tsxuses it instead ofuseRepoById, which resolves on the active workspace's host. Everything in the menu that reads the project uses the new row: group state, moves, and the Remove Project and Delete Worktree choices.Why
Root cause: repo ids repeat across hosts.
useRepoById(selectRepoByIdForActiveWorkspace) picks the row on the active workspace's host, and a card menu can be opened on any workspace, not only the active one.Alternatives considered:
Linked Issue
Fixes #30881
Split from #29863 at the maintainer's request.
Visual Proof
N/A: this changes which project row an existing menu reads. Nothing is drawn differently. The menu tests below use the real Radix context menu and check the rendered items and the store call.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
New
WorktreeContextMenu.move-to-group-host.test.tsx(real Radix menu, two rows with the same repo id):useRepoByIdlookup.WorktreeContextMenu.delete-shortcut.test.tsx: the fixture'sstate.reposnow holds the rows its cards name, since the menu reads the store's rows.pnpm test src/renderer/src/components/sidebar src/renderer/src/store/slices(7031 passed),pnpm tc,pnpm lint(full),pnpm run check:code-quality:changed.pnpm build: typecheck, the desktop bundles and the web client projection pass. Its mobile web bundle step needs amobile/install that this worktree does not have, so CI covers that step. This PR touches no mobile code.Platforms: macOS (unit tests). The change is renderer-only with no platform branches.
AI Disclosure
Implemented with Claude Code (Claude Opus 5.5). It carries over the card-menu part of #29863. That part was reviewed there by GPT-6 Astra (xhigh reasoning) through Codex CLI and by CodeRabbit; CodeRabbit's unstamped-workspace finding is covered by the second test.
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
ssh:<target>and resolves to that row; a managed or paired server's workspace resolves through its runtime owner.folder-workspace:<groupId>as their repo id, which no repo row has, so they find no row before or after.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code