Skip to content

Commit a2be4ce

Browse files
committed
feat: always show destroy button for worktrees
- Show destroy button regardless of change status - Warn about uncommitted changes in confirmation modal - Restyle as subtle hollow archive icon button with red hover
1 parent 186a612 commit a2be4ce

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

frontend/src/lib/components/WorkspaceView.svelte

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,14 @@
134134
{/if}
135135
{#snippet right()}
136136
<AgentActions beanId={worktreeId} {agentBusy} />
137-
{#if isWorktree && hasNoChanges}
137+
{#if isWorktree}
138138
<button
139-
class={["btn-toggle ml-2 cursor-pointer border-danger/30 bg-danger/10 text-danger", agentBusy ? "opacity-50" : "hover:bg-danger/20"]}
139+
class={["btn-toggle ml-1 cursor-pointer border-border bg-transparent text-text-muted", agentBusy ? "opacity-50" : "hover:text-danger"]}
140140
title={agentBusy ? "Cannot destroy while agent is running" : "Destroy this worktree"}
141141
disabled={agentBusy}
142142
onclick={() => (confirmingDestroy = true)}
143143
>
144-
<span class="icon-[uil--trash-alt] size-4"></span>
145-
Destroy
144+
<span class="icon-[uil--archive] size-4"></span>
146145
</button>
147146
{/if}
148147
{/snippet}
@@ -161,9 +160,12 @@
161160

162161
{#if confirmingDestroy}
163162
{@const label = worktree?.name ?? worktreeId}
163+
{@const warning = hasNoChanges
164+
? `Are you sure you want to destroy the worktree for "${label}"? This cannot be undone.`
165+
: `The worktree "${label}" has uncommitted changes that will be lost. Are you sure you want to destroy it? This cannot be undone.`}
164166
<ConfirmModal
165167
title="Destroy Worktree"
166-
message={`Are you sure you want to destroy the worktree for "${label}"? This cannot be undone.`}
168+
message={warning}
167169
confirmLabel="Destroy"
168170
danger
169171
onConfirm={handleDestroy}

0 commit comments

Comments
 (0)