Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: the refresh picker shows a spinner in place of its clock while its page is fetching

usePolled reports when a request is in flight (through a new onBusy of the
poller) and holds it on for at least 0.4 seconds, so a quick answer still
reads as a refresh. The picker swaps its clock for the spinner, in the same
box so its width stays, and the spinner stands still where motion is off.
Every page with a picker passes it; a page with several polled requests shows
it while any of them runs. The Jobs page fetches through shared components
and has none yet.
This commit is contained in:
iris 2026-11-05 23:09:07 +01:00
commit 47c447409b

View file

@ -75,7 +75,11 @@ function AlertsBody() {
const [showAll, setShowAll] = useState(false);
const [intervalMs, setIntervalMs] =
useState<RefreshIntervalMs>(DEFAULT_INTERVAL_MS);
const { data: alerts, error } = usePolled(intervalMs, (signal) =>
const {
data: alerts,
error,
refreshing,
} = usePolled(intervalMs, (signal) =>
fetchJson<Alert[]>("/api/alerts", signal),
);
const listed = alerts ? listedAlerts(alerts, showAll) : null;
@ -96,6 +100,7 @@ function AlertsBody() {
id="alerts-refresh"
value={intervalMs}
onChange={setIntervalMs}
refreshing={refreshing}
/>
</div>
{error ? (