Skip to content

Medium-confidence a11y fixes: landmark labels and pager headings - #5640

Open
accesswatch wants to merge 5 commits into
mainfrom
accessibility-fixes-medium-confidence
Open

Medium-confidence a11y fixes: landmark labels and pager headings#5640
accesswatch wants to merge 5 commits into
mainfrom
accessibility-fixes-medium-confidence

Conversation

@accesswatch

Copy link
Copy Markdown
Contributor

Summary

  • Medium-confidence accessibility template improvements focused on landmark uniqueness and heading structure.
  • Introduces distinct navigation labels for menu blocks to reduce duplicate landmark naming.
  • Aligns pager hidden heading semantics with section-level heading structure.

Changes

  1. themes/custom/az_barrio/templates/blocks/block--system-menu-block.html.twig
    • Uses context-aware aria-label (e.g., mobile context) on <nav>.
  2. themes/custom/az_barrio/templates/blocks/block--az-barrio-sidebar-menu.html.twig
    • Uses context-aware aria-label (sidebar/mobile context) on <nav>.
  3. themes/custom/az_barrio/templates/navigation/pager.html.twig
    • Switches pager landmark to aria-labelledby + upgrades hidden heading from h3 to h2.
  4. themes/custom/az_barrio/templates/views/views-mini-pager.html.twig
    • Switches mini pager landmark to aria-labelledby + upgrades hidden heading from h3 to h2.

Impact

  • Impacted files: 4
  • Directly targeted rule areas: landmark-unique, heading-order
  • This PR is scoped as medium-confidence and intentionally avoids broad structural rewrites.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves accessibility semantics in the az_barrio theme by making navigation landmark labels more distinct and aligning pager headings with section-level heading structure.

Changes:

  • Adds context-aware aria-label values to menu block <nav> elements.
  • Updates full and mini pager landmarks to use aria-labelledby.
  • Promotes pager hidden headings from h3 to h2.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
themes/custom/az_barrio/templates/blocks/block--system-menu-block.html.twig Builds a contextual navigation label for system menu landmarks.
themes/custom/az_barrio/templates/blocks/block--az-barrio-sidebar-menu.html.twig Adds sidebar/mobile context to sidebar menu landmark labels.
themes/custom/az_barrio/templates/navigation/pager.html.twig Uses the hidden pagination heading as the nav label and updates heading level.
themes/custom/az_barrio/templates/views/views-mini-pager.html.twig Applies the same pager landmark and heading semantics to mini pagers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread .github/workflows/ci.yml Outdated
<nav role="navigation" aria-label="{{ heading_id }}">
<h3 id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</h3>
<nav role="navigation" aria-labelledby="{{ heading_id }}">
<h2 id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</h2>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@accesswatch could you explain the reason for the change in heading level?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure - two related problems. As an h3, the hidden Pagination heading implied a subsection of an h2 that doesn't exist on most pages that render pagers (search results and listing pages typically have the h1 page title and then h2 content sections), so it produced a skipped heading level that axe flags as heading-order and that makes the heading outline confusing when navigating by headings with a screen reader. Promoting it to h2 puts Pagination at the same outline level as the content sections it follows. The companion change from aria-label to aria-labelledby fixes the landmark name itself: aria-label="{{ heading_id }}" was announcing the raw machine ID as the navigation landmark's name, while aria-labelledby points at the heading so the landmark is announced with the translated 'Pagination' text.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@az-digital-bot

Copy link
Copy Markdown
Contributor

Tugboat has finished building the preview for this pull request!

Link:

Dashboard:

@accesswatch
accesswatch requested review from tadean and zsaenz August 7, 2026 20:04
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.

7 participants