feat: Swaps new token warning modal#29197
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #29197 +/- ##
==========================================
+ Coverage 82.21% 82.23% +0.02%
==========================================
Files 5079 5107 +28
Lines 133881 134980 +1099
Branches 30031 30369 +338
==========================================
+ Hits 110071 111002 +931
- Misses 16332 16408 +76
- Partials 7478 7570 +92 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| "more": "more", | ||
| "evaluation_disclaimer": "This security review is for evaluation only and does not constitute an endorsement or recommendation to trade." | ||
| "evaluation_disclaimer": "This security review is for evaluation only and does not constitute an endorsement or recommendation to trade.", | ||
| "features": { |
180fb62 to
f49b71a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f49b71a. Configure here.
AI PR Analysis🚫 Merge safe: false | 🟠 Risk: high
AI analysis did not complete. Manual review recommended. |
1b00001 to
9089c55
Compare
|
Will merge this after RC cut today |
9089c55 to
b1dafa9
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Why SmokeTrade: These changes directly affect the bridge and swap flows - specifically the token security warning UI that appears when users select suspicious/malicious destination tokens. The bridge action smoke test and swap tests exercise these flows. Why SmokeConfirmations: Per the SmokeTrade tag description, swap and bridge flows require confirmations - when selecting SmokeTrade for swap/bridge, also select SmokeConfirmations. Risk level is medium: The changes are well-contained within the Bridge/Swap UI and security warning system. The core bridge logic (quote fetching, transaction submission) is unchanged. The main risk is the refactored security data source (from bridge-controller selector to direct securityData) and the redesigned TokenWarningModal UI could break existing test assertions. No other feature areas (accounts, networks, identity, etc.) are affected. Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |




Description
Implements the updated Figma design for the Bridge/Swaps token warning modal, and consolidates the security UI logic into shared utilities.
What changed:
TokenWarningModalredesign — The malicious state uses a stackedContinue anyway/Cancelbutton layout withisDangerstyling. Content is wrapped in aScrollView(fromreact-native-gesture-handler) to handle long feature lists on Android.Removed
selectDestTokenWarningRedux selector — all consumers (BridgeView,SwapsConfirmButton,bridgeslice) now readtoken.securityDatadirectly. Removes a deprecated selector.New
tokenSecurityUtils.ts— single source of truth for Bridge security UI configuration.getBridgeTokenSecurityConfig(type)returns the icon, icon color, severity, and label for eachSecurityDataType.getSecurityWarnings(token)moved here fromtokenUtils.tsfor cohesion.TokenSelectorItemicon fix —getSecurityTagnow delegates togetBridgeTokenSecurityConfig, fixing a bug where the Warning and Malicious icons were swapped.Token warning banner in zero-state — the banner in
BridgeViewnow renders even before a quote is available, so users see the warning as soon as they select a flagged token.i18n for security feature labels — 39 new keys added to
locales/languages/en.jsonundersecurity_trust.features.positive.*andsecurity_trust.features.negative.*.POSITIVE_FEATURE_LABELSandNEGATIVE_FEATURE_LABELSinsecurityUtils.tsnow callstrings()instead of using hardcoded English.NEGATIVE_FEATURE_LABELSis exported so the modal can look up per-feature titles.Changelog
CHANGELOG entry: Updated Bridge/Swaps token warning modal to match new design and fixed swapped warning/malicious icons in the token selector
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-4374
Manual testing steps
Screenshots/Recordings
Before
After
Screen.Recording.2026-04-22.at.4.45.36.PM.mov
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Changes the Bridge/Swaps token-warning gating path (banner + confirm-button routing) to rely on
destToken.securityDataand new feature lists, which could affect when/why users are blocked or allowed to proceed. Mostly UI/UX and selector refactors, but touches pre-transaction warnings.Overview
Updates Bridge/Swaps token-warning handling to read
destToken.securityDatadirectly (removingselectDestTokenWarning) and to pass feature lists intoTokenWarningModalinstead of a single backend description.Redesigns
TokenWarningModalto match new Figma (scrollable content, per-feature rows with localized labels, and a danger-styled malicious execution flow using stackedContinue anyway/Cancelbuttons). The Bridge warning banner now renders whenever the destination token is flagged (including zero-state before quotes) and uses sharedgetBridgeTokenSecurityConfigfor consistent icons/colors.Adds
tokenSecurityUtilsas the shared source of truth for Bridge security UI config (icons/severity/labels and warning extraction), fixes the token selector malicious icon, and expands i18n (security_trust.features.*plus new modal strings) while updatingsecurityUtilsto use translated labels.Reviewed by Cursor Bugbot for commit 78020b2. Bugbot is set up for automated code reviews on this repo. Configure here.