Skip to content

Commit 1fb185e

Browse files
committed
fix: drop remove container only option
- Remove the "Remove container only" button from bot detail page; operators only need full Remove/Delete - Simplify `remove()` function to always delete config when removing a bot - Delete `confirmRemoveContainerOnlyPlan()` function; consolidate all removal logic into `confirmRemovePlan()` - Update documentation to reflect that Remove deletes both container and config in one step - Reduce UI complexity by eliminating the keep-config escape hatch that could lead to config-only zombie bots
1 parent 3d8cd5d commit 1fb185e

7 files changed

Lines changed: 27 additions & 64 deletions

File tree

.textile-monorepo-source

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d97ac1d0e126045bb1eac762e208098e5144da97
1+
bf58a6cebce223a65e6633df6b70136c7d6bfd63

.textile-stitch-release-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.211
1+
0.1.212

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "stitch-bot"
3-
version = "0.1.211"
3+
version = "0.1.212"
44
edition = "2021"
55
description = "Stitch — Textile filler-network operator bot; market-makes the filler order book with signed UniswapX limit orders."
66
license = "AGPL-3.0-or-later"

docs/install-panel.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,7 @@ create fails, or when someone removes the container and keeps the directory. Add
493493
Bot refuses that name; Recreate is the button. To drop it instead, use **Delete**
494494
on the fleet row (or on the bot page): that wipes the config and private key and
495495
takes the row off the fleet. **Remove** on a live bot deletes container + config
496-
in one step; Cancel aborts entirely. Keeping the files without a container is an
497-
explicit **Remove container only** action on the bot page, and it warns that the
498-
bot will stay on the fleet as config-only until you Delete or Recreate it.
496+
in one step; Cancel aborts entirely.
499497

500498
What doesn't change: **saving settings on a running bot restarts it.** Stitch reads
501499
its config once at startup, so there's no way to apply a spread change in place.

web/src/pages/BotDetail.tsx

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ import SettingsForm from '../components/SettingsForm'
1919
import StitchDashboardEmbed from '../components/StitchDashboardEmbed'
2020
import VersionRollback from '../components/VersionRollback'
2121
import { formatTimestamp, shortAddress, shortImage } from '../format'
22-
import {
23-
confirmRemoveContainerOnlyPlan,
24-
confirmRemovePlan,
25-
} from '../removeBot'
22+
import { confirmRemovePlan } from '../removeBot'
2623
import type { Bot, ConfigBody, MigrationResult, UpdatesStatus } from '../types'
2724

2825
const TABS = ['settings', 'dashboard', 'config', 'logs', 'tools'] as const
@@ -124,13 +121,14 @@ export default function BotDetail() {
124121
}
125122
}
126123

127-
async function remove(full: boolean) {
128-
const plan = full
129-
? confirmRemovePlan({ name, hasContainer: !!bot?.container })
130-
: confirmRemoveContainerOnlyPlan(name)
124+
async function remove() {
125+
const plan = confirmRemovePlan({
126+
name,
127+
hasContainer: !!bot?.container,
128+
})
131129
if (!plan) return
132130

133-
setBusy(full ? 'remove' : 'remove-container')
131+
setBusy('remove')
134132
setError(null)
135133
try {
136134
const res = await api.remove(name, plan.deleteConfig)
@@ -294,31 +292,19 @@ export default function BotDetail() {
294292
</>
295293
)}
296294
</div>
297-
<div className="flex w-full flex-col gap-2 sm:ml-auto sm:w-auto sm:flex-row sm:items-center">
298-
{bot.container && (
299-
<Button
300-
busy={busy === 'remove-container'}
301-
className="w-full sm:w-auto"
302-
onClick={() => void remove(false)}
303-
title="Destroy the container but leave config on disk — the bot stays on the fleet as config-only"
304-
>
305-
Remove container only
306-
</Button>
307-
)}
308-
<Button
309-
variant="danger"
310-
busy={busy === 'remove'}
311-
className="w-full sm:w-auto"
312-
onClick={() => void remove(true)}
313-
title={
314-
bot.container
315-
? 'Delete the container, config, and private key — gone from the fleet'
316-
: 'Delete config and private key — gone from the fleet'
317-
}
318-
>
319-
{bot.container ? 'Remove' : 'Delete'}
320-
</Button>
321-
</div>
295+
<Button
296+
variant="danger"
297+
busy={busy === 'remove'}
298+
className="w-full sm:ml-auto sm:w-auto"
299+
onClick={() => void remove()}
300+
title={
301+
bot.container
302+
? 'Delete the container, config, and private key — gone from the fleet'
303+
: 'Delete config and private key — gone from the fleet'
304+
}
305+
>
306+
{bot.container ? 'Remove' : 'Delete'}
307+
</Button>
322308
</div>
323309

324310
<dl className="mt-4 grid gap-3 text-sm sm:grid-cols-2 lg:grid-cols-4">

web/src/removeBot.ts

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@
88
export type RemovePlan = { deleteConfig: boolean } | null
99

1010
/**
11-
* Ask what to remove.
12-
*
13-
* - No container: one confirm, always deletes config (the only thing left).
14-
* - Has container: one confirm for a full delete (container + config + key).
15-
* Detail pages can also offer {@link confirmRemoveContainerOnlyPlan}.
11+
* Ask what to remove. Always deletes config (and the container when there is
12+
* one). Cancel aborts — nothing is removed.
1613
*/
1714
export function confirmRemovePlan(opts: {
1815
name: string
@@ -39,21 +36,3 @@ export function confirmRemovePlan(opts: {
3936
}
4037
return { deleteConfig: true }
4138
}
42-
43-
/**
44-
* Detail-only escape hatch: destroy the container, keep files on disk.
45-
*
46-
* The bot reappears on the fleet as config-only so Recreate can bring it back.
47-
* Explicit about that, because Cancel-means-keep on the main Remove path is how
48-
* operators ended up with zombies they couldn't see how to delete.
49-
*/
50-
export function confirmRemoveContainerOnlyPlan(name: string): RemovePlan {
51-
if (
52-
!window.confirm(
53-
`Remove ${name}'s container but keep its config and private key?\n\n${name} will stay on the fleet as config-only until you Delete it (or Recreate the container).`,
54-
)
55-
) {
56-
return null
57-
}
58-
return { deleteConfig: false }
59-
}

0 commit comments

Comments
 (0)