Skip to content

SelectPanel: Add new prop align to SelectPanel #6183

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 3 commits into from
Jun 11, 2025

Conversation

TylerJDev
Copy link
Member

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

Adds prop align to SelectPanel to allow consumers to adjust where the SelectPanel will be upon opening.

Changelog

New

  • Adds new prop align to SelectPanel

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

@TylerJDev TylerJDev requested a review from a team as a code owner June 9, 2025 14:14
@github-actions github-actions bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jun 9, 2025
Copy link
Contributor

github-actions bot commented Jun 9, 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

@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 introduces a new align prop for SelectPanel to control its horizontal position relative to the anchor element.

  • Adds align to the SelectPanelBaseProps interface and forwards it to AnchoredOverlay.
  • Updates the documentation JSON to include the new align prop.
  • Adds a changeset for a minor release.

Reviewed Changes

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

File Description
packages/react/src/SelectPanel/SelectPanel.tsx Added optional align prop and passed it into AnchoredOverlay.
packages/react/src/SelectPanel/SelectPanel.docs.json Documented the new align prop with its type, default, and description.
.changeset/fluffy-baboons-sip.md Added a changeset entry marking this as a minor release.
Comments suppressed due to low confidence (3)

packages/react/src/SelectPanel/SelectPanel.tsx:186

  • [nitpick] To make the default alignment explicit in the component API, consider assigning a default value (e.g., align = 'start') when destructuring the props.
align,

packages/react/src/SelectPanel/SelectPanel.tsx:632

  • There are no tests covering the new align prop. Consider adding unit or integration tests to verify the panel’s positioning for different align values.
align={align}

packages/react/src/SelectPanel/SelectPanel.docs.json:196

  • [nitpick] The defaultValue entry includes single quotes inside the JSON string, which may render extra quotes in the generated docs. Consider using "defaultValue": "start" for clarity.
"defaultValue": "'start'",

Copy link
Contributor

github-actions bot commented Jun 9, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 94.59 KB (+0.09% 🔺)
packages/react/dist/browser.umd.js 94.68 KB (+0.05% 🔺)

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.

@@ -108,6 +108,7 @@ interface SelectPanelBaseProps {
* @default undefined (uses feature flag default)
*/
disableFullscreenOnNarrow?: boolean
align?: AnchoredOverlayProps['align']
Copy link
Member

Choose a reason for hiding this comment

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

nit: could add to Pick<> in line 119 instead

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh wow, didn't even realize! thank you for the suggestion! 🙏

@github-actions github-actions bot temporarily deployed to storybook-preview-6183 June 9, 2025 14:29 Inactive
Copy link

changeset-bot bot commented Jun 9, 2025

🦋 Changeset detected

Latest commit: 766fdc0

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

@TylerJDev TylerJDev added this pull request to the merge queue Jun 11, 2025
Merged via the queue into main with commit a5f7928 Jun 11, 2025
33 of 34 checks passed
@TylerJDev TylerJDev deleted the tylerjdev/add-align-to-selectpanel branch June 11, 2025 18:03
@primer primer bot mentioned this pull request Jun 11, 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