Accessibility pass, report control for homework exercises, clearer rail actions

- axe is clean across every screen in both themes, phone and desktop. Fixed:
  the hidden file inputs (aria-hidden + tabIndex -1 — they are opened by
  labelled buttons, so they should not be in the accessibility tree), the
  heading order (deck/homework/smart-review cards are h2 under the page h1;
  LearningSection takes a level so it stays h2 on the library and h3 inside
  the settings dialog) and landmarks around the study and review feeds.
- tests/contrast.mjs (new diagnostic): samples rendered pixels, because axe
  cannot judge text on blurred glass — it reports those nodes as incomplete.
  It skips disabled controls (1.4.3 exempts them) and content behind an open
  sheet. Result: no below-minimum text on any scanned screen.
- The report control exists in the homework guide too: under each "Try it
  yourself" exercise, labelled "Report exercise", without a skip (there is no
  queue to skip). lib/question-reports now takes deckId/deckTitle directly.
- The rail's two creation actions are buttons now (.nav-action) rather than
  quiet nav rows — once the library is full they were the only way to start
  something on desktop and read as just more navigation. "Make my homework"
  is "New homework" wherever it is an action (rail, empty state, share
  chooser, manifest shortcut); the page title and mode switch keep their
  wording.

Version 0.1.6 (three task bumps), SW -> freezmo-v52.
This commit is contained in:
Martin Dvořák 2026-10-12 21:15:56 +00:00
commit df34337b4a
27 changed files with 337 additions and 75 deletions

View file

@ -270,7 +270,7 @@ const en: Record<string, string> = {
"health.createKey.end": "instead and set",
/* make my homework ------------------------------------------------- */
"homework.nav": "Make my homework",
"homework.nav": "New homework",
"wizard.mode.deck": "Study deck",
"wizard.mode.homework": "Make my homework",
"wizard.mode.aria": "Study deck or homework",
@ -317,6 +317,7 @@ const en: Record<string, string> = {
"homework.guide.stepOf": "Step {n} of {total}",
"homework.guide.close": "Close the guide",
"homework.guide.tryIt": "Try it yourself",
"homework.report": "Report exercise",
"homework.guide.hint": "Show a hint",
"homework.guide.hintMore": "Another hint",
"homework.guide.hintAnswer": "Show the answer",
@ -344,7 +345,7 @@ const en: Record<string, string> = {
/* quick actions (library empty state + /create switcher) ----------- */
"emptyStateCreateDeck": "Create study deck",
"emptyStateHomework": "Make my homework",
"emptyStateHomework": "New homework",
/* library --------------------------------------------------------- */
"library.title": "Your icebox",
@ -1212,7 +1213,7 @@ const cs: Record<string, string> = {
"health.createKey.end": "a nastavit",
/* make my homework ------------------------------------------------- */
"homework.nav": "Udělej mi úkol",
"homework.nav": "Nový úkol",
"wizard.mode.deck": "Studijní sada",
"wizard.mode.homework": "Udělej mi úkol",
"wizard.mode.aria": "Studijní sada nebo úkol",
@ -1259,6 +1260,7 @@ const cs: Record<string, string> = {
"homework.guide.stepOf": "Krok {n}/{total}",
"homework.guide.close": "Zavřít návod",
"homework.guide.tryIt": "Zkus si to",
"homework.report": "Nahlásit cvičení",
"homework.guide.hint": "Ukaž nápovědu",
"homework.guide.hintMore": "Další nápověda",
"homework.guide.hintAnswer": "Ukaž odpověď",
@ -1286,7 +1288,7 @@ const cs: Record<string, string> = {
/* quick actions (library empty state + /create switcher) ----------- */
"emptyStateCreateDeck": "Vytvořit studijní balíček",
"emptyStateHomework": "Udělej mi úkol",
"emptyStateHomework": "Nový úkol",
/* library --------------------------------------------------------- */
"library.title": "Tvoje mraznička",

View file

@ -132,10 +132,15 @@ export function withoutReported(deckId: string, activities: Activity[]): Activit
}
/** Adds (or refreshes) a report and sends a copy to the server, best effort. */
export function reportQuestion(input: { deck: { id: string; title: string }; activity: Activity }): QuestionReport {
export function reportQuestion(input: {
/** A deck id, or the homework record's id for a homework exercise. */
deckId: string;
deckTitle?: string;
activity: Activity;
}): QuestionReport {
const entry: QuestionReport = {
deckId: input.deck.id,
deckTitle: input.deck.title,
deckId: input.deckId,
deckTitle: input.deckTitle,
activityId: input.activity.id,
type: input.activity.type,
question: activityText(input.activity).slice(0, 600),