swarm ui: say what a subagent's age counts from, and the list's two lookup passes
A running status shows 'running since', a stale one shows no age, since its time is when the run began. The reference now says the status reads and the row lookups are two passes, so the list waits up to four seconds in all.
This commit is contained in:
parent
7122084850
commit
c56faf9dff
1 changed files with 35 additions and 13 deletions
|
|
@ -5,6 +5,7 @@ import assert from "node:assert/strict";
|
|||
import { test } from "node:test";
|
||||
import {
|
||||
STALE_S,
|
||||
ageUnix,
|
||||
byRecency,
|
||||
isDimmed,
|
||||
isRunning,
|
||||
|
|
@ -99,13 +100,20 @@ test("only a subagent without a status falls back to the row's age", () => {
|
|||
assert.equal(isDimmed(withState("a", "stale", 5), NOW), true);
|
||||
});
|
||||
|
||||
test("the state word names finished and stale subagents only", () => {
|
||||
test("the state word says what the age counts from", () => {
|
||||
assert.equal(stateLabel(withState("a", "finished", 5)), "finished");
|
||||
assert.equal(stateLabel(withState("a", "stale", 5)), "stopped reporting");
|
||||
assert.equal(stateLabel(withState("a", "running", 5)), "");
|
||||
assert.equal(stateLabel(withState("a", "running", 5)), "running since");
|
||||
assert.equal(stateLabel(sub("a", 5)), "");
|
||||
});
|
||||
|
||||
test("a stale status shows no age, the others show theirs", () => {
|
||||
assert.equal(ageUnix(withState("a", "stale", 500)), null);
|
||||
assert.equal(ageUnix(withState("a", "running", 500)), NOW - 500);
|
||||
assert.equal(ageUnix(withState("a", "finished", 500)), NOW - 500);
|
||||
assert.equal(ageUnix(sub("a", 30)), NOW - 30);
|
||||
});
|
||||
|
||||
test("a subagent with only a status sorts by when its state began", () => {
|
||||
const list = [
|
||||
withState("old", "finished", 500),
|
||||
|
|
|
|||
Loading…
Reference in a new issue