Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: one polled-resource hook for the refreshing pages

Each polling page repeated its own fetch-and-set code on a fixed timer,
so a slow answer could be overtaken by the next tick, an older response
could overwrite a newer one, and nothing aborted a request when the page
went away.

usePolled skips a tick while a request is in flight, aborts on unmount
or refresh, ignores answers from dropped requests, and keeps the last
good data under an error. The alerts, hives, agents, schedules, builds,
review runs and broadcast pages and the subagent list use it.
This commit is contained in:
iris 2026-10-21 22:03:59 +02:00 • committed by mara
commit 8917ba27b6
12 changed files with 274 additions and 160 deletions

View file

@ -24,6 +24,10 @@ domain, covers host-level detail for one hive.
| `/builds` | the swarm builder's recent builds of agent config PRs, with what nix printed when one failed |
Everything it shows comes from [`swarm-controller`](../../swarm-controller/README.md).
Pages that refresh on a timer share one polling rule: a tick is skipped while
the last request is still running, so a slow answer is never overtaken by an
older one, and a failed refresh keeps the rows already on screen under an
error.
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