From 020a9e11fe96779dfe453355446b07fa0c6e7917 Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Wed, 25 Mar 2026 09:31:11 +0100 Subject: [PATCH] fix: add alt tags, aria-labels, and aria-hidden for accessibility Add descriptive alt text to all avatar and migration diagram images. Add aria-labels to logo, social media, and contract address links. Add aria-hidden to decorative icons and rel="noopener noreferrer" to external links. Extracted from #509. Co-Authored-By: Sebastian <115311276+Roaring30s@users.noreply.github.com> --- components/AccountCell/index.tsx | 3 +++ components/DelegatingWidget/Header.tsx | 5 +++++ components/IdentityAvatar/index.tsx | 1 + components/Logo/index.tsx | 2 +- components/Profile/index.tsx | 12 +++++++++--- layouts/main.tsx | 14 +++++++++++++- pages/migrate/broadcaster.tsx | 2 +- pages/migrate/delegator/index.tsx | 2 +- pages/migrate/orchestrator.tsx | 2 +- 9 files changed, 35 insertions(+), 8 deletions(-) diff --git a/components/AccountCell/index.tsx b/components/AccountCell/index.tsx index 43f86c15..7b725a16 100644 --- a/components/AccountCell/index.tsx +++ b/components/AccountCell/index.tsx @@ -49,6 +49,9 @@ const Index = ({ active, address }) => { borderColor: "$neutral5", }} src={identity.avatar} + alt={ + identity?.name ? `${identity.name} avatar` : `${address} avatar` + } /> ) : ( ) : ( { transition: "opacity 150ms ease", }} src={avatarSrc} + alt={`${address} avatar`} onLoad={() => setImageLoaded(true)} onError={() => setHasAvatarError(true)} /> diff --git a/components/Logo/index.tsx b/components/Logo/index.tsx index 67e8d53e..b1165dd8 100644 --- a/components/Logo/index.tsx +++ b/components/Logo/index.tsx @@ -57,7 +57,7 @@ const LivepeerLogo = ({ isDark, isLink = true }: Props) => { if (!isLink) return markup; return ( - {markup} + {markup} ); }; diff --git a/components/Profile/index.tsx b/components/Profile/index.tsx index be84d78f..650e45c2 100644 --- a/components/Profile/index.tsx +++ b/components/Profile/index.tsx @@ -78,6 +78,9 @@ const Index = ({ account, isMyAccount = false, identity }: Props) => { height: "100%", }} src={identity.avatar} + alt={ + identity?.name ? `${identity.name} avatar` : `${account} avatar` + } /> ) : ( { href={identity.url} target="__blank" rel="noopener noreferrer" + aria-label={`Visit ${identity.url.replace(/(^\w+:|^)\/\//, "")}`} > - + @@ -242,12 +246,13 @@ const Index = ({ account, isMyAccount = false, identity }: Props) => { href={`https://twitter.com/${identity.twitter}`} target="__blank" rel="noopener noreferrer" + aria-label={`View ${identity.twitter} on Twitter`} > - +