Skip to content

Conversation

@jpuri
Copy link
Contributor

@jpuri jpuri commented Nov 18, 2025

Description

Updates in UI implementation of dapp swap feature. UI is not updated when user toggles between swaps.

Changelog

CHANGELOG entry:

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6275
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6281
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6283

Manual testing steps

  1. Enable dapp-swap locally
  2. Go to test-dapp submit swap
  3. Check switching between swaps is smooth

Screenshots/Recordings

TODO

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

Adds context-managed MetaMask Swap quote selection, updates confirmation to apply quote/approval, and adjusts confirmation UI/alerts accordingly.

  • Dapp Swap comparison & confirmation flow:
    • Introduces context state in confirm (quoteSelectedForMMSwap, isQuotedSwapDisplayedInInfo, setters) and uses it across confirm UI.
    • DappSwapComparisonBanner now toggles between current vs MetaMask quote by setting context; shows quote simulation + NetworkRow and removes redux transaction mutations.
    • useTransactionConfirm applies selected MM quote to txParams, adds swap approval as batchTransactions, clears nestedTransactions when quote is shown.
    • TransactionData decodes from selected quote trade data when present.
  • Confirm UI adjustments:
    • BaseTransactionInfo hides account/details sections when quote view is shown; always renders GasFeesSection/AdvancedDetails.
    • EditGasFeesRow and SelectedGasFeeToken hide edit/arrow controls when quote view is shown.
    • TransactionDetails always renders Origin/Recipient rows (non-batch); NetworkRow remains; AmountRow logic unchanged.
    • BatchSimulationDetails no longer special-cases quoted swaps.
  • Hooks/metrics:
    • Simplifies useSwapCheck (removes isQuotedSwap); latency metric updates made unconditional where applicable.
    • useResimulationAlert suppresses alert when quote view is shown; metrics use quote selection to set swap_final_selected.
    • useDappSwapComparisonInfo no longer accepts nested tx param; parsing refined.
  • Tests & fixtures:
    • Broad test updates to use new context APIs, expectations, and added mockBridgeQuotes fixture; snapshot headers updated.

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

@github-actions
Copy link
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.

@jpuri jpuri added team-confirmations Push issues to confirmations team no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels Nov 18, 2025
@jpuri jpuri marked this pull request as ready for review November 18, 2025 08:44
@jpuri jpuri requested a review from a team as a code owner November 18, 2025 08:44
@jpuri jpuri changed the title UI fix fix: fix in UI implementation of dapp swap feature Nov 18, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [f730c38]
UI Startup Metrics (1235 ± 89 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1235108614958912921399
load106793413268211191215
domContentLoaded106092913208111131199
domInteractive231489181978
firstPaint60284124743310831208
backgroundConnect2342152819237244
firstReactRender29194973047
getState2395392745
initialActions104112
loadScripts832693109280883967
setupStore1173241218
numNetworkReqs1367619670
BrowserifyPower User HomeuiStartup21091923274820721642748
load1123966176822413501768
domContentLoaded1104947176022813371760
domInteractive571717055127170
firstPaint720166176251210131762
backgroundConnect25023527711253277
firstReactRender74511271881127
getState20516732144204321
initialActions102122
loadScripts875729151722010971517
setupStore25183752937
numNetworkReqs1239419733145197
WebpackStandard HomeuiStartup8557371233988571158
load62557396288620919
domContentLoaded61756692683615895
domInteractive2012122181572
firstPaint19561933193198755
backgroundConnect271279142862
firstReactRender31204983740
getState1164341316
initialActions104111
loadScripts61456491581612885
setupStore1263541317
numNetworkReqs1367519869
WebpackPower User HomeuiStartup1123949186124913021861
load686596932127888932
domContentLoaded665585881111797881
domInteractive38141384295138
firstPaint37670885317803885
backgroundConnect58102647471264
firstReactRender43404624546
getState1449716624160166
initialActions111011
loadScripts661583871107787871
setupStore15731102631
numNetworkReqs846313225121132
FirefoxBrowserifyStandard HomeuiStartup15011357207112815271766
load1259116015588312911459
domContentLoaded1259115915578312901459
domInteractive58342684256151
firstPaint------
backgroundConnect4525209234890
firstReactRender29236072943
getState166198271333
initialActions203122
loadScripts1231113914457612691415
setupStore177216231437
numNetworkReqs1266916760
BrowserifyPower User HomeuiStartup32342432474263139504742
load15411359218526016332185
domContentLoaded15401359218526016332185
domInteractive23796612166349612
firstPaint------
backgroundConnect569121133845410931338
firstReactRender906412521111125
getState1488619738185197
initialActions213133
loadScripts14831301207524015702075
setupStore15034522122131522
numNetworkReqs1257024663208246
WebpackStandard HomeuiStartup17281527235715917292098
load14481285181812414611751
domContentLoaded14481284181712414611750
domInteractive59312333265131
firstPaint------
backgroundConnect54271902660121
firstReactRender362792123654
getState148192191218
initialActions203123
loadScripts14141262179811414291683
setupStore18774151456
numNetworkReqs1366918766
WebpackPower User HomeuiStartup36292721521472939635214
load18371514230930022492309
domContentLoaded18361513230930022482309
domInteractive281101731215535731
firstPaint------
backgroundConnect58016513783839631378
firstReactRender914713621103136
getState188108560102214560
initialActions318138
loadScripts17811481224129421952241
setupStore12740487107119487
numNetworkReqs1326724562210245
📊 Page Load Benchmark Results

Current Commit: f730c38 | Date: 11/18/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±41ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 737ms (±37ms) 🟢 | historical mean value: 726ms ⬆️ (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.06s 41ms 1.03s 1.36s 1.10s 1.36s
domContentLoaded 737ms 37ms 713ms 1.02s 765ms 1.02s
firstPaint 79ms 10ms 64ms 164ms 88ms 164ms
firstContentfulPaint 79ms 10ms 64ms 164ms 88ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

@metamaskbot
Copy link
Collaborator

Builds ready [f08c704]
UI Startup Metrics (1343 ± 95 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1343118816099513991528
load115098414189512231330
domContentLoaded114096114149712201322
domInteractive271699192483
firstPaint71086137845011441321
backgroundConnect26124236921265283
firstReactRender3622174213858
getState279173193448
initialActions105114
loadScripts8897101167989701082
setupStore1373551625
numNetworkReqs1367620674
BrowserifyPower User HomeuiStartup20511794302429821883024
load1061888184725312831847
domContentLoaded1043875182925412741829
domInteractive551819956113199
firstPaint79820318704659741870
backgroundConnect1981852178206217
firstReactRender80541262391126
getState21215132849235328
initialActions103123
loadScripts862700162625010971626
setupStore25134883348
numNetworkReqs1249020536176205
WebpackStandard HomeuiStartup8557241180868631086
load62156591371617846
domContentLoaded61356089468612815
domInteractive181281131554
firstPaint17457875144192582
backgroundConnect271273133255
firstReactRender3419231223741
getState1152231316
initialActions104111
loadScripts61055888365610805
setupStore1263841416
numNetworkReqs1367419870
WebpackPower User HomeuiStartup1133926182929315071829
load69858711451769011145
domContentLoaded68157711281698611128
domInteractive43131905392190
firstPaint3517211313035801131
backgroundConnect56102527072252
firstReactRender41384324343
getState1338815523147155
initialActions101011
loadScripts67757511181668511118
setupStore1372682526
numNetworkReqs836414129126141
FirefoxBrowserifyStandard HomeuiStartup14811322208413215101815
load1245113915488312921401
domContentLoaded1245113915478312921400
domInteractive54331833158137
firstPaint------
backgroundConnect4324230264992
firstReactRender27225362741
getState147203221222
initialActions103122
loadScripts1220110715038112671374
setupStore166197271142
numNetworkReqs1266315854
BrowserifyPower User HomeuiStartup31632478479957334844799
load15581277223527416432235
domContentLoaded15581276223527416432235
domInteractive24783655178343655
firstPaint------
backgroundConnect4899812783467641278
firstReactRender81631051290105
getState1427720536159205
initialActions318258
loadScripts15081243216027415962160
setupStore1202842791152427
numNetworkReqs1257524765228247
WebpackStandard HomeuiStartup16111419204012716251947
load13751219172410314051628
domContentLoaded13751218172410314051628
domInteractive58301923463146
firstPaint------
backgroundConnect4624127205289
firstReactRender33258293546
getState1277791123
initialActions217122
loadScripts1347119916389613791578
setupStore16580151354
numNetworkReqs1266816763
WebpackPower User HomeuiStartup36242719511265340335112
load17411525228924620202289
domContentLoaded17401524228924620202289
domInteractive23783692208542692
firstPaint------
backgroundConnect67880142343610551423
firstReactRender1036613519121135
getState182112583120157583
initialActions52389338
loadScripts16871456222023819592220
setupStore863616737122167
numNetworkReqs1237322557215225
📊 Page Load Benchmark Results

Current Commit: f08c704 | Date: 11/18/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±40ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 733ms (±36ms) 🟢 | historical mean value: 726ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±11ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 40ms 1.01s 1.30s 1.09s 1.30s
domContentLoaded 733ms 36ms 699ms 971ms 769ms 971ms
firstPaint 78ms 11ms 60ms 160ms 92ms 160ms
firstContentfulPaint 78ms 11ms 60ms 160ms 92ms 160ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

@jpuri jpuri requested a review from a team as a code owner November 18, 2025 20:04
@metamaskbot
Copy link
Collaborator

Builds ready [85df878]
UI Startup Metrics (1222 ± 95 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1222106816239512671403
load106092213918611091219
domContentLoaded105491913848511051204
domInteractive221486162072
firstPaint60085125341610561207
backgroundConnect2332152739237249
firstReactRender29196582947
getState20796102234
initialActions104112
loadScripts827697115785873980
setupStore1052131115
numNetworkReqs1367619671
BrowserifyPower User HomeuiStartup20181721286629020912866
load1068889176724612751767
domContentLoaded1049874173824612651738
domInteractive541814746119147
firstPaint64820712713399411271
backgroundConnect21118725616216256
firstReactRender715094117594
getState19814828840237288
initialActions105125
loadScripts860686153724310871537
setupStore261352133552
numNetworkReqs1289419834160198
WebpackStandard HomeuiStartup79466612211007931072
load56951894983562830
domContentLoaded56251192980555810
domInteractive181192131650
firstPaint20452932210171732
backgroundConnect261070132854
firstReactRender3219233223541
getState1052131216
initialActions101011
loadScripts55950992279553800
setupStore1153851316
numNetworkReqs1467820872
WebpackPower User HomeuiStartup1065894168624512451686
load67856110861818521086
domContentLoaded66055010421678181042
domInteractive46132396484239
firstPaint3816810873566191087
backgroundConnect44102616066261
firstReactRender39374214042
getState1328717124144171
initialActions101011
loadScripts65654810321638071032
setupStore1162671026
numNetworkReqs806114025110140
FirefoxBrowserifyStandard HomeuiStartup14931330200313115211800
load1254113715678912681455
domContentLoaded1254113615678912671455
domInteractive53352273749152
firstPaint------
backgroundConnect4125102155078
firstReactRender28234342841
getState1275161124
initialActions213122
loadScripts1230111715408612451425
setupStore14792111428
numNetworkReqs1266315754
BrowserifyPower User HomeuiStartup31242427415145233884151
load15291280213527017062135
domContentLoaded15281280213527017062135
domInteractive22257573161370573
firstPaint------
backgroundConnect5338710773198621077
firstReactRender77491061485106
getState1326519438172194
initialActions224134
loadScripts14731230202425316322024
setupStore842915836107158
numNetworkReqs1288123961219239
WebpackStandard HomeuiStartup16531424204414517111974
load13931230172911414391644
domContentLoaded13931230172911414391644
domInteractive56301832964120
firstPaint------
backgroundConnect48231392254107
firstReactRender352683113763
getState1385281225
initialActions103122
loadScripts13621190170210614161569
setupStore187110191468
numNetworkReqs1366817866
WebpackPower User HomeuiStartup35112730462458942024624
load17071469209819518792098
domContentLoaded17061468209819418782098
domInteractive22696558153395558
firstPaint------
backgroundConnect53313911633367981163
firstReactRender1006615726129157
getState236113615146212615
initialActions223033
loadScripts16471427194618018381946
setupStore884414031123140
numNetworkReqs1307723255190232
📊 Page Load Benchmark Results

Current Commit: 85df878 | Date: 11/18/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±38ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 720ms (±36ms) 🟢 | historical mean value: 722ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±11ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 38ms 1.01s 1.32s 1.06s 1.32s
domContentLoaded 720ms 36ms 697ms 991ms 742ms 991ms
firstPaint 77ms 11ms 64ms 168ms 88ms 168ms
firstContentfulPaint 77ms 11ms 64ms 168ms 88ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

OGPoyraz
OGPoyraz previously approved these changes Nov 19, 2025
Base automatically changed from dapp_swap_metrics to main November 19, 2025 08:29
@jpuri jpuri dismissed OGPoyraz’s stale review November 19, 2025 08:29

The base branch was changed.

@jpuri jpuri enabled auto-merge November 19, 2025 08:51
@jpuri jpuri requested a review from OGPoyraz November 19, 2025 08:51
@jpuri jpuri changed the title fix: fix in UI implementation of dapp swap feature fix: in UI implementation of dapp swap feature Nov 19, 2025
Copy link
Member

@chaitanyapotti chaitanyapotti left a comment

Choose a reason for hiding this comment

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

lgtm for web3auth related changes

@metamaskbot
Copy link
Collaborator

Builds ready [7c18d46]
📊 Page Load Benchmark Results

Current Commit: 7c18d46 | Date: 11/19/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.02s (±37ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 710ms (±35ms) 🟢 | historical mean value: 724ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 74ms (±10ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.02s 37ms 999ms 1.30s 1.04s 1.30s
domContentLoaded 710ms 35ms 691ms 979ms 730ms 979ms
firstPaint 74ms 10ms 56ms 156ms 84ms 156ms
firstContentfulPaint 74ms 10ms 56ms 156ms 84ms 156ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 53 Bytes (0%)
  • ui: -116 Bytes (0%)
  • common: 20 Bytes (0%)

@jpuri jpuri added this pull request to the merge queue Nov 19, 2025
Merged via the queue into main with commit b4e970f Nov 19, 2025
162 of 174 checks passed
@jpuri jpuri deleted the ui_fix branch November 19, 2025 09:58
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2025
@metamaskbot metamaskbot added the release-13.11.0 Issue or pull request that will be included in release 13.11.0 label Nov 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-13.11.0 Issue or pull request that will be included in release 13.11.0 size-L team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants