Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/frontend/packages/swarm-ui/test/detail-sections.test.mjs
iris 7bdaea7954 swarm ui: agents page opens an agent's details beside the list
Selecting an agent card opens its details in a column on the right of the
agents list, at /agents/<name>, instead of unfolding the card in place. The
list is full width until an agent is selected, then narrows and the details
slide in. A narrow screen shows the details alone, with a back button. A
card's message is cut to one line.

The shell treats /agents/<name> as the agents page, so the nav tab stays lit
and the page is not rebuilt on each selection.
2026-11-22 18:58:05 +01:00

35 lines
977 B
JavaScript

// The sections an agent's details hold. Run by `npm test`, which Node runs
// with its built-in test runner and type stripping.
import assert from "node:assert/strict";
import { test } from "node:test";
import {
SECTION_TITLE,
sectionsFor,
startsOpen,
} from "../src/agent/detail/sections.ts";
test("a card holds status, terminal, open todos, subagents, background tasks, then settings", () => {
assert.deepEqual(sectionsFor(true), [
"status",
"terminal",
"todos",
"subagents",
"tasks",
"settings",
]);
});
test("a page beside a terminal leaves the terminal, todos, subagents and tasks out", () => {
assert.deepEqual(sectionsFor(false), ["status", "settings"]);
});
test("the status and the terminal start open", () => {
assert.deepEqual(sectionsFor(true).filter(startsOpen), [
"status",
"terminal",
]);
});
test("every section has a header", () => {
for (const s of sectionsFor(true)) assert.ok(SECTION_TITLE[s], s);
});