Skip to content
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

Correct inactive ActionList.Item behavior in NavList and SelectPanel contexts #5866

Merged
merged 13 commits into from
Apr 9, 2025

Conversation

mperrotti
Copy link
Contributor

@mperrotti mperrotti commented Apr 2, 2025

Note

The fix for SelectPanel will only be available with the "primer_react_select_panel_with_modern_action_list" feature flag. The deprecated ActionList did not support inactive items.

Helpful context

Slack thread that kicked this off
A11y Office Hours recording and recap
A11y Office Hours notes

Demo

Before

Kapture.2025-04-02.at.19.00.22.mp4

After

Kapture.2025-04-02.at.18.49.23.mp4

Changelog

New

Changed

  • Instead of relying on parent component checks (e.g. “is this ActionList wrapped in an ActionMenu or SelectPanel?”) to decide between a tooltip or inline inactive message, we now check the role on ActionList.
    • If role is "menu" or "listbox", the inactive message is rendered inline (e.g. in ActionMenu or SelectPanel)
    • Otherwise, the message is shown in a tooltip
  • This role-based logic fixes inactive NavList item behavior:
    • Now shows the message in a tooltip instead of inline
  • This role-based logic fixes inactive SelectPanel item behavior:
    • Now shows the message inline instead of in a tooltip
    • Important note: Inactive text only works in SelectPanel items when using the modern ActionList. The deprecated ActionList does not support inactive items.
  • Uses the same role-based logic to determine whether ActionList.TrailingAction is allowed inside an item
    • Previously, we relied on parent component checks to block nesting interactive elements
    • This change is unrelated to inactive states, but it's a more robust way to prevent interactive conflicts
  • Updates aria-describedby and aria-labelledby associations for tooltip buttons on inactive items:
    • Before: aria-describedby → item label ("Item 1"), aria-labelledby → inactive message ("Unavailable due to an outage")
    • After: aria-labelledby → item label, aria-describedby → inactive message

Removed

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

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews (Storybook)
  • [unsure] Changes are SSR compatible
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge
  • (GitHub staff only) Integration tests pass at github/github (Learn more about how to run integration tests)

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

github-actions bot commented Apr 2, 2025

👋 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 Apr 2, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 104.44 KB (+0.01% 🔺)
packages/react/dist/browser.umd.js 104.79 KB (+0.04% 🔺)

Copy link

changeset-bot bot commented Apr 3, 2025

🦋 Changeset detected

Latest commit: 075695f

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

@mperrotti mperrotti marked this pull request as ready for review April 3, 2025 18:37
@mperrotti mperrotti requested a review from a team as a code owner April 3, 2025 18:37
@mperrotti mperrotti requested a review from joshblack April 3, 2025 18:37
@github-actions github-actions bot requested a deployment to storybook-preview-5866 April 3, 2025 18:42 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-5866 April 3, 2025 18:55 Inactive
@mperrotti mperrotti changed the title [Draft] Correct inactive ActionList.Item behavior in NavList and SelectPanel contexts Correct inactive ActionList.Item behavior in NavList and SelectPanel contexts Apr 3, 2025
Copy link
Member

@francinelucca francinelucca left a comment

Choose a reason for hiding this comment

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

@primer-integration
Copy link

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

@github-actions github-actions bot requested a deployment to storybook-preview-5866 April 3, 2025 20:58 Abandoned
@primer primer bot requested a review from a team as a code owner April 3, 2025 21:01
@primer primer bot requested a review from langermank April 3, 2025 21:01
@github-actions github-actions bot requested a deployment to storybook-preview-5866 April 3, 2025 21:04 Abandoned
@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 Apr 3, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-5866 April 3, 2025 21:18 Inactive
Copy link
Contributor

@langermank langermank left a comment

Choose a reason for hiding this comment

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

Nice! ✨

@mperrotti
Copy link
Contributor Author

Failing integration should be fixed by https://github.com/github/github/pull/371483

@francinelucca
Copy link
Member

francinelucca commented Apr 4, 2025

Failing integration should be fixed by https://github.com/github/github/pull/371483

Nice! let's merge the fix in gh/gh before merging this pr as to not block main 🙏

@mperrotti mperrotti added this pull request to the merge queue Apr 8, 2025
@mperrotti mperrotti removed this pull request from the merge queue due to a manual request Apr 8, 2025
@mperrotti mperrotti added this pull request to the merge queue Apr 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 9, 2025
@TylerJDev TylerJDev merged commit f978534 into main Apr 9, 2025
44 checks passed
@TylerJDev TylerJDev deleted the mp/fix-inactive-actionlist-bugs branch April 9, 2025 23:39
@primer primer bot mentioned this pull request Apr 9, 2025
jonrohan pushed a commit that referenced this pull request Apr 10, 2025
…contexts (#5866)

Co-authored-by: Marie Lucca <40550942+francinelucca@users.noreply.github.com>
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.

5 participants