Skip to content

Address p11y WCAG 2.1 AA fixes on overview report#572

Merged
etagwerker merged 1 commit into
whitesmith:mainfrom
MarcusAl:a11y/overview-wcag-aa
Jun 9, 2026
Merged

Address p11y WCAG 2.1 AA fixes on overview report#572
etagwerker merged 1 commit into
whitesmith:mainfrom
MarcusAl:a11y/overview-wcag-aa

Conversation

@MarcusAl

@MarcusAl MarcusAl commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Ran pa11y --standard WCAG2AA against the generated overview.html and tackled the structural (non-stylistic) errors.

Changes

  1. layouts/application.html.erb — add lang="en" to <html>, add aria-label="Toggle navigation menu" to the menu-toggle anchor (it currently has only an aria-hidden icon, so screen readers see no accessible name).
  2. overview.html.erb — change id="ratingAfileCount" (repeated 15 times) to id="rating-<a-f>-{files,churns,smells}" so HTML's unique-ID rule holds.

Verification (pa11y on overview.html)

Before After
Total 50 34
F77 (duplicate IDs) 15 1
H57 (missing lang) 1 0
H91 (empty anchor) 1 0

Tests + RuboCop both green. test/samples/simple_cov_index.html was auto-updated by the test suite to reflect the new template output.

Deliberately out of scope

  • 30 G18 + 3 G145 contrast violations on #A4A4A4 grays — that's an opinionated style change. Happy to do it as a follow-up PR if you'd like the muted gray darkened to ~#767676 for AA, but didn't want to bundle a visual change with structural fixes.
  • 1 remaining F77 is on a duplicate id="page-content-wrapper" shared by overview/smells_index/simple_cov_index templates. Cross-page scope, follow-up PR welcome.

Happy to take any of those as follow-ups if useful.

- Add lang="en" on <html> so screen readers and translation features
  pick the correct language for the entire report.
- Give the navbar menu-toggle anchor an accessible name via aria-label.
- Make per-rating summary IDs unique (rating-<a-f>-{files,churns,smells})
  so the HTML spec's unique-ID requirement holds and JS/test selectors
  can target individual cells.

Verified via pa11y --standard WCAG2AA on overview.html:
before  50 errors
after   34 errors  (-16: -15 dup IDs, -1 missing lang, +1 anchor label)

Remaining 34 (deliberately out of scope for this PR):
- 30 G18 + 3 G145 contrast violations on #A4A4A4 grays — opinionated
  style change, would prefer maintainer-led decision before changing.
- 1 F77 duplicate id="page-content-wrapper" — cross-page (affects
  overview/smells_index/simple_cov_index templates), separate scope.

Tests + RuboCop green. Test snapshot under test/samples/ auto-updated
to reflect the new template output.
@MarcusAl MarcusAl force-pushed the a11y/overview-wcag-aa branch from 1a02d8e to 750c047 Compare June 5, 2026 15:41
@MarcusAl MarcusAl changed the title fix(a11y): structural WCAG 2.1 AA fixes on overview report Address p11y WCAG 2.1 AA fixes on overview report Jun 8, 2026
@etagwerker etagwerker merged commit 74bd600 into whitesmith:main Jun 9, 2026
26 checks passed
faisal pushed a commit to faisal/rubycritic that referenced this pull request Jun 12, 2026
…h#572)

- Add lang="en" on <html> so screen readers and translation features
  pick the correct language for the entire report.
- Give the navbar menu-toggle anchor an accessible name via aria-label.
- Make per-rating summary IDs unique (rating-<a-f>-{files,churns,smells})
  so the HTML spec's unique-ID requirement holds and JS/test selectors
  can target individual cells.

Verified via pa11y --standard WCAG2AA on overview.html:
before  50 errors
after   34 errors  (-16: -15 dup IDs, -1 missing lang, +1 anchor label)

Remaining 34 (deliberately out of scope for this PR):
- 30 G18 + 3 G145 contrast violations on #A4A4A4 grays — opinionated
  style change, would prefer maintainer-led decision before changing.
- 1 F77 duplicate id="page-content-wrapper" — cross-page (affects
  overview/smells_index/simple_cov_index templates), separate scope.

Tests + RuboCop green. Test snapshot under test/samples/ auto-updated
to reflect the new template output.
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.

2 participants