fix(frontend): make NavSessions rows keyboard-accessible (role/tabIndex/Enter+Space)

This commit is contained in:
2026-06-29 12:53:42 +02:00
parent d5f82b70a4
commit 50025c809e
2 changed files with 19 additions and 1 deletions
+10 -1
View File
@@ -27,8 +27,17 @@ export function NavSessions({ sessions, activeSessionId, onOpenPanel, menuFor }:
data-testid={`session-item-${s.id}`}
data-active={active ? "true" : "false"}
onClick={() => onOpenPanel(s.id)}
role="button"
tabIndex={0}
aria-label={s.name || s.question || s.id}
onKeyDown={(e) => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
onOpenPanel(s.id);
}
}}
className={[
"group flex w-full cursor-pointer items-start gap-1 rounded-lg px-2.5 py-2 text-left transition-colors",
"group flex w-full cursor-pointer items-start gap-1 rounded-lg px-2.5 py-2 text-left transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
active ? "bg-[oklch(var(--primary)/0.12)]" : "hover:bg-accent",
].join(" ")}
>