Skip to content

Add destructive variant and rich description support to ConfirmationDialog - #2420

Merged
ravikiranvm merged 1 commit into
mainfrom
confirmation-dialog-destructive-variant
Aug 7, 2026
Merged

Add destructive variant and rich description support to ConfirmationDialog#2420
ravikiranvm merged 1 commit into
mainfrom
confirmation-dialog-destructive-variant

Conversation

@ravikiranvm

Copy link
Copy Markdown
Contributor

Part of OPS-4226.

Syncs ConfirmationDialog with its internal counterpart, which now uses it for the delete-campaign confirmation:

  • confirmButtonVariant prop so the confirm button can render as destructive (uses the existing Button variants — no inline style overrides)
  • description widened from string to ReactNode so callers can emphasize parts of the message (e.g. a highlighted savings amount). Non-breaking: string callers are unaffected
  • Catch-up from the earlier launch-confirmation dialog work: headerLeading (leading visual beside title/description) and className props that were not previously extracted to this repo
  • Adds unit tests for the component (new test file in this repo)

Additional Notes

Component-only change; no consumers in this repo currently pass the new props.

Testing Checklist

Check all that apply:

  • I tested the feature thoroughly, including edge cases

  • I verified all affected areas still work as expected (ui-components tests, react-ui typecheck)

  • Automated tests were added/updated if necessary

  • Changes are backwards compatible with any existing data, otherwise a migration script is provided

🤖 Generated with Claude Code

…ialog

Sync ConfirmationDialog with the internal repo: confirmButtonVariant prop,
ReactNode description, and the headerLeading/className props from the earlier
launch-confirmation work that were not previously extracted. Adds unit tests
for the component (new file in this repo).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 6, 2026 09:05
@linear

linear Bot commented Aug 6, 2026

Copy link
Copy Markdown

OPS-4226

@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates packages/ui-componentsConfirmationDialog to match the internal version used for campaign deletion flows, expanding the component API to support richer header and button styling while remaining compatible with existing string-based callers.

Changes:

  • Add confirmButtonVariant to allow rendering the confirm button with existing Button variants (e.g. destructive).
  • Widen description from string to ReactNode, and add headerLeading + className support for richer header layouts.
  • Add unit tests covering headerLeading, rich description rendering, confirm/cancel callbacks, and destructive button styling.

Review Summary

Blocking: None
Non-blocking: None
Merge recommendation: Ready to merge

Reviewed changes

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

File Description
packages/ui-components/src/components/confirmation-dialog/confirmation-dialog.tsx Expands ConfirmationDialog props for header leading content, rich description, confirm button variant, and className passthrough.
packages/ui-components/src/components/confirmation-dialog/confirmation-dialog.test.tsx Adds RTL/Jest coverage for the new props and expected confirm/cancel behaviors.

@ravikiranvm
ravikiranvm merged commit 1ad79a4 into main Aug 7, 2026
23 checks passed
@ravikiranvm
ravikiranvm deleted the confirmation-dialog-destructive-variant branch August 7, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants