diff --git a/frontend/packages/dashboard/src/agents.js b/frontend/packages/dashboard/src/agents.js index daa78905e..a9b032990 100644 --- a/frontend/packages/dashboard/src/agents.js +++ b/frontend/packages/dashboard/src/agents.js @@ -4,7 +4,7 @@ // job-queue-rollup ops. See docs/4-implementation/web-ui/dashboard.md::Container row for the // rendering contract. -import { $, form, fmtAgeSecs } from "./common.js"; +import { $, buttonClass, form, fmtAgeSecs } from "./common.js"; import { el } from "@hive/shared/dom.js"; import { themedConfirm, themedToast } from "@hive/shared/modal.js"; import { h, render } from "preact"; @@ -731,7 +731,7 @@ export function renderSelectionBar(containers) { return `${label} not available — ${blockers.join(", ")} ${blockers.length === 1 ? "is" : "are"} blocking it`; } - addBulkButton(actions, "btn-restart", "↺ R3ST4RT", allRunning, selected, { + addBulkButton(actions, "default", "↺ R3ST4RT", allRunning, selected, { action: "/api/restart/", confirm: (names) => `restart ${names.length} agent${names.length === 1 ? "" : "s"} (${names.join(", ")})?`, @@ -743,7 +743,7 @@ export function renderSelectionBar(containers) { stoppedNames.map((n) => `\`${n}\` is stopped`), ), }); - addBulkButton(actions, "btn-stop", "■ ST0P", allRunning, selected, { + addBulkButton(actions, "default", "■ ST0P", allRunning, selected, { action: "/api/kill/", confirm: (names) => `stop ${names.length} agent${names.length === 1 ? "" : "s"} (${names.join(", ")})?`, @@ -754,7 +754,7 @@ export function renderSelectionBar(containers) { stoppedNames.map((n) => `\`${n}\` is already stopped`), ), }); - addBulkButton(actions, "btn-start", "▶ ST4RT", allStopped, selected, { + addBulkButton(actions, "default", "▶ ST4RT", allStopped, selected, { action: "/api/start/", confirm: (names) => `start ${names.length} agent${names.length === 1 ? "" : "s"} (${names.join(", ")})?`, @@ -763,7 +763,7 @@ export function renderSelectionBar(containers) { runningNames.map((n) => `\`${n}\` is already running`), ), }); - addBulkButton(actions, "btn-pause", "⏸ P4US3", allUnpaused, selected, { + addBulkButton(actions, "default", "⏸ P4US3", allUnpaused, selected, { action: "/api/pause/", confirm: (names) => `pause ${names.length} agent${names.length === 1 ? "" : "s"} (${names.join(", ")})? parks the turn loop — inbox messages queue unacked.`, @@ -772,7 +772,7 @@ export function renderSelectionBar(containers) { pausedNames.map((n) => `\`${n}\` is already paused`), ), }); - addBulkButton(actions, "btn-resume", "▶ R3SUM3", allPaused, selected, { + addBulkButton(actions, "default", "▶ R3SUM3", allPaused, selected, { action: "/api/resume/", confirm: (names) => `resume ${names.length} agent${names.length === 1 ? "" : "s"} (${names.join(", ")})? the turn loop restarts and drains queued messages.`, @@ -781,17 +781,17 @@ export function renderSelectionBar(containers) { unpausedNames.map((n) => `\`${n}\` is not paused`), ), }); - addBulkButton(actions, "btn-rebuild", "↻ R3BU1LD", true, selected, { + addBulkButton(actions, "default", "↻ R3BU1LD", true, selected, { action: "/api/rebuild/", confirm: (names) => `rebuild ${names.length} agent${names.length === 1 ? "" : "s"} (${names.join(", ")})? hot-reloads each container.`, }); - addBulkButton(actions, "btn-destroy", "DESTR0Y", true, selected, { + addBulkButton(actions, "danger", "DESTR0Y", true, selected, { action: "/api/destroy/", confirm: (names) => `destroy ${names.length} agent${names.length === 1 ? "" : "s"} (${names.join(", ")})? containers are removed; state + creds kept.`, }); - addBulkButton(actions, "btn-destroy", "PURG3", true, selected, { + addBulkButton(actions, "danger", "PURG3", true, selected, { action: "/api/destroy/", body: { purge: "on" }, confirm: (names) => @@ -799,13 +799,13 @@ export function renderSelectionBar(containers) { }); } -function addBulkButton(parent, btnClass, label, enabled, selected, opts) { +function addBulkButton(parent, tone, label, enabled, selected, opts) { const names = selected.map((c) => c.name); const btn = el( "button", { type: "button", - class: "btn " + btnClass, + class: buttonClass(tone), }, label, ); diff --git a/frontend/packages/dashboard/src/common.css b/frontend/packages/dashboard/src/common.css index e548e8272..fa03f0b02 100644 --- a/frontend/packages/dashboard/src/common.css +++ b/frontend/packages/dashboard/src/common.css @@ -1,6 +1,7 @@ /* Shared Catppuccin palette + body typography + terminal pane styles. Bundled in front of the page-specific rules via esbuild. */ @import "@hive/shared/base.css"; +@import "@hive/shared/button.css"; @import "@hive/shared/terminal.css"; @import "@hive/shared/tabs.css"; /* Shared pill/chip/badge shape (the "extract pill component" issue, @@ -128,120 +129,6 @@ code { border-color: var(--amber); } -/* ─── buttons ─────────────────────────────────────────────────────── - .btn base + semantic colour/size modifiers. */ -.btn { - font-family: inherit; - font-weight: bold; - text-transform: uppercase; - letter-spacing: 0.1em; - background: transparent; - /* Strip browser UA button chrome (solid fill, system text colour). - Without this, native