Skip to content

A11y: high-confidence round2 semantic cleanup#5644

Open
accesswatch wants to merge 2 commits into
mainfrom
accessibility-fixes-high-confidence-round2
Open

A11y: high-confidence round2 semantic cleanup#5644
accesswatch wants to merge 2 commits into
mainfrom
accessibility-fixes-high-confidence-round2

Conversation

@accesswatch
Copy link
Copy Markdown
Contributor

Summary

  • High-confidence round 2 accessibility cleanup focused on native semantics in shared navigation components.
  • Removes invalid/redundant interactive attributes from links and adds explicit labels for mobile header controls.

Changes

  1. modules/custom/az_core/src/Plugin/Block/MobileNavBlock.php
    • Removes type=button from link attributes.
    • Removes role=button from navigational links.
  2. modules/custom/az_select_menu/src/Plugin/Block/AzSelectMenu.php
    • Removes redundant role=button and tabindex=0 from native <button> attributes.
  3. themes/custom/az_barrio/templates/layout/page.html.twig
    • Adds explicit labels for open-search, open-menu, close-menu controls and home control.
  4. themes/custom/az_barrio/templates/navigation/breadcrumb.html.twig
    • Uses translated breadcrumb landmark label.

Impact

  • Branch: accessibility-fixes-high-confidence-round2
  • Impacted files: 4
  • Scope: low-risk semantic cleanup in reused navigation surfaces.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 28, 2026 01:41
@accesswatch accesswatch requested review from a team as code owners May 28, 2026 01:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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" and role="button" from <a> render arrays in the mobile nav block (invalid on anchors).
  • Remove redundant role="button" and tabindex="0" from the native <button> in AzSelectMenu.
  • Add aria-label to mobile header controls (search/menu/home/close) and use a translated aria-label for 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.

Comment on lines +112 to +131
<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>
@az-digital-bot
Copy link
Copy Markdown
Contributor

Tugboat has finished building the preview for this pull request!

Link:

Dashboard:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants