Repository navigation
Add template_a11y.py to check icon-only links and buttons - #14
Merged
Merged
Conversation
Scans an extension's or style's templates for links and buttons that show only an icon, and reports any without a title (tooltip) or screen-reader text (an sr-only span or aria-label). A title on the icon itself, phpBB's ACP pattern, counts as the tooltip, and a link around an image with alt text passes. Standard library only; no board needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ACP style has no sr-only class, so a span would be visible there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds
phpbb-test-board/template_a11y.py, which scans an extension's or style's templates for links and buttons that show only an icon and reports any without atitle(the tooltip) or screen-reader text (a<span class="sr-only">oraria-label).titleon the icon itself, phpBB's ACP pattern, counts as the tooltip, and a link around an image with alt text passes, so the check doesn't flag those.{L_FOO},{{ lang('FOO') }},<!-- IF -->,{% if %}) is understood, so it works on phpBB 3.3 and Twig templates.FILE:LINE: message; exit status 1 if anything is found. Standard library only, no board needed.phpbb-test-board/README.mddescribe it, andtests/test-phpbb-test-board.shcovers it.Testing
Claude added seven tests, which pass with the existing ones and ShellCheck. Run over the local phpbbmodders extension and style checkouts, it found one gap in sfscompanion (fixed in phpbbmodders/sfscompanion#10) and 29 in knowledgebase, which all have tooltips but lack screen-reader text.
Investigated and written by Claude on behalf of William Jacoby (bonelifer).