Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ restores the page for searching.

| Check | Where | What it covers |
|---|---|---|
| axe-core 4.13.0, WCAG 2.0/2.1/2.2 A and AA rules | `test/e2e/a11y.spec.mjs` | Every surface and state in the table below, light and dark: zero violations |
| axe-core 4.14.1, WCAG 2.0/2.1/2.2 A and AA rules | `test/e2e/a11y.spec.mjs` | Every surface and state in the table below, light and dark: zero violations |
| Keyboard walk | same file, `test/helpers/a11y-checks.mjs` | Tab reaches every control; each shows a focus indicator (outline or ring, else a screenshot difference); none is hidden under a sticky header or bar (2.4.11); modal layers keep Tab inside |
| Target size | same | Every pointer target at least 24 × 24 CSS px (2.5.8), WCAG's inline-link exception aside; the word card's buttons too |
| Text spacing | same | WCAG's 1.4.12 overrides cut no text off, except in the word list's one-line rows (the inspector shows every field whole) |
Expand Down
48 changes: 11 additions & 37 deletions extension/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -746,26 +746,26 @@
"description": "Second line of the All card."
},
"dash_shelf_all_label_one": {
"message": "All languages, $COUNT$ word",
"description": "Accessible name of the All card.",
"message": "All, every language, $COUNT$ word",
"description": "Accessible name of the All card. Starts with the card's visible text (dash_shelf_all, dash_shelf_all_sub, the count), in that order (WCAG 2.5.3).",
"placeholders": {
"count": {
"content": "{count}"
}
}
},
"dash_shelf_all_label_other": {
"message": "All languages, $COUNT$ words",
"description": "Accessible name of the All card.",
"message": "All, every language, $COUNT$ words",
"description": "Accessible name of the All card. Starts with the card's visible text (dash_shelf_all, dash_shelf_all_sub, the count), in that order (WCAG 2.5.3).",
"placeholders": {
"count": {
"content": "{count}"
}
}
},
"dash_shelf_card_label_one": {
"message": "$LANGUAGE$, $ENDONYM$, $COUNT$ word",
"description": "Accessible name of a language card. {language} in the interface language, {endonym} in its own.",
"message": "$ENDONYM$, $LANGUAGE$, $COUNT$ (word)",
"description": "Accessible name of a language card, in the order the card shows it (WCAG 2.5.3): {endonym} in the language itself, {language} in the interface language, then the count. The unit is in parentheses so the visible text stays an unbroken run of the name.",
"placeholders": {
"language": {
"content": "{language}"
Expand All @@ -779,8 +779,8 @@
}
},
"dash_shelf_card_label_other": {
"message": "$LANGUAGE$, $ENDONYM$, $COUNT$ words",
"description": "Accessible name of a language card.",
"message": "$ENDONYM$, $LANGUAGE$, $COUNT$ (words)",
"description": "Accessible name of a language card, in the order the card shows it (WCAG 2.5.3): {endonym} in the language itself, {language} in the interface language, then the count. The unit is in parentheses so the visible text stays an unbroken run of the name.",
"placeholders": {
"language": {
"content": "{language}"
Expand All @@ -793,35 +793,9 @@
}
}
},
"dash_shelf_card_label_hidden_one": {
"message": "$LANGUAGE$, $ENDONYM$, $COUNT$ word, hidden on pages",
"description": "Accessible name of a hidden language's card.",
"placeholders": {
"language": {
"content": "{language}"
},
"endonym": {
"content": "{endonym}"
},
"count": {
"content": "{count}"
}
}
},
"dash_shelf_card_label_hidden_other": {
"message": "$LANGUAGE$, $ENDONYM$, $COUNT$ words, hidden on pages",
"description": "Accessible name of a hidden language's card.",
"placeholders": {
"language": {
"content": "{language}"
},
"endonym": {
"content": "{endonym}"
},
"count": {
"content": "{count}"
}
}
"dash_shelf_hidden_label": {
"message": "hidden (on pages)",
"description": "Added to a hidden language card's accessible name. Starts with dash_shelf_hidden, the word the card shows (WCAG 2.5.3); the rest is in parentheses."
},
"dash_shelf_week_one": {
"message": "+$COUNT$ this week",
Expand Down
48 changes: 11 additions & 37 deletions extension/_locales/es/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -746,26 +746,26 @@
"description": "Second line of the All card."
},
"dash_shelf_all_label_one": {
"message": "Todos los idiomas, $COUNT$ palabra",
"description": "Accessible name of the All card.",
"message": "Todas, todos los idiomas, $COUNT$ palabra",
"description": "Accessible name of the All card. Starts with the card's visible text (dash_shelf_all, dash_shelf_all_sub, the count), in that order (WCAG 2.5.3).",
"placeholders": {
"count": {
"content": "{count}"
}
}
},
"dash_shelf_all_label_other": {
"message": "Todos los idiomas, $COUNT$ palabras",
"description": "Accessible name of the All card.",
"message": "Todas, todos los idiomas, $COUNT$ palabras",
"description": "Accessible name of the All card. Starts with the card's visible text (dash_shelf_all, dash_shelf_all_sub, the count), in that order (WCAG 2.5.3).",
"placeholders": {
"count": {
"content": "{count}"
}
}
},
"dash_shelf_card_label_one": {
"message": "$LANGUAGE$, $ENDONYM$, $COUNT$ palabra",
"description": "Accessible name of a language card. {language} in the interface language, {endonym} in its own.",
"message": "$ENDONYM$, $LANGUAGE$, $COUNT$ (palabra)",
"description": "Accessible name of a language card, in the order the card shows it (WCAG 2.5.3): {endonym} in the language itself, {language} in the interface language, then the count. The unit is in parentheses so the visible text stays an unbroken run of the name.",
"placeholders": {
"language": {
"content": "{language}"
Expand All @@ -779,8 +779,8 @@
}
},
"dash_shelf_card_label_other": {
"message": "$LANGUAGE$, $ENDONYM$, $COUNT$ palabras",
"description": "Accessible name of a language card.",
"message": "$ENDONYM$, $LANGUAGE$, $COUNT$ (palabras)",
"description": "Accessible name of a language card, in the order the card shows it (WCAG 2.5.3): {endonym} in the language itself, {language} in the interface language, then the count. The unit is in parentheses so the visible text stays an unbroken run of the name.",
"placeholders": {
"language": {
"content": "{language}"
Expand All @@ -793,35 +793,9 @@
}
}
},
"dash_shelf_card_label_hidden_one": {
"message": "$LANGUAGE$, $ENDONYM$, $COUNT$ palabra, oculta en las páginas",
"description": "Accessible name of a hidden language's card.",
"placeholders": {
"language": {
"content": "{language}"
},
"endonym": {
"content": "{endonym}"
},
"count": {
"content": "{count}"
}
}
},
"dash_shelf_card_label_hidden_other": {
"message": "$LANGUAGE$, $ENDONYM$, $COUNT$ palabras, ocultas en las páginas",
"description": "Accessible name of a hidden language's card.",
"placeholders": {
"language": {
"content": "{language}"
},
"endonym": {
"content": "{endonym}"
},
"count": {
"content": "{count}"
}
}
"dash_shelf_hidden_label": {
"message": "oculto (en las páginas)",
"description": "Added to a hidden language card's accessible name. Starts with dash_shelf_hidden, the word the card shows (WCAG 2.5.3); the rest is in parentheses."
},
"dash_shelf_week_one": {
"message": "+$COUNT$ esta semana",
Expand Down
23 changes: 19 additions & 4 deletions extension/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,11 +642,16 @@
"aria-label": extra.label,
onclick: () => setParams({ lang: selected && lang ? null : lang || null }),
},
// The spaces keep the card's text in separate words ("Español Spanish 3"), which the
// name has to contain word for word (WCAG 2.5.3). The card and its foot are flex
// boxes, so the spaces aren't drawn.
el("span", { class: "shelf-title", lang: lang || null, dir: "auto" }, title),
" ",
el("span", { class: "shelf-sub" }, sub),
" ",
el("span", { class: "shelf-foot" },
el("span", { class: "shelf-count num" }, I18n.formatNumber(count)),
meta));
(meta ?? []).flatMap((m) => [" ", m])));
const li = el("li", { class: `shelf-item${extra.hidden ? " is-hidden" : ""}` }, main);
if (extra.menu) {
li.append(el("button", {
Expand All @@ -665,9 +670,19 @@
const items = [card("", t("dash_shelf_all"), t("dash_shelf_all_sub"), total, null, { label: t("dash_shelf_all_label", { count: total }) })];
for (const e of entries) {
const meta = [];
if (e.week) meta.push(el("span", { class: "shelf-week" }, t("dash_shelf_week", { count: e.week })));
if (e.hidden) meta.push(el("span", { class: "shelf-hidden" }, icon("circle", 12), t("dash_shelf_hidden")));
const label = t(e.hidden ? "dash_shelf_card_label_hidden" : "dash_shelf_card_label", { language: e.name, endonym: endonym(e.lang), count: e.count });
// The name follows the card's visible text, in the same order, so it contains what a
// voice-control user reads off the card (WCAG 2.5.3 Label in Name).
const name = [t("dash_shelf_card_label", { language: e.name, endonym: endonym(e.lang), count: e.count })];
if (e.week) {
const week = t("dash_shelf_week", { count: e.week });
meta.push(el("span", { class: "shelf-week" }, week));
name.push(week);
}
if (e.hidden) {
meta.push(el("span", { class: "shelf-hidden" }, icon("circle", 12), t("dash_shelf_hidden")));
name.push(t("dash_shelf_hidden_label"));
}
const label = name.join(", ");
items.push(card(e.lang, endonym(e.lang), e.name, e.count, meta, { label, hidden: e.hidden, menu: e }));
}
items.push(el("li", { class: "shelf-item" }, el("button", { class: "shelf-card shelf-start", type: "button", onclick: startLanguage },
Expand Down
1 change: 1 addition & 0 deletions extension/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@
},
icon(l.hidden ? "circle" : "check", 14),
el("span", { class: "chip-label", lang: l.lang, dir: "auto" }, l.endonym),
" ", // a word break: 2.5.3
el("span", { class: "chip-count num", "aria-hidden": "true" }, I18n.formatNumber(l.count)));
// On: a check; off: a hollow circle (06 §10), so state never relies on color.
main.querySelector(".icon").classList.add("chip-glyph");
Expand Down
Loading