Skip to content

Commit e5690be

Browse files
Copilotmgifford
andcommitted
Fix: Wrap progress and clock elements in landmark regions for accessibility
- Changed div elements to aside elements with semantic meaning - Added aria-label attributes for unique accessible names - Created test-landmarks.sh to prevent regression - Added test:landmarks to npm test suite - Updated AGENTS.md documentation Fixes the axe/region accessibility violation where page content was not contained by landmarks. Co-authored-by: mgifford <116832+mgifford@users.noreply.github.com>
1 parent 94dae5f commit e5690be

File tree

4 files changed

+41
-5
lines changed

4 files changed

+41
-5
lines changed

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ Only one notes block per slide:
108108
### Required Elements
109109
Keep these in the `<body>` for proper presentation functionality:
110110
```html
111-
<div class="progress"></div>
112-
<div class="clock"></div>
111+
<aside class="progress" aria-label="Presentation progress"></aside>
112+
<aside class="clock" aria-label="Presentation timer"></aside>
113113
<section aria-live="assertive" aria-label="Slide mode status">Leaving slide mode.</section>
114114
```
115115

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
</head>
2525

2626
<body class="shower fade-in duration=30 warn=5 hidemouse">
27-
<div class="progress"></div>
28-
<div class="clock"></div>
27+
<aside class="progress" aria-label="Presentation progress"></aside>
28+
<aside class="clock" aria-label="Presentation timer"></aside>
2929
<section aria-live="assertive" aria-label="Slide mode status">Leaving slide mode.</section>
3030

3131
<!-- Slide 1: Cover -->

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
"dev:transcript": "node scripts/whisper-transcript-watch.js",
99
"test:html": "html-validate -c .htmlvalidate.json '*.html'",
1010
"test:a11y": "pa11y-ci --config .pa11yci.json || true",
11+
"test:landmarks": "bash scripts/test-landmarks.sh",
1112
"test:links": "bash scripts/check-links.sh",
1213
"test:spell": "cspell '**/*.{md,html,js,css}' || true",
1314
"test:css": "bash scripts/validate-css.sh",
14-
"test:all": "npm run test:html && npm run test:css && npm run test:links && npm run test:spell",
15+
"test:all": "npm run test:html && npm run test:landmarks && npm run test:css && npm run test:links && npm run test:spell",
1516
"test": "npm run test:all"
1617
},
1718
"repository": {

scripts/test-landmarks.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
# Test that progress and clock elements are contained in landmark regions
3+
# This prevents regression of the accessibility issue where these elements
4+
# were not contained by landmarks.
5+
6+
set -e
7+
8+
echo "🔍 Testing landmark accessibility..."
9+
10+
# Check if progress and clock elements use <aside> tag or have role="complementary"
11+
if ! grep -q '<aside class="progress"' index.html; then
12+
echo "❌ FAIL: .progress element is not using <aside> tag"
13+
exit 1
14+
fi
15+
16+
if ! grep -q '<aside class="clock"' index.html; then
17+
echo "❌ FAIL: .clock element is not using <aside> tag"
18+
exit 1
19+
fi
20+
21+
# Check if progress has aria-label
22+
if ! grep -q 'class="progress".*aria-label' index.html; then
23+
echo "❌ FAIL: .progress element is missing aria-label attribute"
24+
exit 1
25+
fi
26+
27+
# Check if clock has aria-label
28+
if ! grep -q 'class="clock".*aria-label' index.html; then
29+
echo "❌ FAIL: .clock element is missing aria-label attribute"
30+
exit 1
31+
fi
32+
33+
echo "✓ All landmark tests passed"
34+
echo " - .progress is an <aside> element with aria-label"
35+
echo " - .clock is an <aside> element with aria-label"

0 commit comments

Comments
 (0)