Skip to content

Accessibility: landmarks, contrast, progress, focus and announcements - #14

Merged
farhanmasud merged 2 commits into
mainfrom
fix/a11y
Nov 6, 2026
Merged

farhanmasud merged 2 commits into
mainfrom
fix/a11y

Conversation

@farhanmasud

Copy link
Copy Markdown
Member

The accessibility follow-ups queued behind the last batch of PRs, plus contrast failures the earlier audit missed.

Contrast: a correction

In #12 I said the audit found no colour-contrast failures. That was wrong. The axe version I ran then (4.10) seems not to read Tailwind v4's oklch() colours, so it skipped them. axe 4.14 reads them and found:

Where Was Now
Secondary grey text, dark mode (neutral-500 on neutral-950) 4.17:1 neutral-400, about 7:1
Output toggle, unselected option, light mode (neutral-500 on neutral-100) 4.36:1 neutral-600, about 7:1
The row's × Remove icon, light mode (neutral-400 on white) 2.5:1 (non-text needs 3:1) neutral-500, 4.7:1

AA needs 4.5:1 for text. In dark mode the secondary text is slightly brighter; nothing else looks different.

The rest

  • Landmarks: content sits in <main>. The drag overlay is aria-hidden, since it's only a visual cue.
  • Progress bars are role="progressbar", named "Processing photo.jpg", with "3 of 6 files" as their value.
  • Reduced motion: the drop zone, the Output toggle and the progress bars don't animate under prefers-reduced-motion.
  • Focus after Remove: removing a row moved focus to the top of the page. It now goes to the Remove button now in that row's place (or the row before), and to the drop zone once the list is empty. Clear does the same.
  • "Copied" is announced through a hidden live region. Before, a screen reader heard nothing when the button text changed.

Tests

  • e2e/a11y.spec.ts runs axe (WCAG 2.2 AA plus best practices) in light and dark mode at four stages:
    • empty page
    • processing
    • finished, with a row open
    • the Compare dialog
  • It also covers focus after Remove and Clear, and the copy announcement.
  • New dev dependency: @axe-core/playwright 4.14.0 (MPL-2.0), pinned.
  • The save-to-folder test now picks its status line by text, since the page has two.

Includes #13

This carries the same one-line CI fix as #13 (pinning Ubuntu 24.04), so its CI can run. The two merge cleanly in either order.

🤖 Generated with Claude Code

https://claude.ai/code/session_01STHRjFYWhkJBxSKG3tJdap

farhanmasud and others added 2 commits November 6, 2026 20:15
From an axe-core audit (WCAG 2.2 AA plus best practices), now run in CI
by e2e/a11y.spec.ts in light and dark mode:

- Content sits in a <main> landmark; the drag overlay is aria-hidden.
- Secondary grey text was 4.17:1 in dark mode (neutral-500 on
  neutral-950); it's now neutral-400 there. The Output toggle's
  unselected option was 4.36:1 in light mode; now neutral-600. The row's
  Remove icon was 2.5:1, under the 3:1 for non-text; now neutral-500.
- Progress bars are progressbars, named after their file, with
  "3 of 6 files" as their value.
- Transitions are off under prefers-reduced-motion.
- Removing a row moves focus to the Remove button in its place, or to
  the drop zone once the list is empty; Clear does the same.
- "Copied" is announced through a hidden live region.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01STHRjFYWhkJBxSKG3tJdap
ubuntu-latest moved to 26.04, which Playwright 1.58.2 can't install
browsers on, so every run failed at the install step.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01STHRjFYWhkJBxSKG3tJdap
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying image-optimizer with  Cloudflare Pages  Cloudflare Pages

Latest commit: d00487d
Status: ✅  Deploy successful!
Preview URL: https://66502f93.image-optimizer-7ba.pages.dev
Branch Preview URL: https://fix-a11y.image-optimizer-7ba.pages.dev

View logs

@farhanmasud
farhanmasud merged commit a64d106 into main Nov 6, 2026
2 checks passed
@farhanmasud
farhanmasud deleted the fix/a11y branch November 6, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant