fix: aria-pressed on filter buttons, aria-label on search inputs

Improves screen-reader and keyboard nav UX: filter pill buttons now
announce pressed state, catalog search input has an accessible label,
filter button group has role="group" with label.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-25 17:48:31 +02:00
co-authored by Claude Sonnet 4.6
parent 7d9cfdb597
commit 7baa0f847a
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -123,6 +123,7 @@ export default function SourcesPage() {
<button
type="button"
onClick={onClick}
aria-pressed={active}
className="border px-3 py-1.5 font-mono text-[11px] uppercase tracking-[0.08em] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
style={{
borderColor: active ? "var(--foreground)" : "var(--border)",
+3 -1
View File
@@ -85,11 +85,12 @@ export default function CatalogPage() {
</header>
<div className="reveal delay-2 mt-10 flex flex-wrap items-center justify-between gap-4">
<div className="flex flex-wrap gap-2">
<div role="group" aria-label={t({ en: "Filter by type", sv: "Filtrera efter typ" })} className="flex flex-wrap gap-2">
{FILTERS.map((f) => (
<button
key={f.key}
onClick={() => setFilter(f.key)}
aria-pressed={filter === f.key}
className="border px-3 py-1.5 font-mono text-[11px] uppercase tracking-[0.08em] transition-colors"
style={{
borderColor: filter === f.key ? "var(--foreground)" : "var(--border)",
@@ -105,6 +106,7 @@ export default function CatalogPage() {
value={q}
onChange={(e) => setQ(e.target.value)}
placeholder={t({ en: "Search datasets…", sv: "Sök dataset…" })}
aria-label={t({ en: "Search datasets", sv: "Sök dataset" })}
className="w-full max-w-xs border border-border bg-input px-3 py-2 font-mono text-xs outline-none focus:border-foreground sm:w-auto"
/>
</div>