From e6fbeb14df869ece2fe3a0e7fe555e53d7a171e4 Mon Sep 17 00:00:00 2001 From: Olayinka Adelakun Date: Thu, 18 Jun 2026 13:55:24 -0400 Subject: [PATCH] =?UTF-8?q?fix(a11y):=20fix=20traces=20page=20accessibilit?= =?UTF-8?q?y=20violations=20=E2=80=94=20rowgroup=20tabbable,=20button=20na?= =?UTF-8?q?me,=20and=20heading=20order?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/components/ui/alert.tsx | 6 +- src/frontend/src/locales/de.json | 2 + src/frontend/src/locales/en.json | 2 + src/frontend/src/locales/es.json | 2 + src/frontend/src/locales/fr.json | 2 + src/frontend/src/locales/ja.json | 2 + src/frontend/src/locales/pt.json | 2 + src/frontend/src/locales/zh-Hans.json | 2 + .../TraceComponent/FlowInsightsContent.tsx | 46 +++++++++++- .../FlowInsightsContent.a11y.test.ts | 73 +++++++++++++++++++ 10 files changed, 132 insertions(+), 7 deletions(-) create mode 100644 src/frontend/src/pages/FlowPage/components/TraceComponent/__tests__/FlowInsightsContent.a11y.test.ts diff --git a/src/frontend/src/components/ui/alert.tsx b/src/frontend/src/components/ui/alert.tsx index 05c5b7fa71..59d183af35 100644 --- a/src/frontend/src/components/ui/alert.tsx +++ b/src/frontend/src/components/ui/alert.tsx @@ -32,10 +32,10 @@ const Alert = React.forwardRef< Alert.displayName = "Alert"; const AlertTitle = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes + HTMLDivElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( -
{ + const keyboardEvent = event.event as KeyboardEvent | undefined; + if (keyboardEvent?.key === "Enter") { + const rowData = event.data as TraceListItem | undefined; + setTracePanelTraceId(rowData?.id ?? null); + setTracePanelOpen(true); + } + }, + [], + ); + + const traceTableRef = useRef(null); + + const applyRowTabIndices = useCallback((containerEl: HTMLElement | null) => { + if (!containerEl) return; + const bodyRows = containerEl.querySelectorAll( + ".ag-center-cols-container [role='row']", + ); + bodyRows.forEach((row, idx) => { + row.setAttribute("tabindex", idx === 0 ? "0" : "-1"); + }); + }, []); + const totalRuns = tracesData?.total ?? rows.length; const totalPages = Math.max( 1, @@ -306,7 +330,10 @@ export function FlowInsightsContent({