Watch
0
0
Fork
You've already forked hyperhive
0

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.
This commit is contained in:
iris 2026-11-22 18:42:20 +01:00
commit 7bdaea7954

View file

@ -3,8 +3,11 @@ import assert from "node:assert/strict";
import { test } from "node:test";
import {
MOVED_ROUTES,
agentPath,
isFullBleedRoute,
movedHref,
pageOf,
selectedAgent,
visibleNavItems,
} from "../src/shell/routes.ts";
@ -80,3 +83,33 @@ test("a group of agent terminals is full-bleed", () => {
assert.equal(isFullBleedRoute("/agents/group/ab12cd34"), true);
assert.equal(isFullBleedRoute("/agents/group"), false);
});
test("one segment after /agents selects that agent on the agents page", () => {
assert.equal(selectedAgent("/agents/iris"), "iris");
assert.equal(selectedAgent("/agents/a%20b"), "a b");
assert.equal(agentPath("a b"), "/agents/a%20b");
assert.equal(selectedAgent(agentPath("a/b")), "a/b");
});
test("the agents list, a group and a terminal select no agent", () => {
for (const path of [
"/agents",
"/agents/",
"/agents/group",
"/agents/group/g1",
"/agents/iris/terminal",
"/agents/iris/subagents/s/terminal",
"/jobs",
]) {
assert.equal(selectedAgent(path), null, path);
}
assert.equal(selectedAgent("/agents/%E0%A4%A"), null);
});
test("an agent selected on the agents page is still the agents page", () => {
assert.equal(pageOf("/agents/iris"), "/agents");
assert.equal(pageOf("/agents"), "/agents");
assert.equal(pageOf("/agents/iris/terminal"), "/agents/iris/terminal");
assert.equal(pageOf("/agents/group/g1"), "/agents/group/g1");
assert.equal(pageOf("/jobs"), "/jobs");
});