From 92eed1ec9bc9339579769b55f1e1d5e808fd6bd7 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sat, 4 Jul 2026 19:13:11 +0200 Subject: [PATCH 1/3] fix(a11y): accessible names for switches, swatches, selects and inputs Lighthouse a11y across the authenticated module pages flagged: the clickable Siftlode logo had aria-label='Feed' (accessible name didn't include its visible text); the shared Switch, theme swatches, sort selects and several number/range inputs had no accessible name/label. Give Switch role='switch'+aria-checked and an optional label (passed at every call site), aria-label the swatches, selects (feed/playlists sort) and the settings/config/scheduler inputs, and drop the mismatched logo aria-label so its visible text is the name. All 11 module pages now score 100 accessibility (settings 86->100, playlists 89->100, others 92-95->100). --- frontend/src/components/ConfigPanel.tsx | 7 +++++- frontend/src/components/Feed.tsx | 1 + frontend/src/components/NavSidebar.tsx | 1 - frontend/src/components/Playlists.tsx | 2 ++ frontend/src/components/Scheduler.tsx | 1 + frontend/src/components/SettingsPanel.tsx | 27 ++++++++++++++++++----- frontend/src/components/Sidebar.tsx | 2 +- frontend/src/components/ui/form.tsx | 8 ++++++- 8 files changed, 40 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/ConfigPanel.tsx b/frontend/src/components/ConfigPanel.tsx index fad57be..fb110c7 100644 --- a/frontend/src/components/ConfigPanel.tsx +++ b/frontend/src/components/ConfigPanel.tsx @@ -224,7 +224,11 @@ function Field({
{isBool ? ( - onChange(v ? "true" : "false")} /> + onChange(v ? "true" : "false")} + /> ) : ( )} diff --git a/frontend/src/components/Feed.tsx b/frontend/src/components/Feed.tsx index 3288e26..d3ade19 100644 --- a/frontend/src/components/Feed.tsx +++ b/frontend/src/components/Feed.tsx @@ -579,6 +579,7 @@ export default function Feed({ seed: key === "shuffle" ? rollSeed() : undefined, }); }} + aria-label={t("feed.sortLabel")} className="bg-card border border-border rounded-lg px-2 py-1.5 text-sm outline-none focus:border-accent" > {/* Relevance only ranks meaningfully when there's a search term — offer it then. */} diff --git a/frontend/src/components/NavSidebar.tsx b/frontend/src/components/NavSidebar.tsx index 965d6be..345ef3e 100644 --- a/frontend/src/components/NavSidebar.tsx +++ b/frontend/src/components/NavSidebar.tsx @@ -258,7 +258,6 @@ export default function NavSidebar({ onClick={() => setPage("feed")} className="text-lg font-bold tracking-tight select-none cursor-pointer rounded-md -mx-1 px-1 hover:bg-card hover:opacity-90 transition" title={t("header.feed")} - aria-label={t("header.feed")} > Siftlode diff --git a/frontend/src/components/Playlists.tsx b/frontend/src/components/Playlists.tsx index 5229a8d..b866541 100644 --- a/frontend/src/components/Playlists.tsx +++ b/frontend/src/components/Playlists.tsx @@ -140,6 +140,7 @@ function Row({ {index + 1}