Files
archie/ui/test/setup-panel.test.ts
T
sam 4f90b97a86 feat(webui): compact quality gates card, drop the setup celebration, hover nav
Three dashboard refinements from operator feedback:

The setup panel's completed state was celebration prose -- a full card
saying setup was done, occupying a grid cell until dismissed. A
configured daemon is the absence of a problem: the state machine now
only distinguishes incomplete from omit, the checklist returns on its
own if setup regresses, and the dismissal machinery is deleted with it.

'Gate pulse' led with a donut whose entire payload was one number, and
the name was decoration too. The card is 'Quality gates' now: the pass
rate as the number itself beside its run count, per-workflow rows as
tight hairline rows instead of muted pills, and the parked line is gone
-- Throughput's Needs-you tile already speaks for parked tasks, from the
statuses themselves. base/Gauge.vue had no other consumer and is deleted.

Topbar nav groups open on hover and close on leave, with a short grace
period bridging the trigger-to-content gap; click and keyboard
activation keep working through the same controlled open state.

The live activity feed scrolls within its card (previous commit); the
health row's cards are now compact enough to match it.
2026-09-23 14:53:40 +10:00

39 lines
1.5 KiB
TypeScript

import assert from "node:assert/strict";
import test from "node:test";
const { setupPanelState } = await import("../src/dashboard/setup-preference.ts");
import type { Setup } from "../src/dashboard/setup-preference.ts";
function setupWith(...done: boolean[]): Setup {
return { steps: done.map((d, i) => ({ title: `step ${i}`, done: d })) };
}
type Setup = ReturnType<typeof setupWith>;
// The completed setup renders no panel: a configured daemon is the absence of
// a problem, not a card announcing it. The state machine only distinguishes
// "nothing to show" from "there is work left".
test("no setup steps omits the panel", () => {
assert.equal(setupPanelState(null).kind, "omit");
assert.equal(setupPanelState(setupWith()).kind, "omit");
});
test("remaining steps render the checklist", () => {
const state = setupPanelState(setupWith(true, false, false));
assert.equal(state.kind, "incomplete");
assert.equal(state.remaining.length, 2);
});
// The old contract celebrated completion with a "Setup complete" card the
// operator had to dismiss. The celebration is gone: all steps done is omit.
test("a fully completed setup omits the panel", () => {
assert.equal(setupPanelState(setupWith(true, true)).kind, "omit");
});
// If setup later becomes incomplete again, the checklist returns regardless
// of anything the operator did while it was complete.
test("the checklist returns when setup regresses", () => {
const state = setupPanelState(setupWith(true, false));
assert.equal(state.kind, "incomplete");
assert.equal(state.remaining.length, 1);
});