From 2ff4cddf9dcc50ee469916d9459bd97349548724 Mon Sep 17 00:00:00 2001 From: iris Date: Mon, 3 Aug 2026 18:29:08 +0200 Subject: [PATCH] =?UTF-8?q?frontend:=20hive-warn=20=E2=80=94=20replace=20s?= =?UTF-8?q?everity+pulse=20with=20info/warning/error=20levels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mara, PR review: "i dont like that they still have different styling. if anything, there should be distinction between info,warning,error (semantics). all warnings should be styled identically." Replaces the severity ('amber'|'red') + standalone pulse boolean with a single level ('info'|'warning'|'error') attribute -- a fixed three-tier ladder instead of an open combination. Colours reuse theme.css's own already-documented semantics rather than inventing new ones: --cyan is already "info accents", --amber already "warnings", --red already "errors, fail state". Pulse is now baked into `error` specifically rather than a separate opt-in knob, since the one call site that wanted attention-grabbing (an active incident) is also the one that's semantically error -- tying the two together removes a combination that shouldn't exist independently of the tier. Reclassified the three call sites explicitly (no implicit default relied on): credentials.html's GitHub PAT advisory and core.js's K3PT ST4T3 caveat are both `level="warning"` (same as before, and now identical to each other by construction, not by coincidence); swarm.js's port-collision banner is `level="error"` (an active incident needing operator action now, not a standing caveat). npm run build clean both packages, grepped for leftover severity/pulse references (only prose mentions describing what this replaces). --- frontend/packages/dashboard/src/core.js | 2 +- .../packages/dashboard/src/credentials.html | 2 +- frontend/packages/dashboard/src/swarm.js | 2 +- .../shared/src/hive-warn/hive-warn.css | 44 ++++++++++--------- .../shared/src/hive-warn/hive-warn.js | 20 +++++---- 5 files changed, 39 insertions(+), 31 deletions(-) diff --git a/frontend/packages/dashboard/src/core.js b/frontend/packages/dashboard/src/core.js index f0bc9e8f..457f2236 100644 --- a/frontend/packages/dashboard/src/core.js +++ b/frontend/packages/dashboard/src/core.js @@ -50,7 +50,7 @@ function renderTombstones(s) { // Wording is deliberately about what the list *is* rather than what it // isn't: nothing records a destroy, so "container absent" is the only thing // the backend can actually tell. - const warn = el('hive-warn', {}); + const warn = el('hive-warn', { level: 'warning' }); warn.append( el('strong', {}, 'shows every agent whose container is absent'), ' — not only destroyed ones. An agent part-way through being spawned ' + diff --git a/frontend/packages/dashboard/src/credentials.html b/frontend/packages/dashboard/src/credentials.html index 98042d12..d4d14f26 100644 --- a/frontend/packages/dashboard/src/credentials.html +++ b/frontend/packages/dashboard/src/credentials.html @@ -90,7 +90,7 @@ Security-warning banner + a link to generate a PAT. -->