Skip to content

Conversation

@llastflowers
Copy link
Contributor

What are you trying to accomplish?

Make the "Retry" button in the TreeView: Loading failure story accessible via keyboard navigation

Integration

N/A (preview-only)

List the issues that this change affects.

Relates to https://github.com/github/accessibility-audits/issues/14759

Risk Assessment

  • Low risk the change is small, highly observable, and easily rolled back.
  • Medium risk changes that are isolated, reduced in scope or could impact few users. The change will not impact library availability.
  • High risk changes are those that could impact customers and SLOs, low or no test coverage, low observability, or slow to rollback.

What approach did you choose and why?

Workaround to make the "Retry" button in the TreeView: Loading failure story accessible via keyboard navigation. Needed to escape default tabindex behavior to accomplish this (preview-only). I don't think a component change is needed since this nested button most likely isn't a pattern that is actually used in TreeView, and changing the main component could cause other unwanted side-effects. Reviewers, please lmk if you feel otherwise!

Anything you want to highlight for special attention from reviewers?

Let me know if overriding this specific behavior in only this story doesn't seem like the right approach for any reason!

Accessibility

This addresses a SEV1 a11y bug where the button in this story was not keyboard-accessible.

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews (Lookbook)
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

Copilot AI review requested due to automatic review settings January 8, 2026 19:40
@llastflowers llastflowers requested a review from a team as a code owner January 8, 2026 19:40
@llastflowers llastflowers requested a review from TylerJDev January 8, 2026 19:40
@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2026

🦋 Changeset detected

Latest commit: 8fe701b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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 pull request addresses a keyboard accessibility issue where the "Retry" button in the TreeView loading failure story was not reachable via keyboard navigation due to the roving tabindex pattern. The fix adds JavaScript to remove the tabindex="-1" attribute and implements custom keyboard navigation logic.

Key Changes:

  • Added helper functions to locate and make the Retry button keyboard-accessible
  • Implemented event listeners to handle dynamic content updates
  • Added keyboard navigation logic to redirect Tab focus to the Retry button

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

…' of github.com:primer/view_components into llastflowers/14759/retry-button-not-accessible-a11y-bug
Copy link
Member

@TylerJDev TylerJDev left a comment

Choose a reason for hiding this comment

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

I noticed that once you click "retry" focus is lost again and you're not able to focus onto the tree item, nor are you able to focus back on the "retry" button. When the "retry" button is triggered, could we programmatically set focus back onto the tree item?

@llastflowers
Copy link
Contributor Author

llastflowers commented Jan 13, 2026

I noticed that once you click "retry" focus is lost again and you're not able to focus onto the tree item, nor are you able to focus back on the "retry" button. When the "retry" button is triggered, could we programmatically set focus back onto the tree item?

@TylerJDev Thanks for catching this! I'll take a look! 🫡

Copy link
Member

@jonrohan jonrohan left a comment

Choose a reason for hiding this comment

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

Seems good to me 👍🏻

@llastflowers llastflowers added this pull request to the merge queue Jan 13, 2026
Merged via the queue into main with commit 15ac0d4 Jan 13, 2026
32 checks passed
@llastflowers llastflowers deleted the llastflowers/14759/retry-button-not-accessible-a11y-bug branch January 13, 2026 23:04
@primer primer bot mentioned this pull request Jan 13, 2026
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