Skip to content

feat: add security alert badges on asset picker#41946

Merged
GeorgeGkas merged 8 commits intoswaps4228-token-warningsfrom
swaps-4371
Apr 22, 2026
Merged

feat: add security alert badges on asset picker#41946
GeorgeGkas merged 8 commits intoswaps4228-token-warningsfrom
swaps-4371

Conversation

@GeorgeGkas
Copy link
Copy Markdown
Contributor

@GeorgeGkas GeorgeGkas commented Apr 20, 2026

Description

The Bridge token list now surfaces security signals returned by the bridge API for each asset. Previously, the token picker only showed a "verified" badge based on the boolean isVerified field, and the securityData object from the API response was not being consumed at all — it was silently dropped in toBridgeToken because the field was never destructured from the payload.

Changes:

  1. Schema & types (tokens.ts) — Added the BridgeAssetSecurityDataType enum (Info, Benign, Verified, Warning, Spam, Malicious) and the BridgeAssetSecurityData superstruct schema, intersected into BridgeAssetV2Schema so the full security payload is validated and typed end-to-end.

  2. Bug fix (utils.tstoBridgeToken) — securityData from the API payload was never passed through to the returned BridgeToken. Fixed by destructuring it from payload and using tokenMetadata?.securityData ?? securityData so locally-cached metadata can override, but the API value is the default. Also updated the isVerified derivation to treat securityData.type === VERIFIED (from tokenMetadata) as truthy.

  3. AssetBanner component (asset-banner.tsx) — Extracted the badge/tag rendering logic from BridgeAsset into a dedicated component with three states:

    • VERIFIED (or isVerified: true) → blue verified icon
    • WARNING / SPAM → "Suspicious" warning tag
    • MALICIOUS → "Malicious" error tag
    • Everything else (INFO, BENIGN, absent) → nothing rendered
  4. Locale keys — Added bridgeSuspicious and bridgeMalicious to en and en_GB.

  5. Tests — New asset-banner.test.tsx covers all banner states directly. Verified-badge tests migrated out of asset.test.tsx. New utils.test.ts cases cover the securityData payload passthrough and precedence rules.

Changelog

CHANGELOG entry: Tokens in the Bridge asset picker now display a "Suspicious" or "Malicious" warning tag for assets flagged by the bridge API security service.

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-4371

Manual testing steps

  1. Open the Bridge page and click either the source or destination asset picker.
  2. Search for or scroll through the token list — tokens returned with securityData.type: "Verified" should show a blue verified icon, same as before.
  3. If the backend returns a token with securityData.type: "Warning" or "Spam", a yellow "Suspicious" tag should appear next to the token symbol.
  4. If the backend returns a token with securityData.type: "Malicious", a red "Malicious" tag should appear next to the token symbol.
  5. Tokens with securityData.type: "Info", "Benign", or no securityData should show no badge or tag.
  6. A token where isVerified: true should always show the verified icon, even if securityData is Warning, Spam, or Malicious.

Screenshots/Recordings

Before

After

Screenshot 2026-04-20 at 3 27 58 PM

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Changes how bridge tokens are typed and how isVerified/securityData are derived, which can affect security signaling in the asset picker UI; impact is limited to presentation and token metadata mapping with good test coverage.

Overview
Bridge asset data now preserves and validates API-provided securityData (new BridgeAssetSecurityDataType + schema), and toBridgeToken propagates it while treating securityData.type === VERIFIED as verified.

The asset picker UI replaces the inline verified icon with a new AssetBanner that shows a verified badge, Suspicious tag (Warning/Spam), or Malicious tag, backed by new locale strings and updated/added tests and snapshots.

Reviewed by Cursor Bugbot for commit c757780. Bugbot is set up for automated code reviews on this repo. Configure here.

@GeorgeGkas GeorgeGkas requested a review from a team as a code owner April 20, 2026 12:28
@metamaskbot metamaskbot added the team-swaps-and-bridge Swaps and Bridge team label Apr 20, 2026
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented Apr 20, 2026

✨ Files requiring CODEOWNER review ✨

🔄 @MetaMask/swaps-engineers (13 files, +426 -168)
  • 📁 ui/
    • 📁 ducks/
      • 📁 bridge/
        • 📄 bridge.test.ts +2 -0
        • 📄 selectors.test.ts +4 -0
        • 📄 utils.test.ts +80 -0
        • 📄 utils.ts +8 -1
    • 📁 hooks/
      • 📁 bridge/
        • 📁 __snapshots__/
          • 📄 usePrefillFromSearchQuery.test.ts.snap +8 -0
          • 📄 usePrefillFromBridgeState.test.ts +3 -0
    • 📁 pages/
      • 📁 bridge/
        • 📁 prepare/
          • 📁 __snapshots__/
            • 📄 bridge-input-group.test.tsx.snap +9 -0
          • 📁 components/
            • 📁 bridge-asset-picker/
              • 📁 __snapshots__/
                • 📄 asset.test.tsx.snap +0 -106
                • 📄 asset-banner.test.tsx +200 -0
                • 📄 asset-banner.tsx +78 -0
                • 📄 asset.test.tsx +0 -52
                • 📄 asset.tsx +2 -8
        • 📁 utils/
          • 📄 tokens.ts +32 -1

@github-actions
Copy link
Copy Markdown
Contributor

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.

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented Apr 20, 2026

Builds ready [32696e9]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 8 warn · 🔴 0 fail)

Baseline (latest main): 71bd826 | Date: 10/14/58243 | Pipeline: 24667127633 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-browserify
loadNewAccount🟡 [Show logs]
confirmTx🟡 [Show logs]
bridgeUserActions🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: -54%
  • loadNewAccount/total: -54%
  • bridgeUserActions/bridge_load_page: -15%
  • bridgeUserActions/bridge_load_asset_picker: -25%
  • bridgeUserActions/bridge_search_token: -29%
  • bridgeUserActions/total: -26%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 2.7s
  • 🟡 confirmTx/FCP: p75 2.6s
  • 🟡 bridgeUserActions/FCP: p75 2.6s
Startup Benchmarks · Samples: 100
Benchmarkchrome-browserifychrome-webpackfirefox-browserifyfirefox-webpack
startupStandardHome🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/uiStartup: -24%
  • startupStandardHome/load: -13%
  • startupStandardHome/domContentLoaded: -16%
  • startupStandardHome/firstPaint: -11%
  • startupStandardHome/firstReactRender: -10%
  • startupStandardHome/initialActions: -33%
  • startupStandardHome/loadScripts: -18%
  • startupStandardHome/numNetworkReqs: -37%
  • startupStandardHome/uiStartup: -14%
  • startupStandardHome/firstPaint: +31%
  • startupStandardHome/backgroundConnect: -29%
  • startupStandardHome/firstReactRender: -19%
  • startupStandardHome/numNetworkReqs: -44%
  • startupStandardHome/uiStartup: -31%
  • startupStandardHome/load: -24%
  • startupStandardHome/domContentLoaded: -24%
  • startupStandardHome/domInteractive: -66%
  • startupStandardHome/backgroundConnect: -12%
  • startupStandardHome/firstReactRender: -26%
  • startupStandardHome/initialActions: -33%
  • startupStandardHome/loadScripts: -25%
  • startupStandardHome/setupStore: -32%
  • startupStandardHome/numNetworkReqs: -34%
  • startupStandardHome/uiStartup: -11%
  • startupStandardHome/domInteractive: -28%
  • startupStandardHome/initialActions: +14%
  • startupStandardHome/setupStore: -60%
  • startupStandardHome/numNetworkReqs: -34%
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-browserify
onboardingImportWallet🟢 [Show logs]
onboardingNewWallet🟢 [Show logs]
assetDetails🟡 [Show logs]
solanaAssetDetails🟡 [Show logs]
importSrpHome🟡 [Show logs]
sendTransactions🟡 [Show logs]
swap🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: -84%
  • onboardingImportWallet/metricsToWalletReadyScreen: -26%
  • onboardingImportWallet/doneButtonToHomeScreen: -75%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +27%
  • onboardingImportWallet/total: -44%
  • onboardingNewWallet/srpButtonToPwForm: -77%
  • onboardingNewWallet/createPwToRecoveryScreen: +29%
  • onboardingNewWallet/skipBackupToMetricsScreen: -66%
  • onboardingNewWallet/doneButtonToAssetList: -30%
  • onboardingNewWallet/total: -31%
  • assetDetails/assetClickToPriceChart: -82%
  • assetDetails/total: -82%
  • solanaAssetDetails/assetClickToPriceChart: -67%
  • solanaAssetDetails/total: -67%
  • importSrpHome/openAccountMenuAfterLogin: -52%
  • importSrpHome/homeAfterImportWithNewWallet: -70%
  • importSrpHome/total: -61%
  • sendTransactions/selectTokenToSendFormLoaded: +21%
  • sendTransactions/reviewTransactionToConfirmationPage: +37%
  • sendTransactions/total: +35%
  • swap/openSwapPageFromHome: -97%
  • swap/fetchAndDisplaySwapQuotes: +31%
  • swap/total: +11%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 assetDetails/FCP: p75 2.7s
  • 🟡 solanaAssetDetails/FCP: p75 2.5s
  • 🟡 importSrpHome/FCP: p75 2.5s
  • 🟡 sendTransactions/FCP: p75 2.5s
  • 🟡 swap/FCP: p75 2.5s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-browserify
dappPageLoad🟢 [Show logs]
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.12 KiB (0.02%)
  • ui: 14.2 KiB (0.17%)
  • common: 96 Bytes (0%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented Apr 20, 2026

Builds ready [f7f2d41]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 8 warn · 🔴 0 fail)

Baseline (latest main): 71bd826 | Date: 10/14/58243 | Pipeline: 24670084066 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-browserify
loadNewAccount🟡 [Show logs]
confirmTx🟡 [Show logs]
bridgeUserActions🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: -70%
  • loadNewAccount/total: -70%
  • bridgeUserActions/bridge_load_page: -19%
  • bridgeUserActions/bridge_load_asset_picker: -38%
  • bridgeUserActions/bridge_search_token: -22%
  • bridgeUserActions/total: -27%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 2.5s
  • 🟡 confirmTx/FCP: p75 2.5s
  • 🟡 bridgeUserActions/FCP: p75 2.5s
Startup Benchmarks · Samples: 100

⚠️ Missing data: firefox/browserify/startupStandardHome, firefox/webpack/startupPowerUserHome

Benchmarkchrome-browserifychrome-webpackfirefox-webpack
startupStandardHome🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/uiStartup: -26%
  • startupStandardHome/load: -15%
  • startupStandardHome/domContentLoaded: -17%
  • startupStandardHome/firstReactRender: -14%
  • startupStandardHome/initialActions: -33%
  • startupStandardHome/loadScripts: -20%
  • startupStandardHome/numNetworkReqs: -37%
  • startupStandardHome/uiStartup: -23%
  • startupStandardHome/load: -18%
  • startupStandardHome/domContentLoaded: -18%
  • startupStandardHome/backgroundConnect: -41%
  • startupStandardHome/firstReactRender: -27%
  • startupStandardHome/loadScripts: -18%
  • startupStandardHome/setupStore: -20%
  • startupStandardHome/numNetworkReqs: -44%
  • startupStandardHome/uiStartup: -14%
  • startupStandardHome/domInteractive: -51%
  • startupStandardHome/initialActions: +14%
  • startupStandardHome/setupStore: -57%
  • startupStandardHome/numNetworkReqs: -32%
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-browserify
onboardingImportWallet🟢 [Show logs]
onboardingNewWallet🟢 [Show logs]
assetDetails🟡 [Show logs]
solanaAssetDetails🟡 [Show logs]
importSrpHome🟡 [Show logs]
sendTransactions🟡 [Show logs]
swap🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: -85%
  • onboardingImportWallet/metricsToWalletReadyScreen: -35%
  • onboardingImportWallet/doneButtonToHomeScreen: -76%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +27%
  • onboardingImportWallet/total: -42%
  • onboardingNewWallet/srpButtonToPwForm: -77%
  • onboardingNewWallet/skipBackupToMetricsScreen: -66%
  • onboardingNewWallet/agreeButtonToOnboardingSuccess: +18%
  • onboardingNewWallet/doneButtonToAssetList: -22%
  • onboardingNewWallet/total: -24%
  • assetDetails/assetClickToPriceChart: -57%
  • assetDetails/total: -57%
  • solanaAssetDetails/assetClickToPriceChart: -77%
  • solanaAssetDetails/total: -77%
  • importSrpHome/loginToHomeScreen: -13%
  • importSrpHome/openAccountMenuAfterLogin: -42%
  • importSrpHome/homeAfterImportWithNewWallet: -68%
  • importSrpHome/total: -60%
  • sendTransactions/openSendPageFromHome: -13%
  • sendTransactions/reviewTransactionToConfirmationPage: +38%
  • sendTransactions/total: +36%
  • swap/openSwapPageFromHome: -96%
  • swap/fetchAndDisplaySwapQuotes: +31%
  • swap/total: +11%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 assetDetails/FCP: p75 2.5s
  • 🟡 solanaAssetDetails/FCP: p75 2.5s
  • 🟡 importSrpHome/FCP: p75 2.5s
  • 🟡 sendTransactions/FCP: p75 2.5s
  • 🟡 swap/FCP: p75 2.5s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-browserify
dappPageLoad🟢 [Show logs]
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 2.92 KiB (0.03%)
  • common: 101 Bytes (0%)

Copy link
Copy Markdown
Contributor

@infiniteflower infiniteflower left a comment

Choose a reason for hiding this comment

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

Do we need to handle metrics in this PR for token warnings?

@GeorgeGkas
Copy link
Copy Markdown
Contributor Author

@infiniteflower no metrics handling are required for this task.

GeorgeGkas and others added 5 commits April 21, 2026 15:11
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
This fixes contents overflowing on Settings > Transaction Shield/Claims
pages

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: Fix content overflow on Transaction shield pages

## **Related issues**

Fixes:

## **Manual testing steps**

1. Login with an account with shield subcscription
2. Go to Menu > Settings > Transaction Shield
3. Make browser height smaller until scroll bar shows up (try scrolling
down)
4. Go to Menu > Settings > Transaction Shield > Claims > Submit a claim
5. Try scrolling down

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

https://github.com/user-attachments/assets/f88b6df6-a903-4f04-8029-77675cec0272

<!-- [screenshots/recordings] -->

### **After**

https://github.com/user-attachments/assets/a91c6efb-00ba-4543-a9c0-bbc25176b166

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> UI-only className changes to scrolling/padding with no changes to
business logic, data handling, or API behavior.
> 
> **Overview**
> Prevents content overflow on Transaction Shield settings screens by
making the main page containers vertically scrollable.
> 
> Adds `overflow-y-auto` (and bottom padding) to the root `Box` wrappers
in `transaction-shield.tsx`, `manage-shield-plan.tsx` (including its
error state), and the Claims `claims-form.tsx` submit page so long
content can be scrolled instead of clipping.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1382db8. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
#41966)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

Simply moves the backup and sync tab and experimental tab to the
settings-v2 folder and removes them from the legacy folder.

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk refactor that primarily changes route wiring and local
imports; main risk is broken navigation/lazy-loading if any import paths
or registry entries are incorrect.
> 
> **Overview**
> Moves the **Backup & Sync** and **Experimental** settings tabs fully
into `ui/pages/settings-v2`, updating their internal imports to use the
local `settings-v2` `shared`/`types`/`search-config` modules.
> 
> Updates `settings-v2/settings-registry.ts` to lazy-load these tabs
from their new `settings-v2` locations (instead of legacy
`ui/pages/settings/*`), and adjusts Jest console baselines to track
warnings under the new test file paths.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
00ad86e. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
… balance` (#41994)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
The test is flaky as sometimes there are 2 requests made to the assets
API, leading to a different balance (only Tron token).

Now we apply the assets mock always, so we ensure we'll always get the
same tokens, no matter if 1 or 2 calls happen.

<img width="1069" height="510" alt="image"
src="https://github.com/user-attachments/assets/598fe429-bebc-4b82-9d20-3a66cfacf47d"
/>

Failed test had $1.79 without the rest of tokens loaded:
<img width="1152" height="836" alt="image"
src="https://github.com/user-attachments/assets/26dfc75e-daec-4b19-aeff-484ba0622f0e"
/>


Expected: all tokens loaded, so balance is $10.58

<img width="1192" height="917" alt="image"
src="https://github.com/user-attachments/assets/39faa494-2077-433e-9a9c-a96b4688e744"
/>


## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry:

## **Related issues**

Fixes:

## **Manual testing steps**

1. Check ci

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk because changes are confined to E2E test code and mocks; main
impact is potential change in test timing/expectations, not production
behavior.
> 
> **Overview**
> Fixes Tron E2E balance-test flakiness by making the `GET
https://tokens.api.cx.metamask.io/v3/assets` mock in `mockTronAssets`
apply to every request (via `.always()`), ensuring consistent token
lists even when the app calls the endpoint multiple times.
> 
> Simplifies `NonEvmHomepage.checkPageIsLoaded` by removing an extra
delay and a custom polling loop, relying on a direct `waitForSelector`
when asserting an `amount`, and updates the Tron USD-balance test
comment to reflect the expected aggregated fiat total (`$10.18`).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
385911e. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@GeorgeGkas GeorgeGkas requested review from a team as code owners April 21, 2026 12:12
@GeorgeGkas GeorgeGkas changed the base branch from main to swaps4228-token-warnings April 21, 2026 12:12
@github-actions github-actions Bot added size-XL and removed size-M labels Apr 21, 2026
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented Apr 21, 2026

Builds ready [2921e10]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 8 warn · 🔴 0 fail)

Baseline (latest main): 71bd826 | Date: 10/14/58243 | Pipeline: 24721836822 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-browserify
loadNewAccount🟡 [Show logs]
confirmTx🟡 [Show logs]
bridgeUserActions🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: -53%
  • loadNewAccount/total: -53%
  • bridgeUserActions/bridge_load_page: -15%
  • bridgeUserActions/bridge_load_asset_picker: -27%
  • bridgeUserActions/bridge_search_token: -21%
  • bridgeUserActions/total: -26%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 2.6s
  • 🟡 confirmTx/FCP: p75 2.6s
  • 🟡 confirmTx/LCP: p75 2.5s
  • 🟡 bridgeUserActions/FCP: p75 2.6s
Startup Benchmarks · Samples: 100
Benchmarkchrome-browserifychrome-webpackfirefox-browserifyfirefox-webpack
startupStandardHome🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/uiStartup: -22%
  • startupStandardHome/load: -11%
  • startupStandardHome/domContentLoaded: -13%
  • startupStandardHome/firstReactRender: -14%
  • startupStandardHome/initialActions: -33%
  • startupStandardHome/loadScripts: -16%
  • startupStandardHome/numNetworkReqs: -37%
  • startupStandardHome/uiStartup: -16%
  • startupStandardHome/load: -11%
  • startupStandardHome/domContentLoaded: -11%
  • startupStandardHome/domInteractive: +17%
  • startupStandardHome/firstPaint: +13%
  • startupStandardHome/backgroundConnect: -36%
  • startupStandardHome/firstReactRender: -19%
  • startupStandardHome/loadScripts: -11%
  • startupStandardHome/numNetworkReqs: -44%
  • startupStandardHome/domInteractive: -56%
  • startupStandardHome/backgroundConnect: +14%
  • startupStandardHome/initialActions: +33%
  • startupStandardHome/numNetworkReqs: -37%
  • startupStandardHome/uiStartup: -15%
  • startupStandardHome/domInteractive: -50%
  • startupStandardHome/backgroundConnect: -11%
  • startupStandardHome/initialActions: -43%
  • startupStandardHome/setupStore: -60%
  • startupStandardHome/numNetworkReqs: -34%
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-browserify
onboardingImportWallet🟢 [Show logs]
onboardingNewWallet🟢 [Show logs]
assetDetails🟡 [Show logs]
solanaAssetDetails🟡 [Show logs]
importSrpHome🟡 [Show logs]
sendTransactions🟡 [Show logs]
swap🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: -83%
  • onboardingImportWallet/metricsToWalletReadyScreen: -34%
  • onboardingImportWallet/doneButtonToHomeScreen: -76%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +27%
  • onboardingImportWallet/total: -44%
  • onboardingNewWallet/srpButtonToPwForm: -78%
  • onboardingNewWallet/skipBackupToMetricsScreen: -66%
  • onboardingNewWallet/doneButtonToAssetList: -29%
  • onboardingNewWallet/total: -29%
  • assetDetails/assetClickToPriceChart: -55%
  • assetDetails/total: -55%
  • solanaAssetDetails/assetClickToPriceChart: -67%
  • solanaAssetDetails/total: -67%
  • importSrpHome/openAccountMenuAfterLogin: -43%
  • importSrpHome/homeAfterImportWithNewWallet: -73%
  • importSrpHome/total: -65%
  • sendTransactions/openSendPageFromHome: -22%
  • sendTransactions/selectTokenToSendFormLoaded: +12%
  • sendTransactions/reviewTransactionToConfirmationPage: +33%
  • sendTransactions/total: +32%
  • swap/openSwapPageFromHome: -96%
  • swap/fetchAndDisplaySwapQuotes: +31%
  • swap/total: +11%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 assetDetails/FCP: p75 2.6s
  • 🟡 solanaAssetDetails/FCP: p75 2.6s
  • 🟡 importSrpHome/FCP: p75 2.5s
  • 🟡 sendTransactions/FCP: p75 2.5s
  • 🟡 swap/FCP: p75 2.6s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-browserify
dappPageLoad🟢 [Show logs]
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.84 MiB (100%)
  • ui: 8.35 MiB (100%)
  • common: 12.89 MiB (100%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented Apr 22, 2026

Builds ready [91dffab]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 8 warn · 🔴 0 fail)

Baseline (latest main): 71bd826 | Date: 10/14/58243 | Pipeline: 24769622992 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-browserify
loadNewAccount🟡 [Show logs]
confirmTx🟡 [Show logs]
bridgeUserActions🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: -51%
  • loadNewAccount/total: -51%
  • bridgeUserActions/bridge_load_page: -20%
  • bridgeUserActions/bridge_load_asset_picker: -36%
  • bridgeUserActions/bridge_search_token: -27%
  • bridgeUserActions/total: -28%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 2.5s
  • 🟡 confirmTx/FCP: p75 2.5s
  • 🟡 bridgeUserActions/FCP: p75 2.5s
Startup Benchmarks · Samples: 100
Benchmarkchrome-browserifychrome-webpackfirefox-browserifyfirefox-webpack
startupStandardHome🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/uiStartup: -24%
  • startupStandardHome/load: -14%
  • startupStandardHome/domContentLoaded: -16%
  • startupStandardHome/firstPaint: -18%
  • startupStandardHome/initialActions: -33%
  • startupStandardHome/loadScripts: -19%
  • startupStandardHome/setupStore: +14%
  • startupStandardHome/numNetworkReqs: -37%
  • startupStandardHome/uiStartup: -20%
  • startupStandardHome/load: -15%
  • startupStandardHome/domContentLoaded: -14%
  • startupStandardHome/firstPaint: +22%
  • startupStandardHome/backgroundConnect: -35%
  • startupStandardHome/firstReactRender: -30%
  • startupStandardHome/loadScripts: -14%
  • startupStandardHome/setupStore: -13%
  • startupStandardHome/numNetworkReqs: -44%
  • startupStandardHome/uiStartup: -11%
  • startupStandardHome/domInteractive: -56%
  • startupStandardHome/initialActions: +33%
  • startupStandardHome/numNetworkReqs: -32%
  • startupStandardHome/uiStartup: -17%
  • startupStandardHome/domInteractive: -54%
  • startupStandardHome/initialActions: +14%
  • startupStandardHome/setupStore: -60%
  • startupStandardHome/numNetworkReqs: -34%
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-browserify
onboardingImportWallet🟢 [Show logs]
onboardingNewWallet🟢 [Show logs]
assetDetails🟡 [Show logs]
solanaAssetDetails🟡 [Show logs]
importSrpHome🟡 [Show logs]
sendTransactions🟡 [Show logs]
swap🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: -85%
  • onboardingImportWallet/confirmSrpToPwForm: -10%
  • onboardingImportWallet/metricsToWalletReadyScreen: -42%
  • onboardingImportWallet/doneButtonToHomeScreen: -78%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +26%
  • onboardingImportWallet/total: -46%
  • onboardingNewWallet/srpButtonToPwForm: -77%
  • onboardingNewWallet/skipBackupToMetricsScreen: -67%
  • onboardingNewWallet/doneButtonToAssetList: -24%
  • onboardingNewWallet/total: -26%
  • solanaAssetDetails/assetClickToPriceChart: -72%
  • solanaAssetDetails/total: -72%
  • importSrpHome/openAccountMenuAfterLogin: -70%
  • importSrpHome/homeAfterImportWithNewWallet: -67%
  • importSrpHome/total: -60%
  • sendTransactions/selectTokenToSendFormLoaded: +13%
  • sendTransactions/reviewTransactionToConfirmationPage: +35%
  • sendTransactions/total: +34%
  • swap/openSwapPageFromHome: -96%
  • swap/fetchAndDisplaySwapQuotes: +31%
  • swap/total: +11%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 assetDetails/FCP: p75 2.4s
  • 🟡 solanaAssetDetails/FCP: p75 2.5s
  • 🟡 importSrpHome/FCP: p75 2.5s
  • 🟡 sendTransactions/FCP: p75 2.6s
  • 🟡 swap/FCP: p75 2.5s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-browserify
dappPageLoad🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • dappPageLoad/pageLoadTime: +14%
  • dappPageLoad/domContentLoaded: +11%
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.84 MiB (100%)
  • ui: 8.35 MiB (100%)
  • common: 12.89 MiB (100%)

@sonarqubecloud
Copy link
Copy Markdown

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented Apr 22, 2026

Builds ready [c757780]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 8 warn · 🔴 0 fail)

Baseline (latest main): 71bd826 | Date: 10/14/58243 | Pipeline: 24770624271 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-browserify
loadNewAccount🟡 [Show logs]
confirmTx🟡 [Show logs]
bridgeUserActions🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: -52%
  • loadNewAccount/total: -52%
  • bridgeUserActions/bridge_load_page: -16%
  • bridgeUserActions/bridge_load_asset_picker: -27%
  • bridgeUserActions/bridge_search_token: -27%
  • bridgeUserActions/total: -26%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 2.6s
  • 🟡 confirmTx/FCP: p75 2.6s
  • 🟡 bridgeUserActions/FCP: p75 2.6s
Startup Benchmarks · Samples: 100
Benchmarkchrome-browserifychrome-webpackfirefox-browserifyfirefox-webpack
startupStandardHome🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/uiStartup: -23%
  • startupStandardHome/load: -12%
  • startupStandardHome/domContentLoaded: -14%
  • startupStandardHome/firstPaint: -17%
  • startupStandardHome/initialActions: -33%
  • startupStandardHome/loadScripts: -17%
  • startupStandardHome/setupStore: +21%
  • startupStandardHome/numNetworkReqs: -37%
  • startupStandardHome/uiStartup: -18%
  • startupStandardHome/load: -13%
  • startupStandardHome/domContentLoaded: -12%
  • startupStandardHome/firstPaint: -12%
  • startupStandardHome/backgroundConnect: -37%
  • startupStandardHome/firstReactRender: -23%
  • startupStandardHome/loadScripts: -13%
  • startupStandardHome/numNetworkReqs: -44%
  • startupStandardHome/uiStartup: -11%
  • startupStandardHome/domInteractive: -54%
  • startupStandardHome/backgroundConnect: +14%
  • startupStandardHome/initialActions: +33%
  • startupStandardHome/numNetworkReqs: -34%
  • startupStandardHome/uiStartup: -10%
  • startupStandardHome/domInteractive: -25%
  • startupStandardHome/initialActions: +14%
  • startupStandardHome/setupStore: -50%
  • startupStandardHome/numNetworkReqs: -34%
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-browserify
onboardingImportWallet🟢 [Show logs]
onboardingNewWallet🟢 [Show logs]
assetDetails🟡 [Show logs]
solanaAssetDetails🟡 [Show logs]
importSrpHome🟡 [Show logs]
sendTransactions🟡 [Show logs]
swap🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: -86%
  • onboardingImportWallet/metricsToWalletReadyScreen: -49%
  • onboardingImportWallet/doneButtonToHomeScreen: -76%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +17%
  • onboardingImportWallet/total: -45%
  • onboardingNewWallet/srpButtonToPwForm: -77%
  • onboardingNewWallet/skipBackupToMetricsScreen: -66%
  • onboardingNewWallet/doneButtonToAssetList: -22%
  • onboardingNewWallet/total: -24%
  • assetDetails/assetClickToPriceChart: -49%
  • assetDetails/total: -49%
  • solanaAssetDetails/assetClickToPriceChart: -71%
  • solanaAssetDetails/total: -71%
  • importSrpHome/loginToHomeScreen: -13%
  • importSrpHome/openAccountMenuAfterLogin: -83%
  • importSrpHome/homeAfterImportWithNewWallet: -68%
  • importSrpHome/total: -61%
  • sendTransactions/openSendPageFromHome: -28%
  • sendTransactions/selectTokenToSendFormLoaded: -10%
  • sendTransactions/reviewTransactionToConfirmationPage: +36%
  • sendTransactions/total: +34%
  • swap/openSwapPageFromHome: -96%
  • swap/fetchAndDisplaySwapQuotes: +31%
  • swap/total: +11%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 assetDetails/INP: p75 208ms
  • 🟡 assetDetails/FCP: p75 2.6s
  • 🟡 solanaAssetDetails/FCP: p75 2.6s
  • 🟡 importSrpHome/FCP: p75 2.8s
  • 🟡 sendTransactions/FCP: p75 2.5s
  • 🟡 swap/FCP: p75 2.4s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-browserify
dappPageLoad🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • dappPageLoad/pageLoadTime: -20%
  • dappPageLoad/domContentLoaded: -22%
  • dappPageLoad/firstPaint: -18%
  • dappPageLoad/firstContentfulPaint: -18%
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.84 MiB (100%)
  • ui: 8.35 MiB (100%)
  • common: 12.89 MiB (100%)

@GeorgeGkas GeorgeGkas merged commit cf56ff2 into swaps4228-token-warnings Apr 22, 2026
202 checks passed
@GeorgeGkas GeorgeGkas deleted the swaps-4371 branch April 22, 2026 09:57
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size-M team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants