diff --git a/docs/web-ui/dashboard.md b/docs/web-ui/dashboard.md index b7051bcc..b9a2c4a5 100644 --- a/docs/web-ui/dashboard.md +++ b/docs/web-ui/dashboard.md @@ -919,7 +919,10 @@ fetch entirely. consulted; the fallback exists purely for the **`Pending` (queued, not yet started)** case, which `running_transients()`'s Running-only test cannot represent. `queuedOpsByAgent()` (swarm.js) - reflects this: it only ever looks at `Pending`-state queue nodes. + reflects this: it only ever looks at `Pending`-state queue nodes, + and (mara, on review) the badge shows the queue entry's raw `kind` + string as-is — no English-phrase lookup translating it first, same + opaque-string treatment a transient's own label already gets. `opRunning` (driving the `pending-running` row class + spinner) is simply "does this agent have at least one transient" — a queued-only entry (no transient yet) leaves it false. diff --git a/frontend/packages/dashboard/src/swarm.js b/frontend/packages/dashboard/src/swarm.js index 04bfe0a1..beff26ab 100644 --- a/frontend/packages/dashboard/src/swarm.js +++ b/frontend/packages/dashboard/src/swarm.js @@ -68,14 +68,20 @@ export function applyRebuildQueueChanged(ev) { // See docs/web-ui.md::Container row for the badge taxonomy. renderContainersFromState(); } -// Map from agent name -> the queued op ({ kind }) backing the SW4RM -// card's " queued" badge. Pending only — every *running* node -// naming an agent already lights a transient pill (any running node, -// not just a curated "worth it" subset — see docs/web-ui.md::Container -// row), so a Running entry here would always be redundant with -// `transientsState` by the time this is consulted. Queued (not yet -// started) work is the one state transients can't represent, since -// `running_transients()` on the backend is a Running-only test. +// Map from agent name -> the queued op's raw `kind` string, backing +// the SW4RM card's fallback pending badge. Pending only — every +// *running* node naming an agent already lights a transient pill (any +// running node, not just a curated "worth it" subset — see +// docs/web-ui.md::Container row), so a Running entry here would +// always be redundant with `transientsState` by the time this is +// consulted. Queued (not yet started) work is the one state +// transients can't represent, since `running_transients()` on the +// backend is a Running-only test. +// +// The returned `kind` is displayed as-is (mara, on review: "drop +// queuedLabelFor - just show what the backend sends") — same opaque- +// string treatment `pending`'s transient half already gets, no +// English-phrase lookup table translating it first. // // Agent is per-node, not per-DAG (a DAG can span agents — e.g. the // startup sweep's MetaLock cascade, or a hive-wide restart), so this @@ -95,25 +101,11 @@ function queuedOpsByAgent() { if (!n.agent || n.state !== 'Pending') continue; // First entry found wins — with only one state to consider // (Pending), there's no priority to resolve between DAGs. - if (!out.has(n.agent)) out.set(n.agent, { kind: e.kind }); + if (!out.has(n.agent)) out.set(n.agent, e.kind); } } return out; } -// " queued" text for the queuedOpsByAgent fallback badge. Only -// ever applies to this fallback — a transient's own kind is an opaque -// wire tag (docs/web-ui.md::Container row) displayed as-is, never -// run through a lookup like this one. -function queuedLabelFor(kind) { - return kind === 'meta_update' ? 'meta-update queued' - : kind === 'destroy' ? 'destroy queued' - : kind === 'restart' ? 'restart queued' - : kind === 'start' ? 'start queued' - : kind === 'stop' ? 'stop queued' - : kind === 'graceful_stop' ? 'stop queued' - : kind === 'reconcile' ? 'reconcile queued' - : 'rebuild queued'; -} // ─── transients ───────────────────────────────────────────────────────────── @@ -706,10 +698,10 @@ export function renderContainers(s) { // order is insertion order, which shifts as pills clear/re-add. const transientKinds = transientKindsMap ? Array.from(transientKindsMap.keys()).sort() : []; - const queuedOp = transientKinds.length === 0 ? queuedOps.get(c.name) : null; + const queuedKind = transientKinds.length === 0 ? queuedOps.get(c.name) : null; const pending = transientKinds.length > 0 ? transientKinds - : (queuedOp ? [queuedLabelFor(queuedOp.kind)] : []); + : (queuedKind ? [queuedKind] : []); const opRunning = transientKinds.length > 0; const selected = selectionState.has(c.name); // Pending questions where this agent is the asker (awaiting an