Skip to content

Conversation

@liuliu-dev
Copy link
Contributor

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

Closes #5286

This PR deprecates the icon prop in the Banner component in favor of leadingVisual. It also fixes the SecondaryAction styling and improves the Storybook Playground selecting leadingVisual.

Changelog

  1. Deprecate icon prop and add leadingVisual instead
  2. BannerSecondaryAction uses variant="invisible" instead of variant="link"
  3. Fixed Storybook Playground control for leadingVisual

Rollout strategy

  • Minor release

Testing & Reviewing

Merge checklist

@changeset-bot
Copy link

changeset-bot bot commented Nov 13, 2025

🦋 Changeset detected

Latest commit: 36b160e

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
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 added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 13, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-7197 November 13, 2025 23:20 Inactive
@liuliu-dev liuliu-dev added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Nov 13, 2025
@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Nov 13, 2025
@liuliu-dev liuliu-dev added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Nov 13, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-7197 November 13, 2025 23:45 Inactive
@primer-integration
Copy link

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

@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 update snapshots 🤖 Command that updates VRT snapshots on the pull request labels Nov 13, 2025
@github-actions
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. 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 added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 13, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-7197 November 13, 2025 23:59 Inactive
@primer-integration
Copy link

🟢 ci completed with status success.

@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 Nov 14, 2025
@liuliu-dev liuliu-dev marked this pull request as ready for review November 17, 2025 21:10
@liuliu-dev liuliu-dev requested review from a team as code owners November 17, 2025 21:10
@liuliu-dev liuliu-dev requested review from Copilot, langermank and lukasoppermann and removed request for Copilot November 17, 2025 21:10
Copilot AI review requested due to automatic review settings November 20, 2025 19:09
@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 20, 2025
@github-actions
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. 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.

Copilot finished reviewing on behalf of liuliu-dev November 20, 2025 19:10
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 PR deprecates the icon prop in the Banner component in favor of leadingVisual to align with naming conventions across Primer React. It also updates the BannerSecondaryAction to use variant="invisible" instead of variant="link" and improves the Storybook Playground story.

Key Changes

  • Deprecated icon prop with @deprecated JSDoc annotation and added new leadingVisual prop
  • Changed BannerSecondaryAction from variant="link" to variant="invisible"
  • Added comprehensive test coverage for the new leadingVisual prop and fallback behavior

Reviewed Changes

Copilot reviewed 6 out of 108 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/react/src/Banner/Banner.tsx Deprecated icon prop, added leadingVisual prop, updated SecondaryAction button variant, and implemented fallback logic
packages/react/src/Banner/Banner.test.tsx Added tests for leadingVisual prop support and precedence over deprecated icon prop
packages/react/src/Banner/Banner.stories.tsx Updated Playground story to support leadingVisual selection with icon mapping
packages/react/src/Banner/Banner.features.stories.tsx Updated CustomIcon story to use leadingVisual instead of deprecated icon
packages/react/src/Banner/Banner.docs.json Updated documentation metadata to mark icon as deprecated and add leadingVisual
.playwright/snapshots/components/Banner.test.ts-snapshots/*.png Updated visual regression test snapshots reflecting the SecondaryAction styling changes
.changeset/open-mails-prove.md Added changeset documenting the deprecation and styling fix

@liuliu-dev liuliu-dev added this pull request to the merge queue Nov 20, 2025
Merged via the queue into main with commit 9605a30 Nov 20, 2025
56 checks passed
@liuliu-dev liuliu-dev deleted the liuliu/banner-leadingvisual-and-secondaryaction branch November 20, 2025 22:15
@primer primer bot mentioned this pull request Nov 20, 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.

4 participants