From 5d36f4ea88462c82b457a74d2d0eed4382bc8654 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Tue, 27 Jan 2026 03:53:08 +0000 Subject: [PATCH 1/3] fix: use --force by default when deleting worktrees --- webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx b/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx index 3f40c73ff6..aa386d77cd 100644 --- a/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx +++ b/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx @@ -18,7 +18,7 @@ export const DeleteWorktreeModal = ({ open, onClose, worktree, onSuccess }: Dele const { t } = useAppTranslation() const [isDeleting, setIsDeleting] = useState(false) - const [forceDelete, setForceDelete] = useState(false) + const [forceDelete, setForceDelete] = useState(true) const [error, setError] = useState(null) useEffect(() => { From b64718d8095a9e9046ea31e2dbe626e4e95a651c Mon Sep 17 00:00:00 2001 From: Roo Code Date: Tue, 27 Jan 2026 03:57:46 +0000 Subject: [PATCH 2/3] refactor: remove redundant isLocked checkbox since force delete is always enabled --- .../worktrees/DeleteWorktreeModal.tsx | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx b/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx index aa386d77cd..5ed2ca6ac8 100644 --- a/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx +++ b/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx @@ -4,7 +4,7 @@ import type { Worktree } from "@roo-code/types" import { vscode } from "@/utils/vscode" import { useAppTranslation } from "@/i18n/TranslationContext" -import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, Button, Checkbox } from "@/components/ui" +import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, Button } from "@/components/ui" import { Folder, GitBranch, TriangleAlert } from "lucide-react" interface DeleteWorktreeModalProps { @@ -18,7 +18,6 @@ export const DeleteWorktreeModal = ({ open, onClose, worktree, onSuccess }: Dele const { t } = useAppTranslation() const [isDeleting, setIsDeleting] = useState(false) - const [forceDelete, setForceDelete] = useState(true) const [error, setError] = useState(null) useEffect(() => { @@ -47,9 +46,9 @@ export const DeleteWorktreeModal = ({ open, onClose, worktree, onSuccess }: Dele vscode.postMessage({ type: "deleteWorktree", worktreePath: worktree.path, - worktreeForce: forceDelete, + worktreeForce: true, }) - }, [worktree.path, forceDelete]) + }, [worktree.path]) return ( !isOpen && onClose()}> @@ -90,23 +89,6 @@ export const DeleteWorktreeModal = ({ open, onClose, worktree, onSuccess }: Dele - {/* Force delete option (if worktree is locked) */} - {worktree.isLocked && ( -
- setForceDelete(checked === true)} - /> - -
- )} - {/* Error message */} {error && (
From 91fcff160816e3935d4c127e7ffe60575a91e8de Mon Sep 17 00:00:00 2001 From: Roo Code Date: Tue, 27 Jan 2026 04:00:17 +0000 Subject: [PATCH 3/3] refactor: always force delete unless worktree is locked --- .../worktrees/DeleteWorktreeModal.tsx | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx b/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx index 5ed2ca6ac8..9e3f4802d5 100644 --- a/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx +++ b/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx @@ -4,7 +4,7 @@ import type { Worktree } from "@roo-code/types" import { vscode } from "@/utils/vscode" import { useAppTranslation } from "@/i18n/TranslationContext" -import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, Button } from "@/components/ui" +import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, Button, Checkbox } from "@/components/ui" import { Folder, GitBranch, TriangleAlert } from "lucide-react" interface DeleteWorktreeModalProps { @@ -18,6 +18,7 @@ export const DeleteWorktreeModal = ({ open, onClose, worktree, onSuccess }: Dele const { t } = useAppTranslation() const [isDeleting, setIsDeleting] = useState(false) + const [forceDeleteLocked, setForceDeleteLocked] = useState(false) const [error, setError] = useState(null) useEffect(() => { @@ -43,12 +44,15 @@ export const DeleteWorktreeModal = ({ open, onClose, worktree, onSuccess }: Dele setError(null) setIsDeleting(true) + // Always force delete unless worktree is locked and user hasn't opted in + const shouldForce = worktree.isLocked ? forceDeleteLocked : true + vscode.postMessage({ type: "deleteWorktree", worktreePath: worktree.path, - worktreeForce: true, + worktreeForce: shouldForce, }) - }, [worktree.path]) + }, [worktree.path, worktree.isLocked, forceDeleteLocked]) return ( !isOpen && onClose()}> @@ -89,6 +93,23 @@ export const DeleteWorktreeModal = ({ open, onClose, worktree, onSuccess }: Dele
+ {/* Force delete option (only shown if worktree is locked) */} + {worktree.isLocked && ( +
+ setForceDeleteLocked(checked === true)} + /> + +
+ )} + {/* Error message */} {error && (