fix(a11y): add keyboard support and aria-expanded to audit log rows

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jason Staack
2026-03-15 21:10:17 -05:00
parent 2e9584d2c7
commit 42216ea326

View File

@@ -355,13 +355,16 @@ function AuditLogRow({ item, isExpanded, onToggle }: AuditLogRowProps) {
isExpanded && 'bg-elevated/20',
)}
onClick={onToggle}
tabIndex={0}
onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onToggle() } }}
aria-expanded={isExpanded}
>
<td className="px-3 py-2 text-center">
{hasDetails ? (
isExpanded ? (
<ChevronDown className="h-3.5 w-3.5 text-text-muted" />
<ChevronDown className="h-3.5 w-3.5 text-text-muted" aria-hidden="true" />
) : (
<ChevronRight className="h-3.5 w-3.5 text-text-muted" />
<ChevronRight className="h-3.5 w-3.5 text-text-muted" aria-hidden="true" />
)
) : (
<span className="inline-block h-3.5 w-3.5" />