-
Notifications
You must be signed in to change notification settings - Fork 648
Add Alert status variant to StateLabel component #7472
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
Conversation
🦋 Changeset detectedLatest commit: f6f6dcd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Co-authored-by: HiroAgustin <1458873+HiroAgustin@users.noreply.github.com>
Co-authored-by: HiroAgustin <1458873+HiroAgustin@users.noreply.github.com>
|
👋 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 |
Co-authored-by: HiroAgustin <1458873+HiroAgustin@users.noreply.github.com>
There was a problem hiding this 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 a new "Alert status" variant to the StateLabel component with three distinct alert states: opened, fixed, and dismissed. The changes introduce shield-based icons to visually represent security alert states alongside the existing issue and pull request status variants.
Changes:
- Added three new alert status types (
alertOpened,alertFixed,alertDismissed) with corresponding shield icons (ShieldIcon, ShieldCheckIcon, ShieldSlashIcon) - Implemented CSS styling that reuses existing design tokens for consistency (open-emphasis for opened, done-emphasis for fixed, draft-emphasis for dismissed)
- Updated component documentation, tests, and Storybook stories to include the new alert variants
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/StateLabel/StateLabel.tsx | Added shield icon imports and mapped three new alert statuses to icons and aria labels |
| packages/react/src/StateLabel/StateLabel.module.css | Added CSS rules for the three alert status variants using existing color tokens |
| packages/react/src/StateLabel/tests/StateLabel.test.tsx | Added snapshot tests and accessibility tests for all three alert statuses |
| packages/react/src/StateLabel/tests/snapshots/StateLabel.test.tsx.snap | Generated snapshots for the three new alert status renders |
| packages/react/src/StateLabel/StateLabel.features.stories.tsx | Added three new Storybook stories demonstrating each alert status |
| packages/react/src/StateLabel/StateLabel.docs.json | Updated documentation with new story IDs and added alert statuses to the type definition |
| .changeset/brave-panthers-wave.md | Added changeset documenting the minor version bump for the new feature |
|
@copilot on a separate PR add a fourth variant: alertClosed |
|
@copilot please you do it, create a separate branch and PR |
Co-authored-by: HiroAgustin <1458873+HiroAgustin@users.noreply.github.com>
Head branch was pushed to by a user without write access
This reverts commit c573aa7.
Co-authored-by: HiroAgustin <1458873+HiroAgustin@users.noreply.github.com>
I've added the |
|
@copilot update PR summary with entire changeset not just the latest. |
Updated the PR description to include all four alert status variants (alertOpened, alertFixed, alertDismissed, and alertClosed) with complete documentation, visual examples, and validation details. |
francinelucca
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's unify the changelogs and LGTM! thanks for the contribution!
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/11856 |

Summary
This PR adds four new alert status variants to the StateLabel component, alongside the existing "Issue status" and "Pull request status" variants. These variants use shield-based icons to visually represent security alert states.
Changes Made
Component Updates
alertOpened: ShieldIcon with 'Alert' labelalertFixed: ShieldCheckIcon with 'Alert' labelalertDismissed: ShieldSlashIcon with 'Alert' labelalertClosed: ShieldXIcon with 'Alert' labelStyling
alertOpened: open-emphasis colors (green) - same as issueOpened and pullOpenedalertFixed: done-emphasis colors (purple) - same as issueClosed and pullClosedalertDismissed: draft-emphasis colors (gray) - same as issueDraftalertClosed: closed-emphasis colors (red) - same as pullClosedDocumentation & Stories
Tests
unmount()callsChangesets
.changeset/brave-panthers-wave.md: Added changeset for initial three alert variants (alertOpened, alertFixed, alertDismissed).changeset/strong-foxes-compare.md: Added changeset for fourth alert variant (alertClosed)Visual Examples
Usage
Validation
Rollout strategy
This is a minor release as it adds new functionality (alert status variants) without breaking existing APIs.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.