Skip to content

feat(upselling-kit): add dismiss option to UpsellingAlert#4732

Open
daviz-fct wants to merge 1 commit into
mainfrom
feat/upselling-alert-dismiss
Open

feat(upselling-kit): add dismiss option to UpsellingAlert#4732
daviz-fct wants to merge 1 commit into
mainfrom
feat/upselling-alert-dismiss

Conversation

@daviz-fct

@daviz-fct daviz-fct commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

Adds an optional dismiss affordance to UpsellingAlert, following the same pattern already used by F0Alert. When an onDismiss callback is provided, a close button is shown so users can dismiss the upsell; the consumer owns the dismiss behaviour (e.g. persist it to hide the alert for N days and let it reappear afterwards).

Screenshots (if applicable)

image

Implementation details

  • feat: add optional onDismiss prop to UpsellingAlert; when provided, renders an sm outline close button with the Cross icon, consistent with F0Alert
  • feat: position the dismiss button to the right of the upselling action and pin it to the top-right in the stacked (responsive) layout, aligning it with the action button
  • feat: wrap the close button in a leaf component so useI18n() is only read when onDismiss is set, keeping the alert renderable without an I18nProvider
  • docs: add a Dismissible story and an onDismiss boolean control to toggle the dismiss button, with an example handler that hides the alert for a number of days

Add an optional `onDismiss` callback to UpsellingAlert. When provided, a
close button is rendered following the F0Alert pattern (sm outline button
with the Cross icon), positioned to the right of the upselling action and
pinned to the top-right in the stacked responsive layout. The consumer
decides what happens on dismiss (e.g. hide for N days and reappear).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added feat react Changes affect packages/react labels Jul 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ No New Circular Dependencies

No new circular dependencies detected. Current count: 0

@github-actions

Copy link
Copy Markdown
Contributor

📦 Alpha Package Version Published

Use pnpm i github:factorialco/f0#npm/alpha-pr-4732 to install the package

Use pnpm i github:factorialco/f0#6a55f37e2bcfd41845225f0891fe6164f5c0f37e to install this specific commit

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Visual review for your branch is published 🔍

Here are the links to:

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Breaking public API changes (1)

These public exports were renamed/removed, or had a property/parameter removed, retyped, or newly required compared to main — that breaks consumers. Adding new exports or new optional props is always safe and is not flagged. If a breaking change is intentional, note it in the PR description and use a feat!:/BREAKING CHANGE commit so the release is a major bump.

Comparing f0, experimental and ai against main. Adding components, types, or optional props is safe. This check is non-blocking.

f0

  • ✏️ UpsellingAlertbreaking change

    • type changed: WithDataTestIdReturnType<({ icon, title, description, action, }: UpsellingAlertProps) => Element>WithDataTestIdReturnType<({ icon, title, description, action, onDismiss, }: UpsellingAlertProps) => Element>
    before → after
    // before
    WithDataTestIdReturnType<({ icon, title, description, action, }: UpsellingAlertProps) => Element>
    // after
    WithDataTestIdReturnType<({ icon, title, description, action, onDismiss, }: UpsellingAlertProps) => Element>

⚠️ Could not analyze component-status (no-base) — a build may have failed; results may be incomplete.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for packages/react

Status Category Percentage Covered / Total
🔵 Lines 59.28% 20747 / 34994
🔵 Statements 58.33% 21753 / 37292
🔵 Functions 51.42% 4815 / 9364
🔵 Branches 51.99% 14972 / 28794
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/react/src/sds/UpsellingKit/UpsellingAlert/index.tsx 0% 0% 0% 0% 55-143
Generated in workflow #15727 for commit e2f3f5c by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking changes feat react Changes affect packages/react

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant