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

Add Modal variant with declarative buttons to PRC SelectPanel #5883

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

hectahertz
Copy link
Contributor

@hectahertz hectahertz commented Apr 5, 2025

Note

This is a remake of #5817 to expedite merging to main.

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

Changelog

New

Adds the modal variant to SelectPanel, complete with Radio icons.

Single select modal

Screen.Recording.2025-04-06.at.18.21.19.mov

Multi select modal

Screen.Recording.2025-04-06.at.18.23.07.mov

See #5817 for all the context.

Shortcut

We are still using AnchoredOverlay underneath. But, for variant=modal, we override its position by directly passing top, left, etc. to overlayProps going down to the Overlay

The ideal super clean solution would have been to refactor SelectPanel and conditionally use useAnchoredPosition instead of AnchoredOverlay for variant=anchored. Something @siddharthkp attempted in #5230 earlier but had to revert.

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

@hectahertz hectahertz requested a review from a team as a code owner April 5, 2025 17:07
@hectahertz hectahertz requested a review from TylerJDev April 5, 2025 17:07
Copy link

changeset-bot bot commented Apr 5, 2025

🦋 Changeset detected

Latest commit: 9960bf2

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

@hectahertz hectahertz mentioned this pull request Apr 5, 2025
13 tasks
Copy link
Contributor

github-actions bot commented Apr 5, 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!

@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 5, 2025
@github-actions github-actions bot requested a deployment to storybook-preview-5883 April 5, 2025 17:16 Abandoned
@hectahertz hectahertz force-pushed the hectahertz/selectpanel-modal branch from 500510a to 94ed190 Compare April 5, 2025 17:16
@github-actions github-actions bot requested a deployment to storybook-preview-5883 April 5, 2025 17:19 Abandoned
@github-actions github-actions bot requested a deployment to storybook-preview-5883 April 5, 2025 17:25 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-5883 April 5, 2025 17:39 Inactive
@hectahertz
Copy link
Contributor Author

hectahertz commented Apr 6, 2025

@francinelucca All comments from #5817 have been addressed here, can I please have a review?

@github-actions github-actions bot requested a deployment to storybook-preview-5883 April 6, 2025 15:15 Abandoned
@primer primer bot requested a review from a team as a code owner April 6, 2025 15:24
@primer primer bot requested a review from tbenning April 6, 2025 15:24
@github-actions github-actions bot temporarily deployed to storybook-preview-5883 April 6, 2025 15:28 Inactive
@github-actions github-actions bot requested a deployment to storybook-preview-5883 April 6, 2025 15:37 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-5883 April 6, 2025 15:51 Inactive
@github-actions github-actions bot requested a deployment to storybook-preview-5883 April 6, 2025 16:26 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-5883 April 6, 2025 16:40 Inactive
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.

Looking very good! Minor observation around styling and also I think we should add some testing in the selectPanel.
some recommendations:

  • The selections render as radios when variant modal and single select
  • The save and oncancel buttons are present when variant modal

Let's also run integration checks and get CI to green 🙏

Copy link
Member

Choose a reason for hiding this comment

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

I think the radios are looking too close together here. Seeing the same in the deployment:
image

@francinelucca francinelucca removed the request for review from tbenning April 7, 2025 17:12
Copy link
Contributor

github-actions bot commented Apr 7, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 104.83 KB (+0.34% 🔺)
packages/react/dist/browser.umd.js 105.03 KB (+0.12% 🔺)

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants