fix(Alert): [DSYS-132] Rollback inline Alert styles and add new actions layout prop#1885
fix(Alert): [DSYS-132] Rollback inline Alert styles and add new actions layout prop#1885
Conversation
Roll back inline Alert variant to minimal styling after Meticulous tests
revealed issues with the new styles when alerts are used truly "inline"
alongside other elements.
Changes:
- Restore minimal styles for inline Alert variant (no background/border)
- Keep new block variant styles with colored backgrounds and borders
- Add actionsLayout prop ('stacked' | 'inline') for block variant to
control whether ButtonGroup appears below content or on the right
- Automatically wrap non-ButtonGroup children in a container to keep
heading and text stacked together when using inline actions layout
- Remove inlineAction slot and ButtonContext for inline variant
- Restrict hideIcon prop to block variant only
- Add displayName to ButtonGroup component to support runtime detection
when separating children in Alert
Breaking changes: None - existing usage continues to work as expected.
Made-with: Cursor
…ions Restructure Alert stories for better organization and discoverability. - Add nested story names (Block/*, Inline/*) to group related examples - Consolidate individual color stories into "Tones" stories - Add "Without Header" story showing inline actions variations - Add actionsLayout to Storybook argTypes whitelist Made-with: Cursor
… stacked and inline actions
🦋 Changeset detectedLatest commit: bea5f05 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 |
commit: |
| const isButtonGroup = (child: ReactNode): boolean => { | ||
| if (!isValidElement(child)) return false; | ||
| const type = child.type as { displayName?: string; name?: string }; | ||
| return ( | ||
| child.type === ButtonGroup || type.displayName === 'ButtonGroup' || type.name === 'ButtonGroup' | ||
| ); | ||
| }; |
There was a problem hiding this comment.
rather than doing this, I'd use slot="action" or something like that
There was a problem hiding this comment.
I tried slots, but it didn't solve the problem of the Heading and Text displaying inline when actionsLayout="inline".
Rather than using using the complex child parsing logic that Cursor came up with before, what if we just wrap Heading and Text in a new parent called AlertText. This gives us a CSS selector (.text) to target and ensure that the heading and text are always displayed as stacked (i.e. flex column)
wdyt?
…tra height - Changed .default .close from position: relative to position: absolute - Added conditional right padding via :has(.close) to prevent text overlap - The actionsInline variant resets to relative positioning at wider container widths to maintain inline flow - Wrapped Alert content in container div for CSS container queries - Added isDismissable to info alert in BlockTones story for testing Made-with: Cursor
…apper - Removed isButtonGroup, flattenChildren, separateChildren helper functions - Added AlertText component for grouping title/description in actionsLayout="inline" - Simplified Alert to render children directly without auto-wrapping - Updated stories to use AlertText wrapper for inline actions layouts - Stacked layouts remain backward compatible (no wrapper needed) Made-with: Cursor
|
Suggested copy edits to alert banners: Block/With actionsHeading: Test drive SSO Block/Inline actionsHeading: SDK update available Block/Without headerWarning alert Error message Info alert Neutral alert Inline/DefaultThis flag is a prerequisite of 1 other flag in production. Inline/Tones[No changes] |
- Moved container-type: inline-size from wrapper to .default class - Removed unnecessary container wrapper div - Put ref and props on same element as role="alert" (fixes ref behavior) - Moved vertical padding to .content to enable container query modifications - Changed default status from 'neutral' to 'info'
AI Security ReviewCommit: After reviewing the full diff, these changes are UI component updates to the Alert component — adding {"findings": []}No security issues found. The changes are purely presentational:
|
AI Security ReviewCommit: {"findings": []}No security vulnerabilities found. The diff is entirely UI component changes: a new |
The hideIcon prop was incorrectly only being respected for the default variant due to inverted logic. This restores the original behavior where hideIcon works for both block and inline variants. Made-with: Cursor
Add a dedicated Neutral story with args format that can be used by the Status overview page, and update the import in Status.tsx to use it. Made-with: Cursor
AI Security ReviewCommit: {"findings": []}Security review complete — no security vulnerabilities found. The diff spans UI component changes in a React component library (
|
…itionally Remove responsive container query behavior to simplify the implementation. The actionsLayout="inline" prop now always applies inline styles. Responsive behavior can be added in a follow-up PR. Made-with: Cursor
AI Security ReviewCommit: The {
"findings": [
{
"file": ".changeset/CleanShot 2026-04-17 at 08.54.45@2x.png",
"line": 0,
"severity": "LOW",
"description": "Accidental screenshot file committed to the repository. Screenshot files from the CleanShot app may capture sensitive UI state (credentials, private data, internal tooling) depending on what was on screen when the screenshot was taken. The binary content cannot be inspected in a diff review. This file is now permanently in git history.",
"fix": "Remove the file with `git rm`, amend or rebase to excise it from history (e.g. git filter-repo), and add a .gitignore rule for 'CleanShot*' or '*.png' in the .changeset/ directory."
},
{
"file": "packages/components/src/styles/CleanShot 2026-04-17 at 08.54.45@2x.png",
"line": 0,
"severity": "LOW",
"description": "Accidental screenshot file committed inside a source package directory (src/styles/). Same information-disclosure risk as above. The npm package.json 'files' field restricts publishing to 'dist/' only, so this will not be shipped to npm consumers, but it persists in git history and could be cloned by contributors.",
"fix": "Remove the file with `git rm`, excise it from git history, and add a .gitignore rule to prevent screenshot files from being staged (e.g. 'CleanShot*.png' in packages/components/src/styles/ or globally)."
}
]
}No other security issues found. The substantive code changes — the |
- Replace calc() with var(--lp-size-48) for close button padding - Use unset for actionsInline overrides instead of explicit values - Add descriptive comments throughout Alert.module.css - Remove accidentally committed screenshot files Made-with: Cursor
AI Security ReviewCommit: The diff is purely UI/component changes — CSS, React component refactoring, and Storybook stories. No security-relevant code paths. {"findings": []}No security issues found. The changes are limited to:
None of these touch authentication, authorization, input validation boundaries, cryptography, secrets, or any data that flows to/from external systems. |
AI Security ReviewCommit: The diff is entirely UI component changes — React/TypeScript for an Alert component, CSS module updates, and Storybook stories. No backend logic, no data handling, no authentication, no external requests. {"findings": []}No security issues found. The changes are purely presentational: new CSS class variants, a new |
|
Update!
|

Summary
Updated video 4/17
View on Loom
After reviewing the Meticulous test, we've decided to roll back to the old styles for inline alerts. Meticulous has revealed several instances of inline alerts actually being used “inline”, alongside or inside of other elements. The new styles don’t work well for this kind of usage. 😬
Updates in this PR:
Screenshots (if appropriate):
Testing approaches
Note
Medium Risk
Changes affect a widely used UI component’s layout/CSS and public API (
actionsLayout,AlertText), which could cause visual regressions in consuming apps despite limited runtime logic changes.Overview
Updates
Alert’s block (default) variant to support a newactionsLayoutprop (stackeddefault,inlineto place actions on the right) and introducesAlertTextto explicitly wrap heading/description when using inline actions.Refactors
Alert.module.cssto improve block layout (padding/close-button positioning/icon alignment) and rolls back inline-variant styling to a simpler, truly-inline presentation. ExportsAlertText/AlertTextProps, updates Storybook controls to includeactionsLayout, and reorganizes Alert stories underBlock/*andInline/*examples.Reviewed by Cursor Bugbot for commit 75e526c. Bugbot is set up for automated code reviews on this repo. Configure here.
Related Jira issue: DSYS-132: Update Alert Component