Skip to content

fix(a11y): structural WCAG 2.1 AA fixes on overview report#572

Open
MarcusAl wants to merge 1 commit into
whitesmith:mainfrom
MarcusAl:a11y/overview-wcag-aa
Open

fix(a11y): structural WCAG 2.1 AA fixes on overview report#572
MarcusAl wants to merge 1 commit into
whitesmith:mainfrom
MarcusAl:a11y/overview-wcag-aa

Conversation

@MarcusAl
Copy link
Copy Markdown

@MarcusAl MarcusAl commented Jun 5, 2026

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
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