Skip to content

Conversation

@liuliu-dev
Copy link
Contributor

@liuliu-dev liuliu-dev commented Nov 26, 2025

Closes #6044

Changelog

Add leadingVisual to InlineMessage.

Rollout strategy

  • Minor release

Testing & Reviewing

Merge checklist

@changeset-bot
Copy link

changeset-bot bot commented Nov 26, 2025

🦋 Changeset detected

Latest commit: 07f5eee

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 Nov 26, 2025
@github-actions
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

@github-actions github-actions bot requested a deployment to storybook-preview-7247 December 1, 2025 21:46 Abandoned
@github-actions github-actions bot requested a deployment to storybook-preview-7247 December 1, 2025 21:52 Abandoned
@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 Dec 1, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-7247 December 1, 2025 22:04 Inactive
@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh labels Dec 1, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-7247 December 1, 2025 22:14 Inactive
@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: failing Changes in this PR cause breaking changes in gh/gh labels Dec 1, 2025
@liuliu-dev liuliu-dev marked this pull request as ready for review December 1, 2025 22:42
@liuliu-dev liuliu-dev requested a review from a team as a code owner December 1, 2025 22:42
@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh labels Dec 1, 2025
Copilot finished reviewing on behalf of liuliu-dev December 1, 2025 22:46
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

This pull request adds a new leadingVisual prop to the InlineMessage component, allowing users to provide custom icons or visual elements instead of the default variant-based icons. This enhances the component's flexibility and aligns with similar patterns used in other Primer React components like TextInput and ActionList.Item.

Key changes:

  • Added leadingVisual prop that accepts React.ElementType | React.ReactNode
  • Implementation uses isValidElementType to determine whether to render as a component or node
  • Added comprehensive tests for various component types (icon, memo, forwardRef)
  • Updated Storybook playground with a selector for different icon options

Reviewed changes

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

File Description
packages/react/src/InlineMessage/InlineMessage.tsx Added leadingVisual prop type definition and implementation logic to conditionally render custom visual or default icon
packages/react/src/InlineMessage/InlineMessage.test.tsx Added tests for custom leading visual with different React component types and default icon behavior
packages/react/src/InlineMessage/InlineMessage.stories.tsx Updated Playground story with icon selector control to demonstrate custom leadingVisual options
.changeset/giant-loops-send.md Added changeset for minor version bump documenting the new feature

@primer-integration
Copy link

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

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh labels Dec 2, 2025
@primer-integration
Copy link

🟢 ci completed with status success.

Copy link
Contributor

@llastflowers llastflowers left a comment

Choose a reason for hiding this comment

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

looks great! 🚀

@liuliu-dev liuliu-dev added this pull request to the merge queue Dec 3, 2025
Merged via the queue into main with commit e1021e7 Dec 3, 2025
51 checks passed
@liuliu-dev liuliu-dev deleted the liuliu/add-leadingvisual-to-inlinemessage branch December 3, 2025 17:19
@primer primer bot mentioned this pull request Dec 3, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants