Watch
0
0
Fork
You've already forked hyperhive
0

swarm ui: the terminal's status badges overhaul

The connection is a light on the agent's icon instead of a "live" badge, the
model and the effort are one badge, the context badge has an icon, subagents
and a new bash tasks badge are an icon and a count, and an agent's tab shows a
drag grip on hover.

It also removes two things the overhaul replaces: the cost badge, and the
"split" badge with its menu in group panes (splitting is by dragging a tab, or
from the subagents list).
This commit is contained in:
iris 2026-11-16 23:40:59 +01:00 • committed by mara
commit 3a846c8c45

View file

@ -1,27 +1,28 @@
// The model and effort badge tooltips. Run by `npm test`, which Node runs with
// its built-in test runner and type stripping.
// The model badge's tooltip. 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 { effortTitle, modelTitle } from "../src/agent/state/badge-titles.ts";
import { inferenceTitle } from "../src/agent/state/badge-titles.ts";
test("a plain model badge says what the alias resolved to, or nothing", () => {
assert.equal(modelTitle("claude-x-1", false), "resolved to claude-x-1");
assert.equal(modelTitle(undefined, false), undefined);
assert.equal(modelTitle("", false), undefined);
});
test("a clickable model badge says it opens the settings", () => {
test("the tooltip says what the alias resolved to and where the effort comes from", () => {
assert.equal(
modelTitle("claude-x-1", true),
"resolved to claude-x-1. Click for the inference settings",
inferenceTitle("claude-x-1", "swarm", false),
"resolved to claude-x-1; effort set by: swarm",
);
assert.equal(modelTitle(undefined, true), "Click for the inference settings");
});
test("the effort badge names its source and, when clickable, the click", () => {
assert.equal(effortTitle("swarm", false), "set by: swarm");
test("an alias that did not resolve leaves that part out", () => {
for (const resolved of [undefined, null, ""]) {
assert.equal(
inferenceTitle(resolved, "default", false),
"effort set by: default",
);
}
});
test("a clickable badge says it opens the settings", () => {
assert.equal(
effortTitle("swarm", true),
"set by: swarm. Click for the inference settings",
inferenceTitle("claude-x-1", "swarm", true),
"resolved to claude-x-1; effort set by: swarm. Click for the inference settings",
);
});