authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-12 22:53:41-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-02-12 22:57:56-08:00
log293f7b1507b694e10abd9030fa3dccf3635ab3c0
treeef8362b5c02b8f97149519793d672f647156539c
parent4f5eb3be4d973fdd89194f26caf685137496dbfb

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

1 files changed, 2 insertions(+), 1 deletions(-)

apps/web/src/components/Sidebar.tsx+2-1
...@@ -268,8 +268,9 @@ export default function Sidebar() {...@@ -268,8 +268,9 @@ export default function Sidebar() {
268 const displayWorktreePath = orphanedWorktreePath268 const displayWorktreePath = orphanedWorktreePath
269 ? formatWorktreePathForDisplay(orphanedWorktreePath)269 ? formatWorktreePathForDisplay(orphanedWorktreePath)
270 : null;270 : null;
271 const canDeleteWorktree = orphanedWorktreePath !== null && threadProject !== undefined;
271 const shouldDeleteWorktree =272 const shouldDeleteWorktree =
272 orphanedWorktreePath !== null &&273 canDeleteWorktree &&
273 (await api.dialogs.confirm(274 (await api.dialogs.confirm(
274 [275 [
275 "This thread is the only one linked to this worktree:",276 "This thread is the only one linked to this worktree:",