Skip to content

Add action and icon prop to SelectPanel message #6350

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 13 commits into from
Jul 25, 2025

Conversation

liuliu-dev
Copy link
Contributor

@liuliu-dev liuliu-dev commented Jul 22, 2025

Closes #5362

Changelog

Adds optional icon and action props to SelectPanelMessage to improve UX and accessibility. The icon prop allows custom icons for all message variants, the icon will be above the title. The action prop addresses the accessibility issue where "Create new item" actions were being rendered as ActionList.Item components, causing screen readers to announce them as selectable list items.

Before After
Empty Message Before Empty Message After

New

  • SelectPanelMessage now accepts icon?: React.ComponentType<IconProps> prop for custom icons above the title
  • SelectPanelMessage now accepts action?: React.ReactElement prop for action buttons

Changed

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

Copy link

changeset-bot bot commented Jul 22, 2025

🦋 Changeset detected

Latest commit: 1e208f7

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

@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 Jul 22, 2025
Copy link
Contributor

👋 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 Jul 22, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 92.27 KB (+0.07% 🔺)
packages/react/dist/browser.umd.js 92.44 KB (+0.06% 🔺)

@github-actions github-actions bot requested a deployment to storybook-preview-6350 July 22, 2025 18:04 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-6350 July 22, 2025 18:13 Inactive
@liuliu-dev liuliu-dev marked this pull request as ready for review July 22, 2025 18:38
@Copilot Copilot AI review requested due to automatic review settings July 22, 2025 18:38
@liuliu-dev liuliu-dev requested a review from a team as a code owner July 22, 2025 18:38
@liuliu-dev liuliu-dev requested a review from hectahertz July 22, 2025 18:38
@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT 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 Jul 22, 2025
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 adds optional icon and action props to the SelectPanel message feature to improve user experience and accessibility. The changes enable custom icons for all message variants and provide a proper way to render action buttons that don't confuse screen readers.

  • Adds icon prop to allow custom icons above message titles with fallback to default icons
  • Adds action prop to render action buttons properly instead of as selectable list items
  • Updates component interfaces and adds comprehensive test coverage

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
SelectPanelMessage.tsx Core component updated to support new icon and action props with conditional rendering
SelectPanel.tsx Interface updated to include new props and pass them to message component
SelectPanel.test.tsx Test component updated to support action testing with new test case added
SelectPanel.module.css Added styling for message action container
SelectPanel.features.stories.tsx Added comprehensive story demonstrating all message variants with icons and actions
SelectPanel.docs.json Updated type documentation to reflect new props
sharp-buckets-study.md Changeset file for minor version release

Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. 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 Jul 22, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6350 July 22, 2025 18:53 Inactive
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions github-actions bot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jul 23, 2025
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions github-actions bot temporarily deployed to storybook-preview-6350 July 23, 2025 16:56 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-6350 July 23, 2025 17:05 Inactive
@github-actions github-actions bot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jul 23, 2025
@primer-integration
Copy link

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

@liuliu-dev liuliu-dev requested a review from francinelucca July 23, 2025 17:29
@primer-integration
Copy link

🟢 golden-jobs completed with status success.

Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. 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 Jul 23, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6350 July 23, 2025 21:36 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.

LGTM! small change request

@github-actions github-actions bot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jul 25, 2025
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@liuliu-dev liuliu-dev added this pull request to the merge queue Jul 25, 2025
Merged via the queue into main with commit 8731f43 Jul 25, 2025
43 checks passed
@liuliu-dev liuliu-dev deleted the liuliu/select-panel-message-support branch July 25, 2025 16:51
@primer primer bot mentioned this pull request Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh 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