diff --git a/dev-dashboard/frontend/src/App.svelte b/dev-dashboard/frontend/src/App.svelte index 7ad0108e28..2ddb228277 100644 --- a/dev-dashboard/frontend/src/App.svelte +++ b/dev-dashboard/frontend/src/App.svelte @@ -16,7 +16,7 @@ let worktrees = $state([]); let selectedBranch = $state(null); - let showConfirmRemove = $state(false); + let removeBranch = $state(null); let showCreateDialog = $state(false); let creating = $state(false); let removing = $state(false); @@ -63,12 +63,12 @@ } async function handleRemove() { - if (!selectedBranch) return; + if (!removeBranch) return; removing = true; try { - await api.removeWorktree(selectedBranch); - showConfirmRemove = false; - selectedBranch = null; + await api.removeWorktree(removeBranch); + if (selectedBranch === removeBranch) selectedBranch = null; + removeBranch = null; await refresh(); } catch (err) { alert(`Failed to remove: ${err instanceof Error ? err.message : err}`); @@ -95,14 +95,14 @@ title="New Worktree" >+ New - (selectedBranch = b)} /> + (selectedBranch = b)} onremove={(b) => (removeBranch = b)} />
(showConfirmRemove = true)} + onremove={() => { if (selectedBranch) removeBranch = selectedBranch; }} /> {#if canConnect} @@ -161,11 +161,11 @@
(showCreateDialog = false)}>
{/if} -{#if showConfirmRemove} +{#if removeBranch} (showConfirmRemove = false)} + oncancel={() => (removeBranch = null)} /> {/if} diff --git a/dev-dashboard/frontend/src/lib/WorktreeList.svelte b/dev-dashboard/frontend/src/lib/WorktreeList.svelte index 9798295a50..b4d009b0a6 100644 --- a/dev-dashboard/frontend/src/lib/WorktreeList.svelte +++ b/dev-dashboard/frontend/src/lib/WorktreeList.svelte @@ -1,10 +1,11 @@