Skip to content

Conversation

micaelae
Copy link
Member

@micaelae micaelae commented Oct 13, 2025

Description

Problem: The Recipient modal's open/close state is determined using the previous and currently selected network states within the useDestinationAccount hook, which could get out of sync with the UI's selected networks.

Solution

  • If the selected account group has a matching dest account, use it and don't show the recipient modal
  • Otherwise open the modal

Open in GitHub Codespaces

Changelog

CHANGELOG entry: fix: hide recipient modal if there is a matching account in the selected bridge destination network

Related issues

Fixes: #36759

Manual testing steps

  1. Load swap page
  2. Select Solana as destination network
  3. Recipient modal should not be open
  4. Load swap page
  5. Select SOL as src
  6. Select eth:MUSD as src
  7. Recipient modal should not be open

Screenshots/Recordings

Before

See linked bug ticket

After

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

Use default destination account when available and close the recipient picker; otherwise open it, removing EVM/non‑EVM transition logic.

  • Bridge UI (ui/pages/bridge/hooks/useDestinationAccount.ts):
    • Selection/Modal Logic: If defaultInternalDestinationAccount exists, set it (with displayName) and close the picker; otherwise clear selection and open the picker.
    • Cleanup: Remove EVM/non‑EVM chain transition checks, useRef with previous chain ID, and related imports; simplify useEffect dependencies.

Written by Cursor Bugbot for commit 2d5f99f. This will update automatically on new commits. Configure here.

@metamaskbot metamaskbot added the team-swaps-and-bridge Swaps and Bridge team label Oct 13, 2025
@metamaskbot
Copy link
Collaborator

metamaskbot commented Oct 13, 2025

✨ Files requiring CODEOWNER review ✨

🔄 @MetaMask/swaps-engineers (1 files, +13 -47)
  • 📁 ui/
    • 📁 pages/
      • 📁 bridge/
        • 📁 hooks/
          • 📄 useDestinationAccount.ts +13 -47

@micaelae micaelae changed the title fix: recipient modal stays visible when switching from EVM to non-evm fix: recipient modal stays visible when switching from EVM to non-evm cp-13.5.0 Oct 13, 2025
@micaelae micaelae marked this pull request as ready for review October 13, 2025 23:28
@micaelae micaelae requested a review from a team as a code owner October 13, 2025 23:28
@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 5820fff | Date: 10/13/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±70ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 730ms (±68ms) 🟢 | historical mean value: 739ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±11ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 70ms 1.00s 1.32s 1.27s 1.32s
domContentLoaded 730ms 68ms 693ms 1000ms 939ms 1000ms
firstPaint 76ms 11ms 60ms 168ms 84ms 168ms
firstContentfulPaint 76ms 11ms 60ms 168ms 84ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [5820fff]
UI Startup Metrics (1210 ± 78 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1210107515087812461366
load104395012976810771190
domContentLoaded103793912926810721184
domInteractive17134461634
firstPaint672153130041710601158
backgroundConnect2482352707252261
firstReactRender26195272740
getState1257191428
initialActions40435512
loadScripts795693104166830937
setupStore953241017
WebpackHomeuiStartup822702110570838975
load63157692069635815
domContentLoaded62457090769624807
domInteractive15116891336
firstPaint19752899194197599
backgroundConnect21114562531
firstReactRender281765103247
getState842841013
initialActions2021337
loadScripts62156889566623796
setupStore84243911
FirefoxBrowserifyHomeuiStartup14001220194712214371679
load1195106113607712431335
domContentLoaded1195106113607812431335
domInteractive1013332654102226
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2919118143050
firstReactRender29253733135
getState7313714520
initialActions30396223
loadScripts1172104313427712241316
setupStore847811728
WebpackHomeuiStartup15461357219712615931764
load1337121117228613761507
domContentLoaded1337121117218613751507
domInteractive95314056295176
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3217156193565
firstReactRender362681133675
getState11213922553
initialActions5013017214
loadScripts1312119316828413501489
setupStore944910734
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: -209 Bytes (0%)
  • common: 10 Bytes (0%)

cursor[bot]

This comment was marked as outdated.

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: d4f93d8 | Date: 10/13/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.07s (±71ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 750ms (±69ms) 🟢 | historical mean value: 739ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 79ms (±10ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.07s 71ms 1.02s 1.36s 1.29s 1.36s
domContentLoaded 750ms 69ms 711ms 1.03s 954ms 1.03s
firstPaint 79ms 10ms 64ms 164ms 88ms 164ms
firstContentfulPaint 79ms 10ms 64ms 164ms 88ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [d4f93d8]
UI Startup Metrics (1352 ± 82 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1352121016808213881511
load1155101314127411981315
domContentLoaded1144100114017611881306
domInteractive21165892048
firstPaint78883135547111831301
backgroundConnect28125940823285311
firstReactRender3519182263690
getState14555101635
initialActions50265717
loadScripts8747261122759191022
setupStore1164561223
WebpackHomeuiStartup8237031143838371050
load64758396785657860
domContentLoaded63957895985644852
domInteractive15115881335
firstPaint18859883172199590
backgroundConnect20114472532
firstReactRender25166483134
getState842231015
initialActions2016339
loadScripts63657694883642842
setupStore74132911
FirefoxBrowserifyHomeuiStartup13981214195414214771663
load1190105614399112731348
domContentLoaded1190105614399112731348
domInteractive1013533756103248
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2918231213240
firstReactRender3025126103035
getState63436616
initialActions401992029
loadScripts1168104014208912471321
setupStore1048614753
WebpackHomeuiStartup15381367240713715731795
load1339119916578613861500
domContentLoaded1338119916568613861499
domInteractive91313814697170
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3118118163370
firstReactRender362682123675
getState9320322516
initialActions40789216
loadScripts1315118116138213581472
setupStore946710728
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: -257 Bytes (0%)
  • common: 10 Bytes (0%)

@micaelae micaelae enabled auto-merge October 14, 2025 00:12
@micaelae micaelae added this pull request to the merge queue Oct 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 14, 2025
@micaelae micaelae added this pull request to the merge queue Oct 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 14, 2025
@micaelae micaelae added this pull request to the merge queue Oct 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 14, 2025
@micaelae micaelae added this pull request to the merge queue Oct 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 14, 2025
@micaelae micaelae enabled auto-merge October 14, 2025 19:23
@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 2d5f99f | Date: 10/14/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±73ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 725ms (±70ms) 🟢 | historical mean value: 738ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 74ms (±12ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 73ms 997ms 1.32s 1.29s 1.32s
domContentLoaded 725ms 70ms 690ms 989ms 976ms 989ms
firstPaint 74ms 12ms 56ms 176ms 84ms 176ms
firstContentfulPaint 74ms 12ms 56ms 176ms 84ms 176ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [2d5f99f]
UI Startup Metrics (1294 ± 71 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1294115615297113231476
load111696713386711491267
domContentLoaded110896113346811431240
domInteractive19145671736
firstPaint70176131745211301223
backgroundConnect27326038714276288
firstReactRender28185383048
getState13590111433
initialActions50346521
loadScripts842699107468877968
setupStore1156271224
WebpackHomeuiStartup8186921076768341013
load63757392483637876
domContentLoaded62956691782625870
domInteractive15114471333
firstPaint18855870169190591
backgroundConnect21105482536
firstReactRender261795103135
getState831831012
initialActions206235
loadScripts62756490681623865
setupStore84142911
FirefoxBrowserifyHomeuiStartup1360120317649514041506
load1169105013806812121278
domContentLoaded1168104913796812121278
domInteractive933426735101168
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect282090123034
firstReactRender28237562936
getState52122510
initialActions2030325
loadScripts1148103213046511901261
setupStore8418018610
WebpackHomeuiStartup15421385204411915931799
load1337120916029014081499
domContentLoaded1337120816029014081499
domInteractive95313635992249
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3318116173756
firstReactRender382678153777
getState52293512
initialActions4012914222
loadScripts1311119015708613801470
setupStore11415919745
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: -257 Bytes (0%)
  • common: 10 Bytes (0%)

@micaelae micaelae added this pull request to the merge queue Oct 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 14, 2025
@ghgoodreau ghgoodreau added this pull request to the merge queue Oct 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 14, 2025
@micaelae micaelae added this pull request to the merge queue Oct 14, 2025
Merged via the queue into main with commit 1e64fdd Oct 14, 2025
170 checks passed
@micaelae micaelae deleted the swaps36759-hide-recipient-picker branch October 14, 2025 21:58
@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2025
@metamaskbot metamaskbot added the release-13.6.0 Issue or pull request that will be included in release 13.6.0 label Oct 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.6.0 Issue or pull request that will be included in release 13.6.0 size-S team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Modal does not disappear when selecting Solana as destination chain on Trezor and can not select the token

4 participants