fix(a11y): structural WCAG 2.1 AA fixes on overview report#572
Open
MarcusAl wants to merge 1 commit into
Open
Conversation
- 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.
1a02d8e to
750c047
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ran pa11y --standard WCAG2AA against the generated overview.html and tackled the structural (non-stylistic) errors.
Changes
lang="en"to<html>, addaria-label="Toggle navigation menu"to the menu-toggle anchor (it currently has only an aria-hidden icon, so screen readers see no accessible name).id="ratingAfileCount"(repeated 15 times) toid="rating-<a-f>-{files,churns,smells}"so HTML's unique-ID rule holds.Verification (pa11y on overview.html)
Tests + RuboCop both green.
test/samples/simple_cov_index.htmlwas auto-updated by the test suite to reflect the new template output.Deliberately out of scope
#A4A4A4grays — that's an opinionated style change. Happy to do it as a follow-up PR if you'd like the muted gray darkened to ~#767676for AA, but didn't want to bundle a visual change with structural fixes.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.