Skip to content

Support dynamic labels for multiple variant ActionMenu - #465

Merged
HDinger merged 5 commits into
mainfrom
feature/action-menu-dynamic-menu-multiple
Jun 5, 2026
Merged

Support dynamic labels for multiple variant ActionMenu#465
HDinger merged 5 commits into
mainfrom
feature/action-menu-dynamic-menu-multiple

Conversation

@myabc

@myabc myabc commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Note

This PR was recreated for the OPF fork from #465

What are you trying to accomplish?

Screenshots

image

Integration

List the issues that this change affects.

Closes primer#3826

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?

Anything you want to highlight for special attention from reviewers?

Accessibility

  • Fixes axe scan violation - This change fixes an existing axe scan violation.
  • No new axe scan violation - This change does not introduce any new axe scan violations.
  • New axe violation - This change introduces a new axe scan violation. Please describe why the violation cannot be resolved below.

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.

@changeset-bot

changeset-bot Bot commented Jun 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c4f008c

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

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

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

@myabc myabc changed the title Feature/action menu dynamic menu multiple Support dynamic labels for multiple variant ActionMenu Jun 2, 2026
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

Uh oh! @myabc, at least one image you shared is missing helpful alt text. Check your pull request body to fix the following violations:

  • Images should have meaningful alternative text (alt text) at line 10

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.

@myabc
myabc force-pushed the feature/action-menu-dynamic-menu-multiple branch from 4de98c3 to 0f57fd3 Compare June 2, 2026 07:54
@myabc
myabc requested a review from Copilot June 2, 2026 07:55

Copilot AI left a comment

Copy link
Copy Markdown

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 extends Primer::Alpha::ActionMenu dynamic-label behavior to the multiple-select variant, so the invoker button label reflects all currently selected items (including preselected ones). This aligns ActionMenu behavior more closely with other selection components (e.g., SelectPanel) and addresses the linked accessibility issue.

Changes:

  • Update ActionMenu custom element logic to compute and render dynamic labels for data-select-variant="multiple".
  • Add/adjust system coverage for dynamic labels in both single- and multiple-select ActionMenu previews.
  • Add a changeset documenting the user-facing enhancement.

Reviewed changes

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

File Description
test/system/alpha/action_menu_test.rb Renames the single-select dynamic label test and adds a multiple-select dynamic label test (but leaves an older now-contradictory assertion in the file).
app/components/primer/alpha/action_menu/action_menu_element.ts Updates #setDynamicLabel() to support multi-select by joining checked item labels and calling it after multi-select toggles.
.changeset/sweet-candies-pay.md Declares a minor release for adding multi-select dynamic label support.

Comment thread app/components/primer/alpha/action_menu/action_menu_element.ts Outdated
Comment thread app/components/primer/alpha/action_menu/action_menu_element.ts
Comment thread test/system/alpha/action_menu_test.rb
HDinger and others added 2 commits June 5, 2026 08:07
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@HDinger
HDinger marked this pull request as ready for review June 5, 2026 06:13
@HDinger
HDinger merged commit 132bcdf into main Jun 5, 2026
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

ActionMenu multiple variant does not support dynamic labels

3 participants