Skip to content

Conversation

@jpuri
Copy link
Contributor

@jpuri jpuri commented Oct 30, 2025

Description

Adding dapp swap banner.

Changelog

CHANGELOG entry:

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6107

Manual testing steps

  1. Enable dapp swap locally
  2. Submit swap
  3. Check dapp swap banner

Screenshots/Recordings

Screen.Recording.2025-10-30.at.8.07.24.PM.mov

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

Introduces a Uniswap-gated Dapp Swap comparison banner showing estimated savings, powered by new hook computations and supporting locale strings, with tests and styles.

  • Confirmations UI:
    • Add DappSwapComparisonBanner with toggle (Current vs MetaMask), savings callout, dismiss button, and threshold-based display; gated by dappSwapMetrics and origin https://app.uniswap.org.
    • New styles in dapp-swap-comparison-banner/index.scss.
  • Hook Logic (useDappSwapComparisonInfo):
    • Compute and expose selectedQuoteValueDifference, gasDifference, tokenAmountDifference, destinationTokenSymbol.
    • Rename bestFilteredQuote to selectedQuote; add memo/metric updates and value comparisons; integrate gas/token USD calculations.
  • Swap Parsing Utils:
    • Replace Permit2 parsing with Seaport (COMMAND_BYTE_SEAPORT), keep sweep, and add unwrap WETH handling; refine getDataFromSwap and token address collection.
  • i18n:
    • Add dappSwapAdvantage, dappSwapBenefits, dappSwapQuoteDetails, dappSwapQuoteDifference to app/_locales/en*.json.
  • Tests:
    • Update component test to assert new texts/threshold behavior.
    • Expand hook tests with adjusted mock quotes, metrics assertions, and new value-difference expectations.

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

@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 Oct 30, 2025
@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.

@metamaskbot
Copy link
Collaborator

metamaskbot commented Oct 30, 2025

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (6 files, +306 -55)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 components/
          • 📁 confirm/
            • 📁 dapp-swap-comparison-banner/
              • 📄 dapp-swap-comparison-banner.test.tsx +15 -2
              • 📄 dapp-swap-comparison-banner.tsx +100 -29
              • 📄 index.scss +38 -0
        • 📁 hooks/
          • 📁 transactions/
            • 📁 dapp-swap-comparison/
              • 📄 useDappSwapComparisonInfo.test.ts +36 -7
              • 📄 useDappSwapComparisonInfo.ts +103 -3
        • 📁 utils/
          • 📄 dapp-swap-comparison-utils.ts +14 -14

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 5e6f263 | Date: 10/30/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 982ms (±39ms) 🟢 | historical mean value: 1.06s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 681ms (±36ms) 🟢 | historical mean value: 739ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±12ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 982ms 39ms 957ms 1.26s 1.03s 1.26s
domContentLoaded 681ms 36ms 658ms 937ms 714ms 937ms
firstPaint 75ms 12ms 60ms 176ms 84ms 176ms
firstContentfulPaint 75ms 12ms 60ms 176ms 84ms 176ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [5e6f263]
UI Startup Metrics (1278 ± 84 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1278112814818413291443
load109796113008211431264
domContentLoaded109195612918111381254
domInteractive21156192050
firstPaint67294130045011211231
backgroundConnect2322182567235246
firstReactRender28194663241
getState20108492634
initialActions51224714
loadScripts8667391067819101014
setupStore1162841120
numNetworkReqs96327632
BrowserifyPower User HomeuiStartup22131807350258727833502
load1144925180230516101802
domContentLoaded1137918178930416011789
domInteractive261566144166
firstPaint69515616514369931651
backgroundConnect27022057589296575
firstReactRender26233332733
getState18614432339190323
initialActions17394282494
loadScripts894693150727012761507
setupStore1484291242
numNetworkReqs341192667188654667
WebpackStandard HomeuiStartup8627271174878801133
load64658996680652941
domContentLoaded63858295078645932
domInteractive15114271437
firstPaint21357971209199665
backgroundConnect24124882845
firstReactRender281791113252
getState1252641417
initialActions3013247
loadScripts63558094076643921
setupStore1051931215
numNetworkReqs96338832
WebpackPower User HomeuiStartup17381433247635622222476
load72863310481368771048
domContentLoaded696615939111801939
domInteractive191344102144
firstPaint37479943328809943
backgroundConnect12532422138266422
firstReactRender26223952639
getState16814823324177233
initialActions13070213070
loadScripts692613929108790929
setupStore21659203159
numNetworkReqs332180590146553590
FirefoxBrowserifyStandard HomeuiStartup14391277184510914941713
load1223107215638712841369
domContentLoaded1222107215638712841368
domInteractive1153437049125211
firstPaint------
backgroundConnect4325139204786
firstReactRender26215362643
getState84748820
initialActions712092736
loadScripts1196105115308412591342
setupStore12577101117
numNetworkReqs96337828
BrowserifyPower User HomeuiStartup27702489375132929083751
load14511362175310515111753
domContentLoaded14511362175210515111752
domInteractive17810240180241401
firstPaint------
backgroundConnect25668672180416672
firstReactRender40306394763
getState1318220537142205
initialActions1611563713156
loadScripts1386130716828814081682
setupStore32864185264
numNetworkReqs27117845972305459
WebpackStandard HomeuiStartup15441354191611815761841
load1328118616849113671526
domContentLoaded1328118616849213661526
domInteractive1023031851115221
firstPaint------
backgroundConnect4020115144766
firstReactRender302173142869
getState84677818
initialActions8121125316
loadScripts1303116816488813411492
setupStore156179191241
numNetworkReqs106327729
WebpackPower User HomeuiStartup29812379417254634504172
load16671412212123118382121
domContentLoaded16671412212123118382121
domInteractive1505232370223323
firstPaint------
backgroundConnect28284978236439978
firstReactRender45281051850105
getState1449321145195211
initialActions823581135
loadScripts15691341197319917741973
setupStore4872176553217
numNetworkReqs265157564125328564
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 68 Bytes (0%)
  • ui: 2.16 KiB (0.03%)
  • common: 303 Bytes (0%)

@jpuri jpuri marked this pull request as ready for review October 31, 2025 09:44
@jpuri jpuri requested a review from a team as a code owner October 31, 2025 09:44
cursor[bot]

This comment was marked as outdated.

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 600b599 | Date: 10/31/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±40ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 718ms (±37ms) 🟢 | historical mean value: 725ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±13ms) 🟢 | historical mean value: 76ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 40ms 1.01s 1.32s 1.07s 1.32s
domContentLoaded 718ms 37ms 696ms 987ms 747ms 987ms
firstPaint 76ms 13ms 60ms 192ms 84ms 192ms
firstContentfulPaint 76ms 13ms 60ms 192ms 84ms 192ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [600b599]
UI Startup Metrics (1312 ± 102 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup13121138170710213731458
load111797013949411821274
domContentLoaded111196113889311671264
domInteractive211466101849
firstPaint57681140945211051243
backgroundConnect2352202749238256
firstReactRender31205283647
getState2285082639
initialActions70699828
loadScripts8837371144929401045
setupStore1163041220
numNetworkReqs96327631
BrowserifyPower User HomeuiStartup22671818365565131793655
load1166936181332616571813
domContentLoaded1156929176932016451769
domInteractive291688215288
firstPaint708155182452910091824
backgroundConnect274222689112303689
firstReactRender26233532735
getState19215926431220264
initialActions73164816
loadScripts913712146228613531462
setupStore1292641226
numNetworkReqs323181689200635689
WebpackStandard HomeuiStartup8717561129698901040
load64860291066656846
domContentLoaded64159590466650838
domInteractive16125981538
firstPaint22460891215215741
backgroundConnect25135592748
firstReactRender28176383337
getState1262031519
initialActions3015247
loadScripts63759289263648827
setupStore1151931316
numNetworkReqs106348832
WebpackPower User HomeuiStartup17151273245438222452454
load75963411701698811170
domContentLoaded72661410431388411043
domInteractive30131723830172
firstPaint4926411293558461129
backgroundConnect12223442157234442
firstReactRender26234862548
getState15713321619154216
initialActions1201122719112
loadScripts72161210321348311032
setupStore23691234391
numNetworkReqs342195618152571618
FirefoxBrowserifyStandard HomeuiStartup15531345191311016211737
load1322113315619113931493
domContentLoaded1322113215619113931492
domInteractive1243734347132226
firstPaint------
backgroundConnect4827135205595
firstReactRender28236072851
getState75172812
initialActions4246447
loadScripts1293111415309213591458
setupStore1378391316
numNetworkReqs96347830
BrowserifyPower User HomeuiStartup29382398407851331294078
load14941254175815616481758
domContentLoaded14941254175815616481758
domInteractive1797233584293335
firstPaint------
backgroundConnect27639960276465960
firstReactRender493295135195
getState1378419330173193
initialActions1821263115126
loadScripts14291228171413915711714
setupStore51123437857343
numNetworkReqs26715350691315506
WebpackStandard HomeuiStartup16351498211810716791831
load1406125617879414451580
domContentLoaded1405125517879414451579
domInteractive1144150267121238
firstPaint------
backgroundConnect452692135470
firstReactRender332384143475
getState84768913
initialActions51669412
loadScripts1380123817589314181562
setupStore1365791331
numNetworkReqs96327729
WebpackPower User HomeuiStartup29272407397245333673972
load16631384206222318822062
domContentLoaded16621384206222218812062
domInteractive1458225663219256
firstPaint------
backgroundConnect18049678164317678
firstReactRender453362105262
getState1386522644192226
initialActions211251606251
loadScripts16061349197420117411974
setupStore31101413030141
numNetworkReqs26115845898380458
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 68 Bytes (0%)
  • ui: 2.18 KiB (0.03%)
  • common: 303 Bytes (0%)

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 90ad897 | Date: 10/31/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 (±35ms) 🟢 | historical mean value: 721ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±12ms) 🟢 | historical mean value: 76ms ⬆️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 38ms 1.01s 1.32s 1.05s 1.32s
domContentLoaded 720ms 35ms 701ms 985ms 740ms 985ms
firstPaint 77ms 12ms 60ms 184ms 84ms 184ms
firstContentfulPaint 77ms 12ms 60ms 184ms 84ms 184ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [90ad897]
UI Startup Metrics (1282 ± 85 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1282112814988513421437
load109596713057811501215
domContentLoaded108996212977711431206
domInteractive201494112046
firstPaint61073130243710931187
backgroundConnect2322202507236244
firstReactRender28195583344
getState221092112342
initialActions71658822
loadScripts863744107277921990
setupStore1162741221
numNetworkReqs96338631
BrowserifyPower User HomeuiStartup22641826417965329154179
load1192947191034417371910
domContentLoaded1181940189933816951899
domInteractive331695235395
firstPaint49219217584319471758
backgroundConnect275220763128256763
firstReactRender27224052940
getState17916122319185223
initialActions73368636
loadScripts941727148130614451481
setupStore1292641126
numNetworkReqs347179717182576717
WebpackStandard HomeuiStartup795686104567808957
load59754885862602759
domContentLoaded59054284461595753
domInteractive14105061331
firstPaint17555847172176579
backgroundConnect22114782537
firstReactRender25155473031
getState1162431317
initialActions31203412
loadScripts58754083459593743
setupStore1043141114
numNetworkReqs106358833
WebpackPower User HomeuiStartup17231453239832621212398
load71862510891338291089
domContentLoaded69460910251188041025
domInteractive19133583035
firstPaint49513010283158131028
backgroundConnect11021404127156404
firstReactRender25213332533
getState16215023621162236
initialActions10046162346
loadScripts68960710151157931015
setupStore19665152665
numNetworkReqs312183553142538553
FirefoxBrowserifyStandard HomeuiStartup15291347193511515861756
load1291114617068913351438
domContentLoaded1291114517068913351438
domInteractive1173526844134214
firstPaint------
backgroundConnect4828161215589
firstReactRender27227062738
getState948411922
initialActions4220247
loadScripts1262112616808513061408
setupStore158228221316
numNetworkReqs96337731
BrowserifyPower User HomeuiStartup27682304401053631094010
load14521239179716315551797
domContentLoaded14511239179716315551797
domInteractive17010235570236355
firstPaint------
backgroundConnect22235742206261742
firstReactRender37295374553
getState1244317629143176
initialActions816014760
loadScripts13921126172415414961724
setupStore3281192747119
numNetworkReqs25215443096327430
WebpackStandard HomeuiStartup16131439207612316601925
load1385119616938514341536
domContentLoaded1385119616928514341536
domInteractive1043340155111235
firstPaint------
backgroundConnect4625158215195
firstReactRender342280163276
getState9415615817
initialActions41425312
loadScripts1358117816738214081513
setupStore1268291122
numNetworkReqs96357728
WebpackPower User HomeuiStartup28532486406642530844066
load16371410205120117962051
domContentLoaded16371410205120217962051
domInteractive1348923251190232
firstPaint------
backgroundConnect1433635293221352
firstReactRender44335775157
getState1378628645144286
initialActions3212947510294
loadScripts15641380193218117491932
setupStore48122175544217
numNetworkReqs24516542189324421
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 68 Bytes (0%)
  • ui: 2.18 KiB (0.03%)
  • common: 303 Bytes (0%)

@metamaskbot
Copy link
Collaborator

Builds ready [16e5664]
UI Startup Metrics (1286 ± 108 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12861097183310813491460
load110194415799911641277
domContentLoaded109593915609811581271
domInteractive211485131957
firstPaint60399159144110901195
backgroundConnect2302172537234243
firstReactRender30206283346
getState21106192341
initialActions816811825
loadScripts8717261330969331043
setupStore1163241220
numNetworkReqs1367519670
BrowserifyPower User HomeuiStartup20201758291736722282917
load1080923176323512331763
domContentLoaded1070916174923212051749
domInteractive281468195168
firstPaint78010517724859761772
backgroundConnect23522127213240272
firstReactRender27243632736
getState17515623417181234
initialActions529269
loadScripts84770115102269871510
setupStore1392751227
numNetworkReqs15210231582248315
WebpackStandard HomeuiStartup88975712411028951155
load662600100488664915
domContentLoaded65459497985658900
domInteractive16126881535
firstPaint18357903170188620
backgroundConnect281285162971
firstReactRender30176593540
getState1374451519
initialActions41304410
loadScripts65059296883656889
setupStore1152741320
numNetworkReqs1367619671
WebpackPower User HomeuiStartup13131166188922215631889
load70160010071508741007
domContentLoaded680590967137772967
domInteractive221270173370
firstPaint30667973244593973
backgroundConnect641222067112220
firstReactRender26242912629
getState1418116022157160
initialActions31256225
loadScripts676588956133761956
setupStore14567152167
numNetworkReqs1459627761193277
FirefoxBrowserifyStandard HomeuiStartup14411283198413214861667
load1223109014377912761373
domContentLoaded1223108914367912761373
domInteractive1143333850120205
firstPaint------
backgroundConnect4220196264473
firstReactRender24215142528
getState10419320714
initialActions6118619316
loadScripts1198107113647612521341
setupStore1266791137
numNetworkReqs1367317761
BrowserifyPower User HomeuiStartup25012070304927126653049
load14101171181317715491813
domContentLoaded14101170181217715491812
domInteractive22088604175459604
firstPaint------
backgroundConnect1104224877207248
firstReactRender403062105162
getState1358120128150201
initialActions8147111147
loadScripts13681146177216814881772
setupStore2661022539102
numNetworkReqs1387132886211328
WebpackStandard HomeuiStartup17131456245217317782074
load14531234183812515061713
domContentLoaded14531234183812515061713
domInteractive1163243451134200
firstPaint------
backgroundConnect57202443361129
firstReactRender362291183579
getState947310720
initialActions7119921427
loadScripts14201217180011914731682
setupStore15663121450
numNetworkReqs1366817765
WebpackPower User HomeuiStartup25932194376547829643765
load14941243190222517671902
domContentLoaded14941243190222517671902
domInteractive16943538155305538
firstPaint------
backgroundConnect10431389103121389
firstReactRender46291041853104
getState14110421132161211
initialActions251245609245
loadScripts14551224184820417301848
setupStore2771312927131
numNetworkReqs1325832392213323
📊 Page Load Benchmark Results

Current Commit: 16e5664 | Date: 11/3/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 987ms (±44ms) 🟢 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 685ms (±59ms) 🟢 | historical mean value: 725ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 86ms (±119ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 987ms 44ms 960ms 1.32s 1.01s 1.32s
domContentLoaded 685ms 59ms 659ms 1.21s 699ms 1.21s
firstPaint 86ms 119ms 64ms 1.27s 84ms 1.27s
firstContentfulPaint 86ms 119ms 64ms 1.27s 84ms 1.27s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 68 Bytes (0%)
  • ui: 2.18 KiB (0.03%)
  • common: 303 Bytes (0%)

@jpuri jpuri enabled auto-merge November 4, 2025 09:45
@jpuri jpuri added this pull request to the merge queue Nov 4, 2025
auto-merge was automatically disabled November 4, 2025 11:08

Pull Request is not mergeable

Merged via the queue into main with commit 85a5904 Nov 4, 2025
480 of 485 checks passed
@jpuri jpuri deleted the dapp_swap_banner branch November 4, 2025 13:09
@github-actions github-actions bot locked and limited conversation to collaborators Nov 4, 2025
@metamaskbot metamaskbot added the release-13.9.0 Issue or pull request that will be included in release 13.9.0 label Nov 4, 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.9.0 Issue or pull request that will be included in release 13.9.0 size-M team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants