From 29c94ea9e6f4cf4ea497f6a7e940fc0077ef7ea1 Mon Sep 17 00:00:00 2001 From: iris Date: Mon, 7 Sep 2026 19:11:50 +0200 Subject: [PATCH] swarm-ui: disable the wanted-toggle badge on a destroyed row argus, review: the primary wanted-toggle badge still had no wanted === "destroyed" guard, so it stayed clickable on a destroyed row and would PUT {state: "up"} on click -- directly contradicting the destroy confirm dialogs own "not reversible from here" copy. Missed this in the previous fix-up (which only addressed the ConfirmDialog-for-stop ask). Added the guard to both the click handler and disabled, plus a title explaining why on a destroyed row. --- .../swarm-ui/src/pages/AgentsPage.tsx | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/packages/swarm-ui/src/pages/AgentsPage.tsx b/frontend/packages/swarm-ui/src/pages/AgentsPage.tsx index b24cc6a9..6da04c0a 100644 --- a/frontend/packages/swarm-ui/src/pages/AgentsPage.tsx +++ b/frontend/packages/swarm-ui/src/pages/AgentsPage.tsx @@ -329,17 +329,27 @@ export function AgentsPage() { // Already destroyed, or nothing to destroy against — same guard // shape as the wanted toggle's own `!a.hive` check. const destroyable = a.hive && a.wanted !== "destroyed"; + const destroyed = a.wanted === "destroyed"; return ( <> void toggleWanted(a) : undefined} - disabled={pending || !a.hive} + // `destroyed` blocks the click too, not just the label — + // argus caught this in review: without it, a click here + // still computed `target = "up"` and PUT a live + // declaration on a destroyed row, contradicting the + // destroy confirm's own "not reversible from here" copy. + onClick={ + a.hive && !destroyed ? () => void toggleWanted(a) : undefined + } + disabled={pending || !a.hive || destroyed} title={ - a.hive - ? `click to ${actionLabel} ${a.name}` - : "no hive on record for this agent — nothing to declare against" + destroyed + ? `${a.name} is destroyed — redeploy via "+ agent" to bring it back` + : a.hive + ? `click to ${actionLabel} ${a.name}` + : "no hive on record for this agent — nothing to declare against" } /> {destroyable ? (