fix(a11y): the announcement banner is an unnamed navigation landmark #168
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-web#168
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Found while giving the other navigation landmarks distinct names in #157, which did not cover this
one.
src/components/banner.astro:52renderswith no
aria-labeland noaria-labelledby. A<nav>is a landmark, so a screen reader'slandmark list gains an entry called simply "navigation", with nothing to say what it is or
distinguish it from the others on the page. That is the same defect class #157 fixed for
nav.app.label/nav.service.label, andsrc/pages/404.astro:32-34already documents the rulethis breaks.
It is arguably a second defect that the element is a landmark at all: the banner is a time-boxed
announcement wrapping a single promotional link, which is not a navigation region in any useful
sense. Landmarks are a table of contents for the page, and one-link promos do not belong in it.
Two ways to fix it
aria-labelfrom a new i18n key in both dictionaries — something like"Announcement" / "Meddelande". Smallest change, consistent with #157, keeps the landmark.
<div>(or<aside>if it should be an announcementregion) instead of
<nav>. Removes the entry from the landmark list entirely, which isprobably the more honest markup.
Option 1 is what #157 did for its siblings, so it is the consistent choice; option 2 is the better
markup. Either closes this.
Done when
pnpm lang-checkpasses if a string is added.