Skip to content

Conversation

@francinelucca
Copy link
Member

Closes https://github.com/github/primer/issues/5207

This pull request makes a small accessibility improvement to the LabelGroup component. The change adds proper ARIA attributes to the overlay for better screen reader support.

Changelog

New

  • Added role="dialog" and a dynamic aria-label to the overlay via the overlayProps property, improving screen reader support for overlays displaying hidden labels.

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@changeset-bot
Copy link

changeset-bot bot commented Nov 25, 2025

🦋 Changeset detected

Latest commit: 4baf51d

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

This PR includes changesets to release 1 package
Name Type
@primer/react 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

@github-actions github-actions bot added the staff Author is a staff member label Nov 25, 2025
@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 25, 2025
@github-actions
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

@francinelucca francinelucca marked this pull request as ready for review November 25, 2025 03:37
@francinelucca francinelucca requested a review from a team as a code owner November 25, 2025 03:37
Copilot AI review requested due to automatic review settings November 25, 2025 03:37
@github-actions github-actions bot requested a deployment to storybook-preview-7241 November 25, 2025 03:40 Abandoned
Copilot finished reviewing on behalf of francinelucca November 25, 2025 03:40
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 adds ARIA attributes to the LabelGroup component's overlay to improve screen reader accessibility when hidden labels are displayed. The change addresses an accessibility issue by adding role="dialog" and a dynamic aria-label to the overlay that appears when users click the "+X" button to view hidden labels.

Key Changes:

  • Added role="dialog" and aria-label to the overlay via the overlayProps property in the OverlayToggle component

Reviewed changes

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

File Description
packages/react/src/LabelGroup/LabelGroup.tsx Added overlayProps with role="dialog" and dynamic aria-label to improve accessibility of hidden items overlay
.changeset/four-carrots-divide.md Added changeset documenting this patch-level fix

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Nov 25, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-7241 November 25, 2025 03:49 Inactive
@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh labels Nov 25, 2025
</Button>
)}
focusZoneSettings={{disabled: true}}
overlayProps={{role: 'dialog', 'aria-label': `All ${hiddenItemIds.length} labels`}}
Copy link
Member

Choose a reason for hiding this comment

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

I noticed on the example (https://primer-eb2abbd43f-13348165.drafts.github.io/storybook/?path=/story/components-labelgroup-features--truncate-auto-with-interactive-tokens) it'll say "all 4 labels" but there are more than 4 labels in the dialog 🤔

Maybe we go with something more generic like "Additional labels"

Copy link
Member Author

Choose a reason for hiding this comment

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

oops, thanks! I corrected it to the totalLength instead since it's actually showing all of them. I feel like "additional labels" is misleading as well

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@primer-integration
Copy link

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/7850

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh labels Dec 2, 2025
@primer-integration
Copy link

🔴 ci completed with status failure.

@francinelucca
Copy link
Member Author

Seeing same integration errors on main branch, merging

@francinelucca francinelucca added the integration-tests: skipped manually Changes in this PR do not require an integration test label Dec 2, 2025
@francinelucca francinelucca added this pull request to the merge queue Dec 2, 2025
Merged via the queue into main with commit 181f12e Dec 2, 2025
55 checks passed
@francinelucca francinelucca deleted the fix/labelgroup-a11y-fixes branch December 2, 2025 04:36
@primer primer bot mentioned this pull request Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: failing Changes in this PR cause breaking changes in gh/gh integration-tests: skipped manually Changes in this PR do not require an integration test staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants