Skip to content

feat(design-system): add Banner, and render WarningMessage with it - #8452

Draft
talissoncosta wants to merge 3 commits into
mainfrom
feat/banner-component
Draft

feat(design-system): add Banner, and render WarningMessage with it#8452
talissoncosta wants to merge 3 commits into
mainfrom
feat/banner-component

Conversation

@talissoncosta

Copy link
Copy Markdown
Contributor

Changes

Five components render the same icon-plus-message shell by hand: ErrorMessage (twice, there are two copies), WarningMessage, InfoMessage and SuccessMessage. Each assembles Bootstrap alert alert-* classes and most reach for inline styles. A dozen more places write those classes directly.

Banner is that shell: a tone, its icon, and children. It colours from --color-surface-*, --color-border-* and --color-icon-* rather than .alert-*, so it themes from tokens instead of the hand-written .dark blocks in _alert.scss.

Only danger gets role='alert'. The rest are read in place, so announcing them would talk over whatever the user is doing.

WarningMessage moves onto it first, being the simplest of the five. OrganisationLimit stops passing enabledButton, which WarningMessage has never read.

Deliberately not here. ErrorMessage is already being fixed on fix/error-message-announce (it adds role='alert' and repairs seven call sites that pass the error as children to a component that only reads a prop, so the error renders as nothing). It should compose over Banner once that lands. InfoMessage and SuccessMessage need Banner to grow title, action and dismiss slots first, since they carry collapse state in localStorage and close buttons.

How did you test this code?

Storybook, Components/Banner: the four tones, one with an action, one with a wrapping body. Chromatic snapshots are enabled for this story.

WarningMessage's callers are worth a look in the visual diff, since .alert-warning and .banner--warning differ slightly in radius and padding.

Five components render the same icon-plus-message shell by hand, each
assembling Bootstrap alert classes and most reaching for inline styles.
Banner is that shell: a tone, its icon, and children, coloured from
surface/border/icon tokens rather than .alert-*, so it themes without
the hand-written .dark overrides in _alert.scss.

Only danger carries role='alert'. The rest are read in place, so
announcing them would talk over whatever the user was doing.

WarningMessage moves onto it first, being the simplest of the five, and
loses the class-string juggling. OrganisationLimit stops passing
enabledButton, which WarningMessage never read.

ErrorMessage is left alone here: it is already being fixed on
fix/error-message-announce, and should compose over Banner after that
lands. InfoMessage and SuccessMessage need title, action and dismiss
slots first, since they carry collapse state and close buttons.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flagsmith-frontend-preview Ready Ready Preview Sep 3, 2026 1:52pm UTC
flagsmith-frontend-staging Ready Ready Preview Sep 3, 2026 1:52pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Sep 3, 2026 1:52pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…ass props

Both components now compose Banner instead of assembling alert classes
by hand, which removes the inline display hack and the string juggling.

errorMessageClass and warningMessageClass are gone. Neither was a class
name: passing one replaced the component's default layout and flipped
it to display:initial, which is why one caller had to pass flex-1 back
and another passed a class that no stylesheet defines. Of the five call
sites, four were setting an external margin, which now sits on the
parent, and the fifth was buying the display side effect alone.

errorStyles and enabledButton go too. Both had one caller each, and
neither was doing anything a class could not.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… ErrorMessage

messages/ErrorMessage was a near-copy of the one beside it, differing
only in import style, interface vs type, ?? vs ||, and a displayName.
That drift is how enabledButton ended up alive in one copy and dead in
the other. The file stays so existing imports keep working, but it now
re-exports the real one rather than carrying a second implementation.

SuccessMessage renders a Banner and keeps its bold title. Its url,
buttonText, isClosable, close and infoMessageClass props had no callers
at all, and its one successStyles caller was setting a margin the
Banner does not have.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant