Skip to content

[Studio UI] Replace Ant Design default icons in confirm modals (#3848) - #4082

Open
idaiv wants to merge 2 commits into
2026.xfrom
fix/modal-icons-replacement
Open

[Studio UI] Replace Ant Design default icons in confirm modals (#3848)#4082
idaiv wants to merge 2 commits into
2026.xfrom
fix/modal-icons-replacement

Conversation

@idaiv

@idaiv idaiv commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Relates to #3848

Summary

All modal.confirm() calls were showing Ant Design's default yellow ExclamationCircleFilled icon. Added a default custom alert icon (22×22px) in the centralized withConfirm() function of useFormModal, matching the form-modal story pattern.

This single change fixes all confirm dialogs across:

  • studio-ui-bundle (35+ calls)
  • 12 external bundles (20+ calls) — copilot, headless-documents, ecommerce-framework, customer-management-framework, data-hub, data-hub-file-export, workflow-designer, studio-dashboards, backend-power-tools, asset-metadata-class-definitions, personalization-bundle, portal-engine

Callers can still override with an explicit icon prop. Existing custom icons (useAlertModal, useModal) are unchanged.

Test plan

  • Open any confirm dialog (delete element, rename, convert document) — verify custom alert icon appears instead of Ant's yellow diamond
  • Open an alert modal (via useAlertModal.warn()) — verify alert icon still works
  • Open an error modal (via useAlertModal.error()) — verify close-filled icon still works
  • Open a success modal — verify checkmark icon still works
  • Open a form input modal (rename) — verify no icon appears (icon: null)
  • Verify icon is vertically centered with the modal title text
  • Verify icon size matches the form-modal story (22×22px)

🤖 Generated with Claude Code

All modal.confirm() calls (35+ in studio-ui-bundle plus 20+ in
external bundles) were showing Ant Design's default yellow
ExclamationCircleFilled icon.

Added a default custom icon (alert, 22x22px) in the centralized
withConfirm() function of useFormModal, matching the form-modal
story pattern. Callers can still override with icon prop.

This single change fixes all confirm dialogs across:
- studio-ui-bundle (35+ calls)
- copilot-bundle, headless-documents, ecommerce-framework,
  customer-management-framework, data-hub, data-hub-file-export,
  workflow-designer, studio-dashboards, backend-power-tools,
  asset-metadata-class-definitions, personalization-bundle,
  portal-engine (20+ calls total)

Existing custom icons (useAlertModal, useModal) are unchanged.
All icon names remain backward-compatible — no renames.

Relates to #3848

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 4, 2026 10:49
@idaiv idaiv added this to the 2026.3.0 milestone Sep 4, 2026
@idaiv
idaiv requested a review from xIrusux September 4, 2026 10:49

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.

🟡 Changes recommended

The default must cover direct modal callers and preserve explicit null icons.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a custom 22×22 alert icon as the default for form-modal confirmations.

Changes:

  • Imports the shared Icon component.
  • Adds a default alert icon while allowing custom icons.
File summaries
File Review
assets/js/src/core/components/modal/form-modal/hooks/use-form-modal.tsx Direct useStudioModal() confirmations remain unaffected, and explicit icon: null overrides are not preserved.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


const baseModalConfig = {
...modalProps,
icon: props.icon ?? (
Comment on lines +212 to +217
icon: props.icon ?? (
<Icon
options={ { width: 22, height: 22 } }
value='alert'
/>
),
@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

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.

2 participants