From f63912d874dd9ec4a1587e3a80f204fc4a481107 Mon Sep 17 00:00:00 2001 From: Mischa Date: Sat, 20 Jun 2026 20:06:44 +0200 Subject: [PATCH] docs: add WCAG 2.1 AA accessibility audit implementation plan Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01WPJztrVGbwic2xTG7G9fjM --- .../plans/2026-06-20-accessibility-audit.md | 839 ++++++++++++++++++ 1 file changed, 839 insertions(+) create mode 100644 docs/superpowers/plans/2026-06-20-accessibility-audit.md diff --git a/docs/superpowers/plans/2026-06-20-accessibility-audit.md b/docs/superpowers/plans/2026-06-20-accessibility-audit.md new file mode 100644 index 0000000..94a0db3 --- /dev/null +++ b/docs/superpowers/plans/2026-06-20-accessibility-audit.md @@ -0,0 +1,839 @@ +# Accessibility Audit Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Fix all eight WCAG 2.1 AA failures identified in the accessibility audit and add axe-core Playwright regression tests. + +**Architecture:** Six sequential tasks — each implements one audit finding (or related group), writes a Playwright test first, then implements the fix in the relevant template/CSS/JS files. All tests go into a new `tests/ui/accessibility.spec.js` file that grows task by task. Task 6 adds axe-core automated scans on top of the feature-specific checks. + +**Tech Stack:** Grav 2.0 Twig templates, CSS custom properties, vanilla JS, Playwright with `@axe-core/playwright` + +## Global Constraints + +- Target standard: WCAG 2.1 Level AA +- Dev server: http://localhost:8081 (Docker container `intotheeast_grav`) +- Two git repos: outer at `/home/mischa/Nextcloud/Projects/travel-blog-intotheeast`, user subrepo at `/home/mischa/Projects/travel-blog-intotheeast/user` +- Template files are in the **user subrepo** (`user/themes/intotheeast/templates/`, `user/themes/intotheeast/css/`) — commit there first, then commit the outer repo with the updated `user/` pointer +- Tests and `package.json` are in the **outer repo** only +- Run all Playwright tests with: `cd /home/mischa/Nextcloud/Projects/travel-blog-intotheeast && npx playwright test --project=chromium` +- Demo data must be loaded before running tests: `make demo-load` (run from outer repo) +- Never read `.env`; pass it only to `make` / `docker compose` +- Do NOT add comments to CSS or JS unless the WHY is non-obvious + +**Note on F8 (lightbox alt text):** The existing JS in `entry.html.twig` already handles this correctly — `open(index)` sets `lbImg.alt = btn.dataset.alt` which is populated from `{{ image.filename }}`. No code change needed for F8. + +--- + +### Task 1: Skip link + `
` + +**Fixes:** F1 (WCAG 2.4.1 Bypass Blocks) + +**Files:** +- Modify: `user/themes/intotheeast/templates/partials/base.html.twig` +- Modify: `user/themes/intotheeast/css/style.css` +- Create: `tests/ui/accessibility.spec.js` + +**Interfaces:** +- Produces: `.skip-link` element, `#main-content` id on `
` — both consumed by A1 test + +- [ ] **Step 1: Create the failing test** + +Create `tests/ui/accessibility.spec.js`: + +```js +// @ts-check +// Tests: A1–A5 (feature checks) and AX1–AX5 (axe scans) +const { test, expect } = require('@playwright/test'); + +// ── A1: Skip link ────────────────────────────────────────────────────────────── +test('A1: skip link targets #main-content and is first focusable element', async ({ page }) => { + await page.goto('/'); + const skipLink = page.locator('.skip-link'); + await expect(skipLink).toBeAttached(); + await expect(skipLink).toHaveAttribute('href', '#main-content'); + await expect(page.locator('#main-content')).toBeAttached(); +}); +``` + +- [ ] **Step 2: Run A1 to verify it fails** + +```bash +cd /home/mischa/Nextcloud/Projects/travel-blog-intotheeast +npx playwright test --project=chromium tests/ui/accessibility.spec.js +``` + +Expected: FAIL — `.skip-link` not found. + +- [ ] **Step 3: Add skip link to `base.html.twig`** + +In `user/themes/intotheeast/templates/partials/base.html.twig`: + +Change line 15–16 (the opening `` and `
`): + +```html + +