Skip to content

Conversation

@jpuri
Copy link
Contributor

@jpuri jpuri commented Nov 19, 2025

Description

PR is doing 2 things:

  1. Add new context for dapp swap and not use confirmContext
  2. Add flag for dapp swap QA

Changelog

CHANGELOG entry:

Related issues

Fixes: MetaMask/metamask-mobile#22928

Manual testing steps

  1. Trigger swap request locally
  2. In development mode best available quote should always be visible

Screenshots/Recordings

NA

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 a dedicated DappSwapContext for swap UI state, migrates confirmation components/hooks to it, and introduces a dappSwapQa flag affecting comparison banner visibility and quote handling.

  • Context & State Management
    • Add DappSwapContextProvider and useDappSwapContext for selectedQuote and isQuotedSwapDisplayedInInfo.
    • Remove swap-related fields from ConfirmContext.
    • Wrap Confirm flow, tests, and Storybook stories with DappSwapContextProvider.
  • Component/Hook Integration
    • Migrate to new context in DappSwapComparisonBanner, BaseTransactionInfo, EditGasFeesRow, SelectedGasFeeToken, TransactionData, EstimatedPointsSection, useResimulationAlert, useTransactionConfirm.
    • Update swap actions/metrics: useDappSwapActions, useDappSwapComparisonMetrics, reward text hook.
  • Feature Flags & Behavior
    • Add dappSwapQa flag; banner displays if threshold met or QA enabled with a quote.
    • Sync selectedQuote into context; adjust display/CTA metrics events.
  • Data & Utils
    • useDappSwapUSDValues skips native addresses when fetching fiat rates.
  • Tests/Stories
    • Update tests to mock useDappSwapContext; adjust expectations.
    • Update render helpers to include DappSwapContextProvider.

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

@metamaskbot
Copy link
Collaborator

Builds ready [502cf4d]
UI Startup Metrics (1212 ± 97 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1212104716899712761355
load103588114048810931167
domContentLoaded102987313938710881159
domInteractive2313159212168
firstPaint54283118141010471142
backgroundConnect21019424810215231
firstReactRender292066103450
getState321664103750
initialActions103112
loadScripts826675117185886954
setupStore1072541119
numNetworkReqs1367619670
BrowserifyPower User HomeuiStartup18121539330225919322306
load97586019211609751368
domContentLoaded96085219121609551361
domInteractive35151943928156
firstPaint55611119263869041256
backgroundConnect21820226010223237
firstReactRender83411571891115
getState17513935639184258
initialActions102112
loadScripts75865516861597541159
setupStore2095792936
numNetworkReqs966920730106182
WebpackStandard HomeuiStartup8406981182948671016
load58153391968587746
domContentLoaded57352890265576731
domInteractive181190131552
firstPaint21153913206179736
backgroundConnect281199202887
firstReactRender3619221253962
getState19114762128
initialActions103112
loadScripts57052689464574723
setupStore1262841419
numNetworkReqs1467920874
WebpackPower User HomeuiStartup13121151236120013471688
load6405621162120634944
domContentLoaded6225501116113613906
domInteractive28131523318120
firstPaint277641101267227910
backgroundConnect45112173465106
firstReactRender7535101138191
getState15110020918162185
initialActions105111
loadScripts6205481105111611898
setupStore17670152757
numNetworkReqs1206824242132211
FirefoxBrowserifyStandard HomeuiStartup12071056168210512711394
load101790812147110601159
domContentLoaded101690812127110601159
domInteractive56301863281129
firstPaint------
backgroundConnect3520174213574
firstReactRender22184762235
getState106688921
initialActions103112
loadScripts99589311976510331117
setupStore13621427932
numNetworkReqs1266414853
BrowserifyPower User HomeuiStartup26192042364231827703258
load1143931172118411751585
domContentLoaded1143931172118411751585
domInteractive13931611137153522
firstPaint------
backgroundConnect20624836230228767
firstReactRender85361482098123
getState24878912245194829
initialActions2031326
loadScripts1108911169317811251563
setupStore1266804191118742
numNetworkReqs96582284492201
WebpackStandard HomeuiStartup14381267182812414861723
load1223107114869612881431
domContentLoaded1223107114869612881431
domInteractive71272354588160
firstPaint------
backgroundConnect4221126224592
firstReactRender282083113038
getState14698171149
initialActions103112
loadScripts1194105014299212621404
setupStore13571121046
numNetworkReqs1367117764
WebpackPower User HomeuiStartup29622295378434731433646
load14311111211220815991819
domContentLoaded14311111211220815991819
domInteractive14429677132170460
firstPaint------
backgroundConnect21229856225244757
firstReactRender943827934107145
getState23071904245177849
initialActions208237
loadScripts13911092208420415391787
setupStore1275795192106765
numNetworkReqs975722943109211
📊 Page Load Benchmark Results

Current Commit: 502cf4d | Date: 11/19/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±46ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 724ms (±42ms) 🟢 | historical mean value: 730ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±17ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 46ms 1.01s 1.42s 1.08s 1.42s
domContentLoaded 724ms 42ms 702ms 1.06s 750ms 1.06s
firstPaint 78ms 17ms 60ms 240ms 88ms 240ms
firstContentfulPaint 78ms 17ms 60ms 240ms 88ms 240ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

@metamaskbot
Copy link
Collaborator

Builds ready [f415c8e]
UI Startup Metrics (1291 ± 101 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12911124156710113661465
load110193513719411721265
domContentLoaded109493213559211621261
domInteractive251495182277
firstPaint60796137645011061247
backgroundConnect23021326710236250
firstReactRender312066113453
getState341777113960
initialActions103112
loadScripts8727251137919421033
setupStore1173651226
numNetworkReqs1367519669
BrowserifyPower User HomeuiStartup18481560272724319872356
load98987415761579971486
domContentLoaded97386615671549691462
domInteractive34161963929165
firstPaint5667915804009141416
backgroundConnect22219629113228246
firstReactRender7847120128594
getState17412736745187275
initialActions104112
loadScripts76966513461517691254
setupStore20773112642
numNetworkReqs1277027945163225
WebpackStandard HomeuiStartup8627181162918851047
load60955594275615823
domContentLoaded60255192572609796
domInteractive181169131554
firstPaint19556932206181760
backgroundConnect261096172774
firstReactRender331969114046
getState19122952328
initialActions103111
loadScripts59954891770607788
setupStore1262241418
numNetworkReqs1367519871
WebpackPower User HomeuiStartup13761190227921314041834
load67858713821466881038
domContentLoaded65757313041356491004
domInteractive34132835219179
firstPaint363601186296608996
backgroundConnect46131923467112
firstReactRender81441101488105
getState15012021119162197
initialActions102011
loadScripts6545701296133647996
setupStore20767163554
numNetworkReqs976921036119184
FirefoxBrowserifyStandard HomeuiStartup12361080166812013001545
load104291613028310981230
domContentLoaded104191613028410971229
domInteractive54301542981110
firstPaint------
backgroundConnect3820187224177
firstReactRender21183742134
getState135172201036
initialActions103112
loadScripts101890312687510731173
setupStore1053151025
numNetworkReqs1266714855
BrowserifyPower User HomeuiStartup27951961370934829743459
load1245957184918612991646
domContentLoaded1245957184818612981646
domInteractive15428639148153573
firstPaint------
backgroundConnect26227994283353903
firstReactRender924118122103131
getState23871899235190864
initialActions3138537
loadScripts1199939179218012401603
setupStore1308802200124748
numNetworkReqs96551973995191
WebpackStandard HomeuiStartup14371220184012714971757
load12211052149610012831428
domContentLoaded12211052149610012831427
domInteractive69272294685158
firstPaint------
backgroundConnect3818120174272
firstReactRender292079103151
getState12647101143
initialActions102012
loadScripts1195103714339412551409
setupStore146185221042
numNetworkReqs1367217763
WebpackPower User HomeuiStartup28172000378233729693512
load13691087179018215201741
domContentLoaded13681086179018215201741
domInteractive12528598114139431
firstPaint------
backgroundConnect15829795168170647
firstReactRender87382522793128
getState26574900263230856
initialActions3045527
loadScripts13341054175317614791703
setupStore1525835227108763
numNetworkReqs94542194591210
📊 Page Load Benchmark Results

Current Commit: f415c8e | Date: 11/20/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±41ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 716ms (±37ms) 🟢 | historical mean value: 729ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±11ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 41ms 1.01s 1.36s 1.06s 1.36s
domContentLoaded 716ms 37ms 698ms 1.01s 741ms 1.01s
firstPaint 75ms 11ms 60ms 168ms 84ms 168ms
firstContentfulPaint 75ms 11ms 60ms 168ms 84ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

@metamaskbot
Copy link
Collaborator

Builds ready [8fae2a4]
UI Startup Metrics (1239 ± 96 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1239105114749612951430
load106290713059211251229
domContentLoaded105489612989211191221
domInteractive2413108192174
firstPaint62176131843110721183
backgroundConnect21920027013224240
firstReactRender28204873146
getState311676103352
initialActions103112
loadScripts843693106688909989
setupStore1053331117
numNetworkReqs1367419670
BrowserifyPower User HomeuiStartup18501538277825520042358
load98887316321499911407
domContentLoaded97386716091469651374
domInteractive36152014227165
firstPaint5459416204209221394
backgroundConnect22019827011226240
firstReactRender7846139148396
getState17813537049188315
initialActions105112
loadScripts76966913751437661169
setupStore201067112444
numNetworkReqs1107024037122186
WebpackStandard HomeuiStartup8437061149868541059
load59654587366607762
domContentLoaded58954186162602747
domInteractive171167111552
firstPaint19959815187191581
backgroundConnect261091182681
firstReactRender332088133867
getState19113452327
initialActions104112
loadScripts58653985260599739
setupStore1152441417
numNetworkReqs1367919875
WebpackPower User HomeuiStartup13331162224120914591818
load6525721281134661992
domContentLoaded6335601234124632959
domInteractive29132403918142
firstPaint302601238280569943
backgroundConnect46111883467118
firstReactRender764099128291
getState15410227323162201
initialActions101011
loadScripts6305581225122630950
setupStore17756133039
numNetworkReqs1006924537118185
FirefoxBrowserifyStandard HomeuiStartup13001100175712613861553
load109195213478911561251
domContentLoaded109095213478911551250
domInteractive68322424586171
firstPaint------
backgroundConnect3921135184784
firstReactRender24195462437
getState12691121122
initialActions103122
loadScripts106793613028511311232
setupStore136149161227
numNetworkReqs1266414753
BrowserifyPower User HomeuiStartup25762014335522227462948
load1163953155814912001496
domContentLoaded1162953155814912001496
domInteractive12634505106151404
firstPaint------
backgroundConnect16826960173221551
firstReactRender84411421993124
getState25569828256208814
initialActions2016227
loadScripts1128937154014211591449
setupStore1001074415197595
numNetworkReqs95652264194204
WebpackStandard HomeuiStartup14491231213314514901766
load1229106415659612951413
domContentLoaded1228106415659612951413
domInteractive65271813884140
firstPaint------
backgroundConnect4319142254394
firstReactRender3021152163069
getState156180221148
initialActions102112
loadScripts1200105114938912601361
setupStore12598131035
numNetworkReqs1367016763
WebpackPower User HomeuiStartup28602048368831430343491
load13821058192820115241757
domContentLoaded13821058192820115241757
domInteractive13029519118154442
firstPaint------
backgroundConnect15128799164185599
firstReactRender87392392592132
getState27971903286214872
initialActions3150727
loadScripts13491043181519414761736
setupStore1356813212113745
numNetworkReqs95542304792216
📊 Page Load Benchmark Results

Current Commit: 8fae2a4 | Date: 11/20/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 982ms (±39ms) 🟢 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 680ms (±35ms) 🟢 | historical mean value: 729ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±12ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 982ms 39ms 947ms 1.27s 1.01s 1.27s
domContentLoaded 680ms 35ms 654ms 936ms 704ms 936ms
firstPaint 76ms 12ms 64ms 184ms 80ms 184ms
firstContentfulPaint 76ms 12ms 64ms 184ms 80ms 184ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

@metamaskbot
Copy link
Collaborator

Builds ready [d70ee9e]
UI Startup Metrics (1202 ± 100 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12021030148510012721376
load103187412658610911178
domContentLoaded102386912558710831172
domInteractive221383152167
firstPaint66575126341110571176
backgroundConnect20819429015211234
firstReactRender27195283045
getState30136093348
initialActions103112
loadScripts823674105686881962
setupStore1064141019
numNetworkReqs1367720674
BrowserifyPower User HomeuiStartup18841532368328120612274
load1007868199016610011418
domContentLoaded99186319741659761406
domInteractive35171773729154
firstPaint60710419874219381383
backgroundConnect22519828514232256
firstReactRender80451371590111
getState17513244447199278
initialActions105113
loadScripts78367017051627711200
setupStore21957112846
numNetworkReqs986919429111173
WebpackStandard HomeuiStartup8437071100858601033
load59654084565602779
domContentLoaded58953582462597760
domInteractive171162121455
firstPaint21058828213184756
backgroundConnect2712100172568
firstReactRender3319146143845
getState19123752228
initialActions104112
loadScripts58653381660595752
setupStore1243141419
numNetworkReqs1367519871
WebpackPower User HomeuiStartup13331148239321614491807
load6495721142118655987
domContentLoaded6295571072106634954
domInteractive30131693619140
firstPaint30564978257580783
backgroundConnect46112234160127
firstReactRender7637110138491
getState14610619920157189
initialActions102011
loadScripts6275551064105632945
setupStore20666163357
numNetworkReqs1106925947118225
FirefoxBrowserifyStandard HomeuiStartup12791101175412713441560
load107494413378811281238
domContentLoaded107394413378811231235
domInteractive65292334283142
firstPaint------
backgroundConnect4223167224581
firstReactRender22184642326
getState126167181025
initialActions102112
loadScripts104792713188210981207
setupStore11575101035
numNetworkReqs1266415756
BrowserifyPower User HomeuiStartup27981882381239830713588
load1234991185320413301671
domContentLoaded1233991185220313291671
domInteractive15632684152166561
firstPaint------
backgroundConnect25528986276373912
firstReactRender89441652194139
getState24067914241185835
initialActions3123327
loadScripts1187973170818912211627
setupStore1166799171113686
numNetworkReqs996022040107197
WebpackStandard HomeuiStartup14771241199114115081817
load1257109215419912951468
domContentLoaded1257109215419912951468
domInteractive843023554103232
firstPaint------
backgroundConnect40221302438113
firstReactRender28197382841
getState137155181143
initialActions1011122
loadScripts1233107614719312751427
setupStore12687111136
numNetworkReqs1367118767
WebpackPower User HomeuiStartup29922105391635531983682
load14761180196620616811830
domContentLoaded14761180196620616801830
domInteractive14128627127156458
firstPaint------
backgroundConnect19327965205218651
firstReactRender91442223097160
getState27684900265229872
initialActions50691138
loadScripts14391161183420116381801
setupStore1285801195124728
numNetworkReqs94552314691212
📊 Page Load Benchmark Results

Current Commit: d70ee9e | Date: 11/20/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±37ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 717ms (±34ms) 🟢 | historical mean value: 729ms ⬇️ (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.03s 37ms 1.00s 1.30s 1.06s 1.30s
domContentLoaded 717ms 34ms 692ms 976ms 739ms 976ms
firstPaint 76ms 11ms 60ms 164ms 88ms 164ms
firstContentfulPaint 76ms 11ms 60ms 164ms 88ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Base automatically changed from quotes_fix to main November 20, 2025 07:34
@jpuri jpuri requested review from a team as code owners November 20, 2025 07:34
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 code owner files

@jpuri jpuri enabled auto-merge November 20, 2025 08:28
@metamaskbot
Copy link
Collaborator

Builds ready [c87eecc]
UI Startup Metrics (1198 ± 101 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup11981045155810112761369
load102387813449211011174
domContentLoaded101687313369110951170
domInteractive231384182079
firstPaint60583135741210381149
backgroundConnect21019427011213229
firstReactRender28195173243
getState3417101144159
initialActions105113
loadScripts813673112091882966
setupStore1154351220
numNetworkReqs1257721574
BrowserifyPower User HomeuiStartup18841562249922220422313
load995884146314610021425
domContentLoaded98087614561449771410
domInteractive36161834030170
firstPaint55915714313689291043
backgroundConnect22320026112229246
firstReactRender82431471988122
getState17612830738197261
initialActions102112
loadScripts77467012461437721197
setupStore201067102539
numNetworkReqs1377230354178243
WebpackStandard HomeuiStartup79368398664830936
load59454678551605730
domContentLoaded58954177950596725
domInteractive221491151962
firstPaint26470762186281622
backgroundConnect1253171727
firstReactRender29197783339
getState301374103548
initialActions105112
loadScripts58653877148594717
setupStore1272141418
numNetworkReqs1257721575
WebpackPower User HomeuiStartup14511084200622916231952
load68057410641236861033
domContentLoaded66956810521226671023
domInteractive38161743731148
firstPaint293921049195282691
backgroundConnect1575571827
firstReactRender82521151290100
getState15612324026165209
initialActions103112
loadScripts66656610371206651012
setupStore231078163358
numNetworkReqs1546930256198292
FirefoxBrowserifyStandard HomeuiStartup12901100158812213711555
load108893513379511451269
domContentLoaded108793313379511431269
domInteractive62301743583148
firstPaint------
backgroundConnect4221149214484
firstReactRender22183732230
getState96465917
initialActions103112
loadScripts106091713118911141239
setupStore1156071029
numNetworkReqs1256817761
BrowserifyPower User HomeuiStartup27071869367037828953518
load1156928177618611901618
domContentLoaded1155928177618611901618
domInteractive14032583129144473
firstPaint------
backgroundConnect23628982249330798
firstReactRender86471331893125
getState294891284280286871
initialActions3135427
loadScripts1111916161116911381529
setupStore123677518897740
numNetworkReqs1015021741123201
WebpackStandard HomeuiStartup13851217194313414271634
load1175104514539012311359
domContentLoaded1174104514539012311359
domInteractive58251353282128
firstPaint------
backgroundConnect39202273038106
firstReactRender26207772737
getState136139171043
initialActions102012
loadScripts1153103114038512041300
setupStore145205231033
numNetworkReqs1256816662
WebpackPower User HomeuiStartup29262042388641731183777
load13761075195819315101768
domContentLoaded13761075195819315091768
domInteractive13628601137139495
firstPaint------
backgroundConnect18125921198200628
firstReactRender89471872099122
getState295851589302251884
initialActions4065727
loadScripts13441062191918814651707
setupStore1056825164100637
numNetworkReqs99682234295201
📊 Page Load Benchmark Results

Current Commit: c87eecc | Date: 11/20/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±129ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 724ms (±148ms) 🟢 | historical mean value: 730ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 96ms (±216ms) 🟢 | historical mean value: 78ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 129ms 998ms 2.29s 1.05s 2.29s
domContentLoaded 724ms 148ms 692ms 2.18s 725ms 2.18s
firstPaint 96ms 216ms 60ms 2.25s 84ms 2.25s
firstContentfulPaint 96ms 216ms 60ms 2.25s 84ms 2.25s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 53 Bytes (0%)
  • ui: 2.56 KiB (0.04%)
  • common: 20 Bytes (0%)

@jpuri jpuri added this pull request to the merge queue Nov 20, 2025
Merged via the queue into main with commit a616c19 Nov 20, 2025
176 checks passed
@jpuri jpuri deleted the dapp_swap_context branch November 20, 2025 09:15
@github-actions github-actions bot locked and limited conversation to collaborators Nov 20, 2025
@metamaskbot metamaskbot added the release-13.11.0 Issue or pull request that will be included in release 13.11.0 label Nov 20, 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.

Add flag to show best available quote

5 participants