Skip to content

ActionList: Add aria-describedby back to ActionList.Item #6146

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 2 commits into from
May 30, 2025

Conversation

TylerJDev
Copy link
Member

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

Adds aria-describedby back to ActionList.Item when CSS modules flag is enabled.

Changelog

Changed

  • Ensures aria-describedby is added to ActionList.Item when a description is present and the CSS modules flag is enabled

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 29, 2025

🦋 Changeset detected

Latest commit: 59a6b23

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 May 29, 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!

@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 29, 2025
Copy link
Contributor

github-actions bot commented May 29, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 94.46 KB (+0.01% 🔺)
packages/react/dist/browser.umd.js 94.59 KB (+0.12% 🔺)

@github-actions github-actions bot requested a deployment to storybook-preview-6146 May 29, 2025 22:59 Abandoned
@TylerJDev TylerJDev marked this pull request as ready for review May 30, 2025 13:16
@Copilot Copilot AI review requested due to automatic review settings May 30, 2025 13:16
@TylerJDev TylerJDev requested a review from a team as a code owner May 30, 2025 13:16
@TylerJDev TylerJDev requested a review from hectahertz May 30, 2025 13:16
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

This PR restores the aria-describedby attribute on ActionList.Item when a description is present and the CSS modules feature flag is enabled.

  • Adjusts the aria-describedby logic in Item.tsx to include the description under the CSS modules flag
  • Adds two new tests in Item.test.tsx to verify aria-describedby is applied for both default and listbox roles
  • Updates the changeset to bump a patch release with these changes

Reviewed Changes

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

File Description
packages/react/src/ActionList/Item.tsx Expanded the aria-describedby array to include the description ID when CSS modules flag is enabled
packages/react/src/ActionList/Item.test.tsx Added tests verifying aria-describedby is present on items with descriptions under the feature flag
.changeset/hip-snakes-pay.md Bumped @primer/react patch version and summarized the PR changes
Comments suppressed due to low confidence (2)

packages/react/src/ActionList/Item.test.tsx:439

  • Consider adding a test for the inline description variant (<ActionList.Description variant="inline">) under the CSS modules flag to ensure aria-describedby is applied in that scenario as well.
it('should add `aria-describedby` to items with a description', () => {

packages/react/src/ActionList/Item.tsx:344

  • The condition references slots.description, which isn't a defined slot (the inline description slot is named slots.inlineDescription). As written, descriptions under the CSS modules flag won’t be included correctly. Update this to check slots.inlineDescription (or consolidate the block/inline checks) so the intended descriptions are always added.
slots.blockDescription ? blockDescriptionId : enabled && slots.description ? blockDescriptionId : undefined,

@jonrohan jonrohan added this pull request to the merge queue May 30, 2025
Merged via the queue into main with commit 6588cf2 May 30, 2025
35 checks passed
@jonrohan jonrohan deleted the tylerjdev/add-aria-describedby-back-to-actionlist branch May 30, 2025 18:02
@primer primer bot mentioned this pull request May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants