Skip to content

Conversation

@danielguillan
Copy link
Contributor

Resolves https://github.com/github/primer/issues/5381

This pull request moves the sidebar before the content in the DOM and introduces an aside region to enhance accessibility. The aria-label now dynamically displays the appropriate title based on the active header link or site title.

Copilot AI review requested due to automatic review settings July 1, 2025 08:33
@danielguillan danielguillan requested a review from a team as a code owner July 1, 2025 08:33
Copy link
Contributor

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

This PR improves sidebar accessibility by moving the sidebar before the main content and wrapping it in an aside element with a dynamic aria-label.

  • Sidebar is now rendered within an aside element with a dynamic label based on the active header link or site title.
  • The previous static sidebar pane has been removed to maintain a logical DOM order.

hidden={{narrow: true}}
divider="line"
>
<aside aria-label={`${activeHeaderLink ? activeHeaderLink.title : siteTitle} sidebar`}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

PageLayout.Pane is not polymorphic, so we need to nest the aside region here.

Copy link
Collaborator

@rezrah rezrah left a comment

Choose a reason for hiding this comment

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

Works great 👍

@danielguillan danielguillan merged commit c24a5b9 into main Jul 1, 2025
8 checks passed
@danielguillan danielguillan deleted the danielguillan/nav-a11y-fixes branch July 1, 2025 09:34
@primer-css primer-css mentioned this pull request Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants