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

@ -156,21 +156,26 @@ export function LinkedAccounts({
</ConfirmDialog>
);
if (error) {
return (
<Badge
tone="negative"
value="accounts unavailable"
title={error.detail ?? "listing linked accounts failed"}
/>
);
// Shown as text, not a hover title. A list already loaded stays under a
// failed refetch, so a link or delete that worked is not hidden by a read
// that did not.
const errorPanel = error ? (
<ApiErrorPanel context="listing linked accounts failed" problem={error} />
) : null;
if (accounts === null) {
return errorPanel ?? <span class="ui-linked-accounts-muted">…</span>;
}
if (accounts === null) return <span class="ui-linked-accounts-muted">…</span>;
if (accounts.length === 0) {
return <span class="ui-linked-accounts-muted">none linked</span>;
return (
<>
{errorPanel}
<span class="ui-linked-accounts-muted">none linked</span>
</>
);
}
return (
<>
{errorPanel}
<ul class="ui-linked-accounts">
{accounts.map((a) => (
<li key={`${a.kind}/${a.name}`}>