[Studio UI] Replace Ant Design default icons in confirm modals (#3848) - #4082
Open
idaiv wants to merge 2 commits into
Open
[Studio UI] Replace Ant Design default icons in confirm modals (#3848)#4082idaiv wants to merge 2 commits into
idaiv wants to merge 2 commits into
Conversation
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>
Contributor
There was a problem hiding this comment.
🟡 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
Iconcomponent. - 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' | ||
| /> | ||
| ), |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Relates to #3848
Summary
All
modal.confirm()calls were showing Ant Design's default yellowExclamationCircleFilledicon. Added a default customalerticon (22×22px) in the centralizedwithConfirm()function ofuseFormModal, matching the form-modal story pattern.This single change fixes all confirm dialogs across:
Callers can still override with an explicit
iconprop. Existing custom icons (useAlertModal,useModal) are unchanged.Test plan
alerticon appears instead of Ant's yellow diamonduseAlertModal.warn()) — verifyalerticon still worksuseAlertModal.error()) — verifyclose-filledicon still workscheckmarkicon still works🤖 Generated with Claude Code