swarm ui: show agent freshness and failures where the operator looks, page titles, try again, and stale-data notes
An agent card shows its freshness (stale with the last report's age, never reported, not in swarm identity) when it is not fresh, so the status filter has a visible reason. A failed state change shows its reason in a panel under the card, and a failed cancel shows its reason in the badge, instead of a hover title. Pages can set their title (usePageTitle) and the flow editor does, so several editor tabs differ; the 404 links home. The claude login dialog offers try again after a failure, announces its wait, and has a per-agent field id. The create-agent tabs go forward again as far as the operator has been, but not past a step that is invalid now (lastReachableStep, tested), and the disabled next and create buttons say why in a hint they are described by. usePolled reports when the last live answer arrived, and StaleNote says how old a list is under a failed refresh, or that it is the answer saved from the last visit, on the alerts, builds, review runs, hives, schedules and flows lists.
This commit is contained in:
parent
e4cfac6926
commit
679d2ee420
1 changed files with 321 additions and 25 deletions
|
|
@ -43,7 +43,10 @@ Everything it shows comes from [`swarm-controller`](../../../swarm-controller/RE
|
|||
Pages that refresh on a timer share one polling rule: the page sends no new
|
||||
request while the last one is still running, so an older answer never overtakes
|
||||
a slow one, and a failed refresh keeps the rows already on screen under an
|
||||
error. While a page is fetching, its refresh picker shows a spinner in place of
|
||||
error. A list that isn't live says so: under a failed refresh it reads "showing the
|
||||
last answer, from" and the time, and a page opened on the answer saved from the last
|
||||
visit says that until a fresh one arrives (the alerts, builds, review runs, hives,
|
||||
schedules and flows lists). While a page is fetching, its refresh picker shows a spinner in place of
|
||||
the clock, for at least 0.4 seconds so a quick answer still reads as a refresh.
|
||||
On a folded card (jobs, builds, hives) the picker sits in the card's header, left of the
|
||||
chevron, and shows once the card is open; selecting it doesn't fold the card.
|
||||
|
|
@ -72,7 +75,8 @@ An agent created here or with `swarmctl agent create` starts `paused`; set it
|
|||
`up` from its card. A card shows **login needed** when the agent's own
|
||||
turn-state header says its claude has no session, and a **log in** button
|
||||
that runs the claude login from a dialog: open the URL it shows, then paste
|
||||
the code back. When the secret store has the login, the dialog closes and a
|
||||
the code back. A failed login offers **try again** in the same dialog. When the
|
||||
secret store has the login, the dialog closes and a
|
||||
short toast in the top-right corner says so. The credentials go to the agent through the secret store
|
||||
([`claude-login.md`](../../2-handbook/swarm/claude-login.md)). The agent's own web UI login still
|
||||
works too. The settings section of an opened card has a **claude login** row: when
|
||||
|
|
@ -80,6 +84,11 @@ the swarm stored the agent's login, or that none is, with a **log in** button
|
|||
(**log in again** when the swarm holds one) that opens the same dialog, and a **delete
|
||||
login** action that asks first.
|
||||
|
||||
A card shows its freshness when the agent isn't **fresh**: **stale** with how long ago the hive last
|
||||
reported it, **never reported**, or **not in swarm identity**. A fresh agent shows nothing, so the
|
||||
badge is the reason a card matched the status filter. A failed state change shows its reason in a panel
|
||||
under the card's header, not in a hover title.
|
||||
|
||||
A card shows **updating** when the agent's status snapshot has `updating` set.
|
||||
The hive sets it when an update stops a running container and clears it when
|
||||
the tail reconcile or start settles the agent, whether the container came back
|
||||
|
|
@ -537,7 +546,7 @@ error and the agent gets nothing.
|
|||
While the agent is in a turn, a **cancel turn** badge appears among the state
|
||||
badges over the terminal, in its own tab. It asks the agent's harness to stop
|
||||
the turn, then shows whether one was running ("turn cancelled" or "nothing was
|
||||
running"); a failure shows "cancel failed" with the reason on hover, and a click
|
||||
running"); a failure shows "cancel failed: " and the reason in the badge, and a click
|
||||
tries again. Subagents have no message box and no cancel badge.
|
||||
|
||||
The message doesn't go through the agent's hive, so the hive dashboard's
|
||||
|
|
|
|||
Loading…
Reference in a new issue