Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: let a closed stream reconnect and a failed caps read retry

When the server answers an event stream with an error status the browser
gives up and the badge stayed on disconnected with nothing to press. The
terminal, its state header and the messages page now offer a reconnect,
and the one rule for the state after an error moved into a tested helper.
The resource caps panel gets a retry beside its error, and its loading
state announces itself.
This commit is contained in:
iris 2026-10-21 23:16:04 +02:00 • committed by mara
commit 31b7452e56

View file

@ -117,10 +117,22 @@ export function AgentLimits({ agent }: { agent: string }) {
// Shown as text, not a hover title. Caps already loaded stay under a
// failed refetch, so a save that worked is not hidden by a read that did not.
const errorPanel = error ? (
<ApiErrorPanel context="reading the resource caps failed" problem={error} />
<>
<ApiErrorPanel
context="reading the resource caps failed"
problem={error}
/>
<Button onClick={() => setReload((n) => n + 1)}>retry</Button>
</>
) : null;
if (caps === null) {
return errorPanel ?? <span class="ui-agent-limits-muted">…</span>;
return (
errorPanel ?? (
<span class="ui-agent-limits-muted" role="status">
loading the resource caps…
</span>
)
);
}
return (