Repository navigation
fix(sidebar): explain a same-path delete refusal in the user's terms - #15178
brennanb2025 wants to merge 1 commit into
Conversation
The refusal said 'Workspace identity is ambiguous across hosts. Refresh projects and try again.' — implementation vocabulary, and the remedy does not work: refreshing cannot disambiguate two real checkouts, and the View action opens the diff by an id both machines share. Say what happened to their workspace, confirm nothing was lost, and give the one step that does resolve it. Verified: removing the checkout on the machine clears the collision on the next scan, with no orphaned row.
📝 WalkthroughWalkthroughThe change adds detection for worktree removal errors caused by the same workspace path existing on multiple hosts. Deletion toasts now explain that no data was deleted, provide direct-removal guidance, and mark the result as non-destructive. The failure toast hides the “View” action for ambiguous-host errors. English localization adds messages for running terminals and multi-host workspace paths. Merge Risk: ⚪ Minimal · up to The change is limited to clearer delete-refusal messaging and hiding an unusable action; reported typecheck, localization, and sidebar tests pass, and no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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.
🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/delete-worktree-toast.ts (1)
23-35: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd regression coverage for the ambiguous-host branch.
Test
getDeleteWorktreeToastCopywith the ambiguous-host marker. AssertisDestructive: falseand the localized fallback copy. Also testshowDeleteWorktreeFailureToastinsrc/renderer/src/components/sidebar/delete-worktree-failure-toast.tsxto verifytoast.infois used and theViewaction is hidden.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2663a7b2-5346-4541-a75f-606f2044d613
📒 Files selected for processing (4)
src/renderer/src/components/sidebar/delete-worktree-failure-toast.tsxsrc/renderer/src/components/sidebar/delete-worktree-toast.tssrc/renderer/src/i18n/locales/en.jsonsrc/shared/worktree/removal.ts
Included review availability: Your plan includes up to 10 reviews per rolling hour; 8 remain after this review.
Fixes the wording a user sees when Orca refuses to delete a workspace that exists at the same path on two machines.
Before
Three problems:
Viewopens the workspace diff by id — and an id both machines share cannot pick one, so the button either does nothing useful or opens the other machine's changes.After
Viewis hidden for this case. The toast is nowisDestructive: false, so it renders as info rather than a destructive error — nothing was lost.The remedy is verified, not assumed
Removing the checkout on the machine clears the collision on Orca's next scan, leaving no orphaned row and needing no Force Delete. I tested that before putting it in shipped copy.
Scope
Copy and the
Viewgate only — no routing behaviour changes. The refusal itself is pre-existing onmain; routing a colliding delete to the confirmed host is #15013.Known, not addressed here: after a refusal the row stays greyed out reading "Deleting…" indefinitely (
isDeletingis never cleared). That reproduces onmaintoday, and since the toast auto-dismisses after 10s, the stuck row is what the user is ultimately left with. Worth its own fix.Verification
typecheck 0 · changed-code quality 0 findings · localization coverage passed · sidebar suite 250 files / 2,193 tests green · copy confirmed in a live dev instance (screenshot above).