Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: pages that only display start from the answer they last saw, then refresh behind it

usePolled takes a cache key: it saves each answer in localStorage and starts
from the saved one, so opening the agents, alerts, builds, review runs or hives
view shows the last data at once and the refresh spinner marks the update. A
saved answer is dropped after a day, when it was saved by another build of the
UI, at log out (a new onLogout of the shared user menu) and when the gateway
ends the login (a new onSessionEnded of the session guard). Pages with an
editor (schedules, notification flows, broadcast) do not use it.
This commit is contained in:
iris 2026-11-05 23:14:25 +01:00
commit fd51cbd19d

View file

@ -42,6 +42,13 @@ error. 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.
The Jobs page has none yet.
The pages that only display (agents, alerts, builds, review runs and the hives
card) show the answer they last saw at once, then replace it with the fresh one
while the spinner runs, so opening one never starts on an empty page. The browser
keeps the answer for itself only, and forgets it after a day, after a new build
of the UI, at **log out**, and when the login ends. The pages with an editor
(schedules, notification flows, broadcast) start empty as before.
The **wanted** badge changes the state of an agent the swarm has declared. For an
agent the swarm never declared on its hive, such as one only its hive knows
about, the badge reads **no declaration** and doesn't open: create the agent