Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: show agent panel read failures as text and keep loaded data

Inference, resource caps and linked accounts showed a failed read as a
badge with the reason in a hover title, which keyboard and touch users
cannot read. They now use ApiErrorPanel, and a list that already loaded
stays on screen under a failed refetch.
This commit is contained in:
iris 2026-10-21 22:23:38 +02:00 • committed by mara
commit e727774dc8

View file

@ -114,19 +114,18 @@ export function AgentLimits({ agent }: { agent: string }) {
};
}, [agent, reload]);
if (error) {
return (
<Badge
tone="negative"
value="resource caps unavailable"
title={error.detail ?? "reading the resource caps failed"}
/>
);
// 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} />
) : null;
if (caps === null) {
return errorPanel ?? <span class="ui-agent-limits-muted">…</span>;
}
if (caps === null) return <span class="ui-agent-limits-muted">…</span>;
return (
<div class="ui-agent-limits">
{errorPanel}
<ul class="ui-agent-limits-list">
<li>
<Badge label="cpu quota" value={caps.cpu_quota ?? HIVE_DECIDES} />