Skip to content

Chore: add custom selectpanel event#3919

Merged
francinelucca merged 20 commits intomainfrom
chore/add-custom-selectpanel-event
Feb 11, 2026
Merged

Chore: add custom selectpanel event#3919
francinelucca merged 20 commits intomainfrom
chore/add-custom-selectpanel-event

Conversation

@francinelucca
Copy link
Member

@francinelucca francinelucca commented Feb 5, 2026

Authors: Please fill out this form carefully and completely.

Reviewers: By approving this Pull Request you are approving the code change, as well as its deployment and mitigation plans.
Please read this description carefully. If you feel there is anything unclear or missing, please ask for updates.

What are you trying to accomplish?

Adds a new "invokerClicked" custom event to SelectPanel before stopping propagation of original event so that consumers can subscribe to SelectPanel activation

Integration

N/A

List the issues that this change affects.

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

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
Copy link

changeset-bot bot commented Feb 5, 2026

🦋 Changeset detected

Latest commit: bd75545

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

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

@francinelucca francinelucca changed the title Chore/add custom selectpanel event Chore: add custom selectpanel event Feb 5, 2026
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

Adds a new custom event around SelectPanel invoker activation so consumers can observe invoker interactions even though the original activation event is prevented/stopped from bubbling.

Changes:

  • Dispatch a new custom event during SelectPanel invoker activation handling.
  • Add system tests asserting the new event fires on click, keyboard activation, and bubbles.
  • Add a changeset entry and apply a small string-quote/style tweak in a TreeView system test.

Reviewed changes

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

File Description
app/components/primer/alpha/select_panel_element.ts Dispatches a new custom event when the invoker is activated.
test/system/alpha/select_panel_test.rb Adds system tests to validate the new invoker event behavior (click, keyboard, bubbling).
test/system/alpha/tree_view_test.rb Minor string quoting/style adjustment.
.changeset/rare-jokes-scream.md Documents the change as a patch release.
Comments suppressed due to low confidence (1)

app/components/primer/alpha/select_panel_element.ts:817

  • This custom event fires for both mouse click and keyboard activation (Enter), so the name/comment "invokerClicked" is misleading. Consider renaming the event (and related test names) to reflect activation rather than a pointer click.
    // Let listeners observe the invoker was clicked
    this.invokerElement?.dispatchEvent(new CustomEvent('invokerClicked', {bubbles: true}))

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@francinelucca francinelucca added this pull request to the merge queue Feb 11, 2026
Merged via the queue into main with commit e060f4d Feb 11, 2026
40 checks passed
@francinelucca francinelucca deleted the chore/add-custom-selectpanel-event branch February 11, 2026 17:35
@primer primer bot mentioned this pull request Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants