From 293f7b1507b694e10abd9030fa3dccf3635ab3c0 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 12 Feb 2026 22:53:41 -0800 Subject: [PATCH] Guard orphaned worktree deletion behind project context - Require both orphaned worktree path and thread project before prompting delete - Prevents delete confirmation when project metadata is unavailable --- apps/web/src/components/Sidebar.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index ae2b6fb66ae0c16c8df64aad4f91fbe0479b67fe..3b2382f9474c6a94984bfee21e3daecc7f85a6e0 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -268,8 +268,9 @@ export default function Sidebar() { const displayWorktreePath = orphanedWorktreePath ? formatWorktreePathForDisplay(orphanedWorktreePath) : null; + const canDeleteWorktree = orphanedWorktreePath !== null && threadProject !== undefined; const shouldDeleteWorktree = - orphanedWorktreePath !== null && + canDeleteWorktree && (await api.dialogs.confirm( [ "This thread is the only one linked to this worktree:", -- 2.54.0