A11y: high-confidence round2 semantic cleanup - #5644
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
High-confidence round 2 accessibility cleanup that prefers native semantics in shared navigation components: removes invalid/redundant interactive attributes from anchor and button elements, adds explicit labels to mobile header controls, and translates the breadcrumb landmark label.
Changes:
- Remove
type="button"androle="button"from<a>render arrays in the mobile nav block (invalid on anchors). - Remove redundant
role="button"andtabindex="0"from the native<button>inAzSelectMenu. - Add
aria-labelto mobile header controls (search/menu/home/close) and use a translatedaria-labelfor the breadcrumb landmark.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| modules/custom/az_core/src/Plugin/Block/MobileNavBlock.php | Drops type/role button attributes from anchor-rendered nav links. |
| modules/custom/az_select_menu/src/Plugin/Block/AzSelectMenu.php | Removes redundant role=button/tabindex=0 from native button attributes. |
| themes/custom/az_barrio/templates/layout/page.html.twig | Adds aria-labels to mobile offcanvas open/close, search, and home controls. |
| themes/custom/az_barrio/templates/navigation/breadcrumb.html.twig | Switches the breadcrumb landmark to a translated aria-label. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <button type="button" data-bs-toggle="offcanvas" data-bs-target="#azMobileNav" aria-controls="azMobileNav" aria-label="{{ 'Open search panel'|t }}" class="btn btn-arizona-header" id="jsAzSearch"> | ||
| <span aria-hidden="true" class="icon material-symbols-rounded">search</span> | ||
| <span class="icon-text">Search</span> | ||
| </button> | ||
| {% endif %} | ||
| {% for offcanvasblock in page.navigation_offcanvas %} | ||
| {% if 'mobile_nav_block' in offcanvasblock['#cache']['keys'] %} | ||
| <button type="button" data-bs-toggle="offcanvas" data-bs-target="#azMobileNav" aria-controls="azMobileNav" class="btn btn-arizona-header"> | ||
| <button type="button" data-bs-toggle="offcanvas" data-bs-target="#azMobileNav" aria-controls="azMobileNav" aria-label="{{ 'Open menu panel'|t }}" class="btn btn-arizona-header"> | ||
| <span aria-hidden="true" class="icon material-symbols-rounded">menu</span> | ||
| <span class="icon-text">Menu</span> | ||
| </button> | ||
| {% endif %} | ||
| {% endfor %} | ||
| <div class="offcanvas offcanvas-end mw-100 w-100 bg-white d-flex d-lg-none overflow-y-auto" tabindex="-1" id="azMobileNav" aria-label="Mobile navigation"> | ||
| <div class="offcanvas-header sticky-top p-0 mb-2 {{ az_header_blue ? 'text-bg-blue' : 'text-bg-red' }} text-bg-red d-flex justify-content-between align-items-center"> | ||
| <a href="/" class="btn btn-arizona-header"> | ||
| <a href="/" aria-label="{{ 'Go to homepage'|t }}" class="btn btn-arizona-header"> | ||
| <span aria-hidden="true" class="icon material-symbols-rounded">home</span> | ||
| <span class="icon-text">Home</span> | ||
| </a> | ||
| <button type="button" data-bs-toggle="offcanvas" data-bs-target="#azMobileNav" aria-controls="azMobileNav" class="btn btn-arizona-header"> | ||
| <button type="button" data-bs-toggle="offcanvas" data-bs-target="#azMobileNav" aria-controls="azMobileNav" aria-label="{{ 'Close menu panel'|t }}" class="btn btn-arizona-header"> |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Tugboat has finished building the preview for this pull request! Link: Dashboard: |
|
@zsaenz re-requesting your review: since your June approval the branch picked up merge conflicts from the composer audit workflow change (fixed on main in #5657). Those are resolved - the branch now carries main's ci.yml and is current with main as of today. The reviewable diff is unchanged from what you approved: MobileNavBlock.php, AzSelectMenu.php, page.html.twig, and breadcrumb.html.twig only. |
The shared navigation semantics changes are delivered by #5644 (round2); restore those four files to main so this PR reviews as the accordion change alone. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
Changes
modules/custom/az_core/src/Plugin/Block/MobileNavBlock.phptype=buttonfrom link attributes.role=buttonfrom navigational links.modules/custom/az_select_menu/src/Plugin/Block/AzSelectMenu.phprole=buttonandtabindex=0from native<button>attributes.themes/custom/az_barrio/templates/layout/page.html.twigthemes/custom/az_barrio/templates/navigation/breadcrumb.html.twigImpact
accessibility-fixes-high-confidence-round2