Skip to content

Commit f0974a0

Browse files
Merge pull request #4 from refactorfirst/implement-wcag-2.2-AA
Implemented WCAG 2.2 AA compliance for accessibility features
2 parents 779b49d + b46f235 commit f0974a0

21 files changed

Lines changed: 968 additions & 239 deletions

File tree

‎AGENTS.md‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ tests/ # unit/ (Bun), integration/ (Bun + RTL/jsdom), e2e/
9191
3. Write the minimal implementation in `lib/` / `components/` / `app/`
9292
4. Refactor while keeping tests green
9393

94+
**Accessibility is mandatory** — every feature MUST comply with WCAG 2.2 AA
95+
and all markup MUST use HTML5-valid elements/attributes (no obsolete
96+
presentational attributes; presentation lives in CSS). New pages, components
97+
and template changes must keep the a11y guards green:
98+
`tests/unit/html5-attributes.test.js`, `tests/unit/report-template-wcag.test.js`,
99+
`tests/unit/css-a11y.test.js`, `tests/unit/page-titles.test.js` — and add
100+
coverage there when introducing new markup patterns.
101+
94102
## Platform-Aware Sections in This Repo
95103

96104
- **CSP** lives in `app/layout.jsx` (`script-src` includes the CDN widget hosts and
@@ -111,4 +119,10 @@ tests/ # unit/ (Bun), integration/ (Bun + RTL/jsdom), e2e/
111119

112120
## Current Test Count
113121

114-
~294 unit/integration + 112 E2E (three browsers + basePath leg).
122+
~313 unit/integration + 112 E2E (three browsers + basePath leg).
123+
124+
WCAG 2.2 AA / HTML5 guards live in tests/unit/html5-attributes.test.js,
125+
tests/unit/report-template-wcag.test.js, tests/unit/css-a11y.test.js and
126+
tests/unit/page-titles.test.js — the report mustache keeps a single h1,
127+
scoped table headers, captions, labelled canvases and a named nav; obsolete
128+
presentational attributes are FORBID_ATTR-stripped in lib/renderer.js.

‎README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ is a **Next.js static export** (`bun run build` produces `out/`, which any stati
1515
platform account is captured as the issue author and validated server-side by the platform's CI
1616
- Reports and submissions work for repositories hosted on the same platform as the deployment (GitHub, GitLab or
1717
Bitbucket)
18+
- **Accessible**: the site and rendered reports target **WCAG 2.2 AA**, with automated checks for selected requirements
19+
such as semantic HTML5, color contrast, per-page titles, table semantics, labeled controls and landmarks
1820
- Works with a plain static file server: `python3 -m http.server 8000`
1921

2022
---
@@ -370,6 +372,14 @@ npx playwright test --ui # interactive mode
370372
bun run test:e2e:basepath # NEXT_PUBLIC_BASE_PATH=/preview leg (chromium)
371373
```
372374

375+
### Accessibility (WCAG 2.2 AA)
376+
377+
This application targets **WCAG 2.2 Level AA**. Dedicated guards cover selected requirements:
378+
`tests/unit/html5-attributes.test.js`, `tests/unit/report-template-wcag.test.js`, `tests/unit/css-a11y.test.js` and
379+
`tests/unit/page-titles.test.js` verify HTML5-valid markup (no obsolete presentational attributes), semantic heading
380+
hierarchy, table captions and scoped headers, chart alternative text, landmark names, color contrast, focus visibility,
381+
target sizes and per-page titles. Extend these tests when you introduce new markup patterns.
382+
373383
### Lint
374384

375385
```bash

‎app/about/page.jsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
export const metadata = { title: 'About - RefactorFirst' };
2+
3+
/** Renders the RefactorFirst project overview. */
14
export default function AboutPage() {
25
return (
36
<section className="content-page">

‎app/api/page.jsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
export const metadata = { title: 'API - RefactorFirst' };
2+
3+
/** Renders the API and integration reference page. */
14
export default function ApiPage() {
25
return (
36
<section className="content-page">

‎app/documentation/page.jsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import Link from 'next/link';
22

3+
export const metadata = { title: 'Documentation - RefactorFirst' };
4+
5+
/** Renders the RefactorFirst documentation overview. */
36
export default function DocumentationPage() {
47
return (
58
<section className="content-page">

‎app/examples/page.jsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import Link from 'next/link';
22

3+
export const metadata = { title: 'Example Reports - RefactorFirst' };
4+
5+
/** Renders links and guidance for example reports. */
36
export default function ExamplesPage() {
47
return (
58
<section className="content-page">

‎app/faq/page.jsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import Link from 'next/link';
22

3+
export const metadata = { title: 'FAQ - RefactorFirst' };
4+
5+
/** Renders answers to frequently asked questions. */
36
export default function FaqPage() {
47
return (
58
<section className="content-page">

‎app/feedback/page.jsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
export const metadata = { title: 'Feedback - RefactorFirst' };
2+
3+
/** Renders feedback and support links. */
14
export default function FeedbackPage() {
25
return (
36
<section className="content-page">

‎app/getting-started/page.jsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import Link from 'next/link';
22
import WorkflowSample from '../../components/workflow-sample';
33

4+
export const metadata = { title: 'Getting Started - RefactorFirst' };
5+
6+
/** Renders the repository setup walkthrough. */
47
export default function GettingStartedPage() {
58
return (
69
<section className="content-page">

‎app/globals.css‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
:root {
44
--brand-color: #2a6f97;
5-
--brand-accent: #61c0bf;
5+
/* Darker accent: white text on it passes WCAG 2.2 AA contrast (1.4.3) and
6+
it serves as the visible focus indicator (2.4.11, >= 3:1 against the
7+
white page background). */
8+
--brand-accent: #1f5273;
69
--text-color: #1f2d3d;
710
--muted-color: #5c6b7a;
811
--bg-color: #ffffff;
@@ -49,7 +52,10 @@ main#app {
4952
min-height: 60vh;
5053
}
5154

52-
main:focus {
55+
/* Skip-link target: suppress the outline only for programmatic (script/
56+
click) focus; keyboard-focusable users keep the visible indicator (WCAG
57+
2.4.7 / 2.4.11). */
58+
main:focus:not(:focus-visible) {
5359
outline: none;
5460
}
5561

0 commit comments

Comments
 (0)