Skip to content

Add Always force delete dropdown to the workspace deletion dialog - #26476

Merged
nwparker merged 1 commit into
mainfrom
nwparker/force-delete-dialog-dropdown
Oct 8, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/force-delete-dialog-dropdown

Conversation

@nwparker

@nwparker nwparker commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

The workspace deletion dialog now offers the same Force Delete arrow menu as the failure toast. Choose Force Delete to retry once, or Always force delete to remember the choice for future deletions.

What Changed

The dialog reuses the existing split-button component, keeping its normal button size, trash icon, and initial keyboard focus. The menu includes Always force delete and the tooltip “Applies to all future workspace deletions.” It writes the existing hidden user preference through the durable settings handler before retrying. Cancel, Escape, and other dismissal attempts are blocked while saving; if saving fails, the dialog remains available for retry.

Why

Previously, reopening a failed workspace deletion showed a plain Force Delete button without the saved preference option. Reusing the toast control keeps both recovery surfaces consistent without duplicating menu or persistence logic.

Linked Issue

Internal maintainer-requested follow-up to #26425; no existing issue. The maintainer exception applies.

Visual Proof

Captured with the visual-proof and electron skills in an isolated, hidden macOS Electron instance after a real dirty-worktree deletion failure.

Before:

Plain Force Delete button

After:

Force Delete split button

Menu and tooltip:

Always force delete menu in the dialog

Testing

  • Manually tested in hidden macOS Electron: real deletion failure, menu and tooltip, Escape closes only the menu, one-time retry leaves preference off, saved-choice retry persists the preference and deletes the workspace; the preference remains enabled after a full app restart.
  • Simulated delayed/rejected save: Cancel disabled, Escape keeps the dialog open, save error leaves retry enabled.
  • 29 focused tests pass across the dialog, footer, toast, and preference suites. Four new footer tests cover one-time retry, save-before-delete ordering, save failure, and disabled deletion controls.
  • Full pnpm tc and pnpm run check:code-quality:changed pass. The background Electron dev build succeeds.
  • CI passes static analysis, typecheck, all ten test shards, relay integration, Linux/Windows packaging, test-selection evidence, and final verification.
  • Rendered validation was on macOS; Linux, Windows, and SSH were not exercised interactively. The existing host-qualified retry and folder-workspace rules are unchanged.

Review

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer material copied.

Checklist

  • This PR is small and focused
  • Explained the user-facing change, mechanism, and approach
  • Before/after visual proof attached
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and workspace handling considered
  • Focused tests, full typecheck, changed-code quality, and background Electron build pass; all CI checks are green

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 79081c0a-aba3-4b07-a6db-167c1628b125
📥 Commits

Reviewing files that changed from the base of the PR and between 10ac420 and b335645.

📒 Files selected for processing (4)
  • src/renderer/src/components/sidebar/DeleteWorktreeDialog.tsx
  • src/renderer/src/components/sidebar/DeleteWorktreeDialogFooter.test.tsx
  • src/renderer/src/components/sidebar/DeleteWorktreeDialogFooter.tsx
  • src/renderer/src/components/sidebar/WorktreeForceDeleteButton.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The force-delete button now supports configurable size, disabled state, button ref, children, optional toast dismissal, and saving-state notifications. The footer uses the button for available force-delete actions and updates the shared preference for the always-force-delete action. The dialog tracks preference saving, blocks closing while saving, and includes saving in the footer’s deleting state. New tests cover button actions, preference-save outcomes, saving notifications, and disabled controls.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to b3356

The saved-choice action waits for the preference save before retrying deletion, and the dialog remains open while saving. No issue identified here prevents merging after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the main change: adding an Always force delete dropdown to the workspace deletion dialog.
Description check ✅ Passed The description covers the user-facing change, implementation approach, reason, linked issue context, visual proof, testing, platform scope, and checklist items. The Notes section is omitted, but the …
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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.

@nwparker

nwparker commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Reviewed the CodeRabbit report: it found no actionable code issues. The docstring-coverage warning conflicts with this repository’s AGENTS.md instruction to use only concise comments for non-obvious behavior, rather than narrating functions. The shared save-before-delete flow and focus handling are covered by the existing comments, 29 focused tests, and rendered Electron checks, so no blanket docstrings were added.

@nwparker
nwparker merged commit 952898b into main Oct 8, 2026
35 checks passed
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