Skip to content

Add support for aria-label on ActionList.Group #6054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 19, 2025

Conversation

khiga8
Copy link
Contributor

@khiga8 khiga8 commented May 16, 2025

Relates to: https://github.com/github/github/pull/378062/files
Fixes: https://github.com/github/primer/issues/5202

Changelog

New

aria-label attribute is now forwarded to the <ul> element when it's set, rather than the <li> element.

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

Copy link

changeset-bot bot commented May 16, 2025

🦋 Changeset detected

Latest commit: 0376fcf

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 integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label May 16, 2025
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

Copy link
Contributor

github-actions bot commented May 16, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 96.11 KB (-0.04% 🔽)
packages/react/dist/browser.umd.js 96.47 KB (-0.02% 🔽)

@github-actions github-actions bot requested a deployment to storybook-preview-6054 May 16, 2025 14:02 Abandoned
@khiga8 khiga8 marked this pull request as ready for review May 16, 2025 14:04
@Copilot Copilot AI review requested due to automatic review settings May 16, 2025 14:04
@khiga8 khiga8 requested a review from a team as a code owner May 16, 2025 14:04
@khiga8 khiga8 requested a review from jonrohan May 16, 2025 14:04
Copy link
Contributor

@Copilot 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

Adds a new aria-label prop to ActionList.Group and ensures it’s forwarded to the underlying <ul> element, with a fallback to the existing title-based label when no explicit aria-label is provided.

  • Introduces aria-label in the component’s type and destructuring.
  • Updates the <ul> rendering to prefer aria-label over the default title fallback.
  • Adds a unit test, Storybook argType, and Changeset entry.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/react/src/ActionList/Group.tsx Added aria-label prop type, destructuring, and updated <ul>
packages/react/src/ActionList/Group.test.tsx New test verifying aria-label on the <ul>
packages/react/src/ActionList/ActionList.stories.tsx Added aria-label argType for the Group Playground
.changeset/funny-pans-sneeze.md Changeset entry for the patch release
Comments suppressed due to low confidence (1)

packages/react/src/ActionList/Group.tsx:139

  • Consider adding a unit test to cover the scenario where both aria-label and title are provided, ensuring that aria-label takes precedence over the default title-based label.
aria-label={ariaLabel ?? (listRole ? (title ?? (slots.groupHeading?.props.children as string)) : undefined)}

@@ -289,6 +289,9 @@ GroupPlayground.argTypes = {
title: {
type: 'string',
},
'aria-label': {
Copy link
Preview

Copilot AI May 16, 2025

Choose a reason for hiding this comment

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

[nitpick] The new aria-label prop should be documented in the component's API docs and Storybook examples; consider adding a usage example or PropTable entry to showcase its effect on ActionList.Group.

Copilot uses AI. Check for mistakes.

Copy link
Member

Choose a reason for hiding this comment

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

Up to you on adding this to the docs or not. Since this was possible before (though incorrectly placed on the li), I think there isn't a hard requirement to have it in the docs. If we do want to suggest usage of aria-label on groups, then we could.

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.

Looks great! ✨ I ran a quick integration test, but I don't expect there to be any CI issues! :shipit:

@primer-integration
Copy link

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

@primer-integration
Copy link

🔴 golden-jobs completed with status failure.

@github-actions github-actions bot added integration-tests: failing Changes in this PR 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 May 16, 2025
@TylerJDev
Copy link
Member

TylerJDev commented May 16, 2025

🔴 [golden-jobs] completed with status failure.

Doesn't look related to this PR. Should be good to go!

@khiga8 khiga8 enabled auto-merge May 16, 2025 15:26
@khiga8 khiga8 added this pull request to the merge queue May 19, 2025
Merged via the queue into main with commit 3fc7741 May 19, 2025
35 checks passed
@khiga8 khiga8 deleted the kh-allow-aria-label-on-group branch May 19, 2025 14:28
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy