fix(pure-black): migrate ActionModal buttons to MMDS#33147
fix(pure-black): migrate ActionModal buttons to MMDS#33147georgewrmarshall wants to merge 1 commit into
Conversation
…ndary/Link) with mode mapping; fixes pure-black secondary bg by using design-system tokens Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Key consumers of
The change preserves Not selecting SmokeSwap, SmokeStake, SmokeNetworkAbstractions, etc. as those flows don't directly use ActionContent/ActionModal in their critical paths. Performance Test Selection: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Cancel flag ignores explicit button modes
- Removed the isCancel override in mapModeToProps so explicit modes on cancel (e.g., warning, sign, confirm) now map to their intended Primary or danger variants.
Or push these changes by commenting:
@cursor push 94ddf58f77
Preview (94ddf58f77)
diff --git a/app/components/UI/ActionModal/ActionContent/index.js b/app/components/UI/ActionModal/ActionContent/index.js
--- a/app/components/UI/ActionModal/ActionContent/index.js
+++ b/app/components/UI/ActionModal/ActionContent/index.js
@@ -96,9 +96,8 @@
return { variant: ButtonVariant.Link, isDanger: normalized.includes('warning') };
}
- // Secondary for cancel or explicit neutral/secondary/cancel
+ // Secondary for explicit neutral/secondary/cancel
if (
- isCancel ||
normalized === 'neutral' ||
normalized === 'secondary' ||
normalized === 'cancel' ||You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 3408c86. Configure here.
| normalized === 'normal' | ||
| ) { | ||
| return { variant: ButtonVariant.Secondary, isDanger: false }; | ||
| } |
There was a problem hiding this comment.
Cancel flag ignores explicit button modes
Medium Severity
mapModeToProps treats every cancel button as MMDS Secondary because isCancel is checked before legacy modes like warning, sign, and confirm. Callers that put the primary or destructive action on the cancel side lose the intended variant and danger styling.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3408c86. Configure here.
|






Description
Fixes a Pure Black contrast bug on ActionModal secondary buttons (TMCU-1080) by migrating
ActionContentfrom legacyStyledButtonto MMDSButton.With
MM_PURE_BLACK_PREVIEW=truein dark mode, the legacy secondary/cancel button background read too bright against the elevated modal surface (e.g. Settings → Advanced → Reset account).Fix: Replace
StyledButtonwithButtonfrom@metamask/design-system-react-native. AmapModeToPropshelper maps legacy button modes (neutral,warning,transparent-blue, etc.) to MMDSvariant(Primary / Secondary / Link) andisDanger. Cancel still defaults to Secondary; destructive confirms use Primary + danger styling.Scope:
ActionContentonly — shared byActionModal,ActionView, transaction modals, and other confirmation flows. Modal surface styling (getElevatedSurfaceColor+ Pure Black border) is unchanged from prior work.Changelog
CHANGELOG entry: Fixed Pure Black ActionModal secondary button contrast by migrating to MMDS Button
Related issues
Fixes: TMCU-1080
Refs: TMCU-622 (Pure Black epic)
Manual testing steps
Screenshots/Recordings
Before/after recordings in progress by author.
Before
After
Pre-merge author checklist
Performance checks (if applicable)
Pre-merge reviewer checklist
Slack Thread