Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: an agent card is no longer a button around buttons

The card row had role=button and tabindex=0 and held the terminal button, the
wanted menu and the login button, which axe reports as nested interactive
controls and which a screen reader can't walk. The row is no control now; the
agent's name is a real button, so Tab, Enter and Space open the agent, and a
press anywhere on the card still does. Picking stays one checkbox per card.
This commit is contained in:
iris 2026-11-28 02:24:37 +01:00 • committed by mara
commit c77904362d

View file

@ -125,9 +125,13 @@ export function AgentsPage() {
if (was === null || selected !== null) return;
const inPane = document.activeElement?.closest("[inert]") != null;
if (inPane || document.activeElement === document.body) {
document
.querySelector<HTMLElement>(`[data-agent="${CSS.escape(was)}"]`)
?.focus({ preventScroll: true });
// The name is the card's tab stop; while picking, the row is.
const row = document.querySelector<HTMLElement>(
`[data-agent="${CSS.escape(was)}"]`,
);
(
row?.querySelector<HTMLElement>(".ui-agent-card-name-button") ?? row
)?.focus({ preventScroll: true });
}
}, [selected]);
// The PUT response is the hive's whole declaration set (every agent's