From 0648e79949de06ea12add6146ada6e1741cc4c0b Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Wed, 25 Mar 2026 12:04:40 +0100 Subject: [PATCH] fix: improve ARIA roles, semantic HTML, and touch targets Add role="button" to sortable table headers and action badges. Add role="group" to related UI element clusters. Replace non-semantic elements with proper button/main landmarks. Refactor PopoverLink to separate internal/external link handling. Increase touch targets to 44px minimum for mobile accessibility. Extracted from #509. Co-Authored-By: Sebastian <115311276+Roaring30s@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) --- components/Drawer/index.tsx | 9 +-- components/ExplorerChart/index.tsx | 2 + components/OrchestratorList/index.tsx | 43 +++++++------- components/PopoverLink/index.tsx | 85 +++++++++++++++------------ components/RoundStatus/index.tsx | 6 +- layouts/main.tsx | 5 +- pages/index.tsx | 36 +++++------- 7 files changed, 98 insertions(+), 88 deletions(-) diff --git a/components/Drawer/index.tsx b/components/Drawer/index.tsx index 860eb764..6418d7ab 100644 --- a/components/Drawer/index.tsx +++ b/components/Drawer/index.tsx @@ -1,5 +1,5 @@ import { DrawerItem } from "@layouts/main"; -import { Box, Flex, Link as A, Text } from "@livepeer/design-system"; +import { Box, Flex, Link as A } from "@livepeer/design-system"; import { IS_L2 } from "lib/chains"; import Link from "next/link"; import Router, { useRouter } from "next/router"; @@ -161,8 +161,9 @@ const Index = ({ Get LPT - + } > } > - Orchestrator + Orchestrator ), accessor: "id", @@ -356,7 +356,7 @@ const OrchestratorList = ({ } > - Forecasted Yield + Forecasted Yield ), @@ -376,6 +376,7 @@ const OrchestratorList = ({ } > - Delegated Stake + Delegated Stake ), accessor: "totalStake", @@ -887,7 +888,7 @@ const OrchestratorList = ({ } > - Trailing 90D Fees + Trailing 90D Fees ), accessor: "ninetyDayVolumeETH", @@ -921,23 +922,21 @@ const OrchestratorList = ({ }} asChild > - - - - - + }, + }} + > + + { - return ( - + transform: "translateX(6px)", + }, + }, + }; + + // For external links, use regular anchor tag to avoid Next.js Link issues + if (newWindow || href.startsWith("http")) { + return ( + + {children} + + ); + } + + // For internal links, use Next.js Link + return ( + {children} diff --git a/components/RoundStatus/index.tsx b/components/RoundStatus/index.tsx index ba0a9e90..4b0c3c71 100644 --- a/components/RoundStatus/index.tsx +++ b/components/RoundStatus/index.tsx @@ -122,7 +122,7 @@ const Index = ({ } > - + diff --git a/layouts/main.tsx b/layouts/main.tsx index a02fee05..dad6e4fa 100644 --- a/layouts/main.tsx +++ b/layouts/main.tsx @@ -696,7 +696,8 @@ const Layout = ({ children, title = "Livepeer Explorer" }) => { - { )} {children} - + diff --git a/pages/index.tsx b/pages/index.tsx index 0e5b1782..90a3a69e 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -362,8 +362,10 @@ const Home = ({ hadError, orchestrators, events, protocol }: PageProps) => { justifyContent: "space-between", marginBottom: "$4", alignItems: "center", + gap: "$4", "@bp1": { flexDirection: "row", + gap: "$5", }, }} > @@ -398,6 +400,7 @@ const Home = ({ hadError, orchestrators, events, protocol }: PageProps) => { width: "100%", justifyContent: "space-between", flexWrap: "nowrap", + gap: "$3", "@bp1": { width: "auto", justifyContent: "flex-start", @@ -413,14 +416,8 @@ const Home = ({ hadError, orchestrators, events, protocol }: PageProps) => { css={{ color: "$hiContrast", fontSize: "$2", - paddingLeft: 0, - paddingRight: 0, - marginRight: 0, - "@bp1": { - paddingLeft: "$2", - paddingRight: "$2", - marginRight: "$2", - }, + minHeight: "44px", + padding: "$2 $3", }} > Performance Leaderboard @@ -433,16 +430,12 @@ const Home = ({ hadError, orchestrators, events, protocol }: PageProps) => { css={{ color: "$hiContrast", fontSize: "$2", - paddingLeft: 0, - paddingRight: 0, - "@bp1": { - paddingLeft: "$2", - paddingRight: "$2", - }, + minHeight: "44px", + padding: "$2 $3", }} > View All - +