Repository navigation
Add saved force-delete preference to workspace deletion menu - #26425
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:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📥 CommitsReviewing files that changed from the base of the PR and between cba95f1 and 894416b1190eb4ab8526f9994178ad3e8048e22c. 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughAdds an Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The durable-write correction appears ready to merge after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f6259d60-5f0e-40a1-920b-f417571e1cd9
📥 Commits
Reviewing files that changed from the base of the PR and between 00a8250 and 977e055491597dd0300e2f50f5a31f44d582a9ce.
📒 Files selected for processing (12)
src/renderer/src/components/settings/AlwaysForceDeleteWorkspacesSetting.tsxsrc/renderer/src/components/settings/GeneralWorkspaceSettingsSection.tsxsrc/renderer/src/components/settings/general-search.tssrc/renderer/src/components/sidebar/delete-worktree-always-force-preference.test.tsxsrc/renderer/src/components/sidebar/delete-worktree-failure-toast.tsxsrc/renderer/src/components/sidebar/run-worktree-delete-with-toast.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/store/slices/worktrees-always-force-delete.test.tssrc/renderer/src/store/slices/worktrees/teardown/remove-worktree.tssrc/renderer/src/store/slices/worktrees/teardown/worktree-removal-preference.tssrc/shared/default-global-settings.tssrc/shared/global-settings-types.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
977e055 to
27f19e4
Compare
|
Reviewed the bot’s remaining pre-merge warnings: this is an internal maintainer-requested change (the author is an organization MEMBER), so the PR template’s maintainer exception applies and no placeholder issue is needed. Blanket docstrings would conflict with AGENTS.md’s requirement for concise, non-obvious comments only; the changed behavior and validation are documented in the PR body. The actionable durable-write finding has been fixed and covered by persistence, IPC, and toast tests. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f435df33-0ed2-4fbc-86e7-c4aeb8fb1c44
📒 Files selected for processing (4)
src/main/ipc/settings.test.tssrc/main/ipc/settings.tssrc/main/persistence/loading-store/durable-settings-write.test.tssrc/main/persistence/loading-store/profile-preferences.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.
9c4fdfe to
7f286f1
Compare
7f286f1 to
141ce66
Compare
ELI5
When a workspace cannot be deleted normally, Force Delete now has an arrow menu with “Always force delete.” Choosing it deletes the current workspace and remembers the choice for future deletions.
What Changed
The existing ButtonGroup and DropdownMenu primitives form a split button: the main button deletes once, and the arrow opens the saved preference action. Its tooltip says “Applies to all future workspace deletions.” The preference is saved before retrying; a save failure leaves the recovery toast available. The settings handler awaits the existing durable SQLite mutation, rolls back failed writes while preserving unrelated concurrent edits, and notifies other windows only after commit.
The optional
alwaysForceDeleteWorktreesuser preference defaults to false and uses Orca’s existing persisted profile configuration. It has no Settings control. The shared deletion path applies it for local and SSH workspaces, including terminal-stop verification failures, while preserving host routing, archive-hook handling, lock handling, and metadata-only forget behavior.Toasts now inherit the app’s tooltip provider. Menu focus stays within the portaled menu instead of triggering Sonner’s toast focus restoration.
Why
The split button keeps one-time deletion direct and puts the persistent choice one click away. Reusing existing controls and configuration avoids a separate preference store or a Settings entry the user does not need.
Linked Issue
Internal maintainer-requested change (author is an organization member); the template’s maintainer exception applies. No existing issue.
Visual Proof
Captured in a hidden, background macOS Electron instance with a disposable dirty worktree, using the visual-proof and electron skills.
Before:
After:
Menu and tooltip:
Testing
pnpm tc, changed-code quality, localization catalog checks, and Electron build pass locally.Review
Agent skill upstream boundary
Checklist