Skip to content

Conversation

@jpuri
Copy link
Contributor

@jpuri jpuri commented Nov 13, 2025

Description

UI fixesin DAPP Shield functionlity.

Changelog

CHANGELOG entry:

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6252
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6256

Manual testing steps

  1. Trigger swap from test-dapp
  2. Check dapp swap banner displayed for UI fixes

Screenshots/Recordings

Screenshot 2025-11-13 at 5 25 31 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

Introduces quote-swap simulation details with savings highlight and tooltip, updates the Dapp Swap banner to use Market rate, and hides origin/recipient rows for quoted swaps with corresponding i18n and tests.

  • Confirmations UI:
    • Add QuoteSwapSimulationDetails showing outgoing/incoming balance changes and a highlighted "Get $X more" savings banner; includes header tooltip via bestQuoteTooltip.
    • Dapp Swap banner: switch selector label from metamaskRate to marketRate; remove auto-switch logic; wire selected quote to transaction update; minor styling import.
    • Hide Origin and Recipient rows, and batch approve simulation, for quoted swaps; add guard when txParams missing.
    • Extend simulation header to accept custom titleTooltip.
  • i18n:
    • Add bestQuoteTooltip, getDollarMore, marketRate; remove metamaskRate in en/en_GB.
  • Tests:
    • Update banner tests to expect "Market rate" and interactions; add tests for quote-swap details savings banner; update transaction details to skip rows for quoted swaps.
  • Misc:
    • Handle native-address source asset in quote simulation.

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

@jpuri jpuri requested a review from a team as a code owner November 13, 2025 11:56
@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 13, 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 Nov 13, 2025

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (11 files, +125 -31)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 components/
          • 📁 confirm/
            • 📁 dapp-swap-comparison-banner/
              • 📄 dapp-swap-comparison-banner.test.tsx +3 -3
              • 📄 dapp-swap-comparison-banner.tsx +3 -10
            • 📁 info/
              • 📁 batch/
                • 📁 batch-simulation-details/
                  • 📄 batch-simulation-details.tsx +2 -1
              • 📁 shared/
                • 📁 transaction-details/
                  • 📁 __snapshots__/
                    • 📄 transaction-details.test.tsx.snap +1 -1
                    • 📄 transaction-details.test.tsx +23 -0
                    • 📄 transaction-details.tsx +4 -2
          • 📁 simulation-details/
            • 📄 simulation-details.tsx +33 -6
          • 📁 transactions/
            • 📁 quote-swap-simulation-details/
              • 📄 index.scss +7 -0
              • 📄 quote-swap-simulation-details.test.tsx +2 -0
              • 📄 quote-swap-simulation-details.tsx +46 -8
            • 📄 index.scss +1 -0

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: UI Mismatch: MetaMask Swap vs. Market Rate

Removing the useEffect that syncs selectedSwapType with isQuotedSwap causes the UI to incorrectly display "Market rate" as selected when the transaction has already been updated to use the MetaMask quote. When a user selects MetaMask Swap and the transaction is updated with txParamsOriginal, the component will show the wrong button as selected if it remounts or the page refreshes, creating a mismatch between the actual transaction state and the displayed UI state.

ui/pages/confirmations/components/confirm/dapp-swap-comparison-banner/dapp-swap-comparison-banner.tsx#L108-L113

const hideDappSwapComparisonBanner = useCallback(() => {
setShowDappSwapComparisonBanner(false);
}, [setShowDappSwapComparisonBanner]);
const updateSwapToCurrent = useCallback(() => {

Fix in Cursor Fix in Web


@metamaskbot
Copy link
Collaborator

Builds ready [40c0b7d]
UI Startup Metrics (1229 ± 90 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1229108314349012941403
load105289912298311191207
domContentLoaded104689312208211161195
domInteractive2214102171966
firstPaint64174123042710591201
backgroundConnect2322192516236242
firstReactRender3220120133750
getState24970112950
initialActions106113
loadScripts82066698480892965
setupStore1262741421
numNetworkReqs1367620674
BrowserifyPower User HomeuiStartup17011505258727918852587
load1055915166521212541665
domContentLoaded1047908165821312501658
domInteractive38151123695112
firstPaint71526010213039491021
backgroundConnect24122627411248274
firstReactRender41374424244
getState18115821818198218
initialActions102112
loadScripts815681139220510231392
setupStore11101821218
numNetworkReqs1197125068167250
WebpackStandard HomeuiStartup83170812241108291156
load616558100899604929
domContentLoaded60955398996598917
domInteractive171166121456
firstPaint21557993234186912
backgroundConnect261284143159
firstReactRender3018137133345
getState1172031316
initialActions103111
loadScripts60655197993595907
setupStore1163141318
numNetworkReqs1367619871
WebpackPower User HomeuiStartup1066903156824414431568
load646564933116730933
domContentLoaded632554918112715918
domInteractive36121554163155
firstPaint30763921257570921
backgroundConnect49102124977212
firstReactRender38354123941
getState1399616621150166
initialActions101111
loadScripts628552908109705908
setupStore1163281032
numNetworkReqs1076821954164219
FirefoxBrowserifyStandard HomeuiStartup15041329201113115311833
load1260113715259113041493
domContentLoaded1259113715259113041492
domInteractive1113637263106300
firstPaint------
backgroundConnect4525129185388
firstReactRender26225652735
getState1286471220
initialActions213122
loadScripts1233111914978712591461
setupStore168163191337
numNetworkReqs1266815755
BrowserifyPower User HomeuiStartup22631859296533725182965
load13941151184321115861843
domContentLoaded13931151184221115851842
domInteractive19378541142235541
firstPaint------
backgroundConnect1193234991220349
firstReactRender675084107884
getState15011525736177257
initialActions51409340
loadScripts13331133178821115411788
setupStore29679214979
numNetworkReqs1576931275215312
WebpackStandard HomeuiStartup15741404212315416001967
load13361183165310613781547
domContentLoaded13361183165310613781547
domInteractive933123432105170
firstPaint------
backgroundConnect46252753050102
firstReactRender31248183443
getState157186211149
initialActions203122
loadScripts13091164162710213531524
setupStore15685151161
numNetworkReqs1366918767
WebpackPower User HomeuiStartup21571805338148225093381
load14321210191424117161914
domContentLoaded14321210191324117161913
domInteractive17866563168313563
firstPaint------
backgroundConnect10429397103193397
firstReactRender67411152372115
getState1218321035129210
initialActions218228
loadScripts13981193185722516341857
setupStore3951685924168
numNetworkReqs1366132285234322
📊 Page Load Benchmark Results

Current Commit: 40c0b7d | Date: 11/13/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±38ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 733ms (±35ms) 🟢 | historical mean value: 721ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±10ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 38ms 1.02s 1.33s 1.08s 1.33s
domContentLoaded 733ms 35ms 706ms 998ms 761ms 998ms
firstPaint 78ms 10ms 64ms 156ms 84ms 156ms
firstContentfulPaint 78ms 10ms 64ms 156ms 84ms 156ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 602 Bytes (0.01%)
  • common: 229 Bytes (0%)

@jpuri jpuri enabled auto-merge November 13, 2025 12:38
@metamaskbot
Copy link
Collaborator

Builds ready [72b8e2b]
UI Startup Metrics (1252 ± 84 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1252109314768413091388
load107894612717611361201
domContentLoaded107194012627611311191
domInteractive2314100162067
firstPaint65291127842810941179
backgroundConnect23822131112241258
firstReactRender3019146143345
getState2495392842
initialActions104112
loadScripts841688101075898959
setupStore1263051325
numNetworkReqs1367620671
BrowserifyPower User HomeuiStartup23502067320928424463209
load1152941176625213931766
domContentLoaded1134926174625413851746
domInteractive611821268138212
firstPaint699229178049010461780
backgroundConnect24923029519257295
firstReactRender75481282085128
getState21416929941249299
initialActions104114
loadScripts907709146524511541465
setupStore241256102756
numNetworkReqs15910329374271293
WebpackStandard HomeuiStartup751633103383754965
load54550183873539785
domContentLoaded53849180669534753
domInteractive15114381340
firstPaint18955812192161719
backgroundConnect2712136173258
firstReactRender27175973134
getState1162531216
initialActions101011
loadScripts53448879864531706
setupStore1153041217
numNetworkReqs1467720874
WebpackPower User HomeuiStartup1053896156221511531562
load667571928121789928
domContentLoaded650561912117775912
domInteractive35131243669124
firstPaint39881915300778915
backgroundConnect41101803954180
firstReactRender39354434244
getState1365216530153165
initialActions101011
loadScripts646559902113765902
setupStore96234923
numNetworkReqs1086923456171234
FirefoxBrowserifyStandard HomeuiStartup14451275188612014811699
load1224110814367512691388
domContentLoaded1224110714357512691388
domInteractive1063430347108221
firstPaint------
backgroundConnect4124158204884
firstReactRender25205662541
getState1175561019
initialActions114122
loadScripts1200108813826812431357
setupStore147193221136
numNetworkReqs1266616760
BrowserifyPower User HomeuiStartup34422801436145038244361
load15381303199224919071992
domContentLoaded15381303199124919061991
domInteractive329123802210481802
firstPaint------
backgroundConnect642127127733210291277
firstReactRender914912825123128
getState1498323743185237
initialActions213123
loadScripts14841246196323818441963
setupStore1013052711493527
numNetworkReqs1519032465209324
WebpackStandard HomeuiStartup16191371212014616861933
load13731190169811214341608
domContentLoaded13721190169711214331608
domInteractive993537141111157
firstPaint------
backgroundConnect49262162751114
firstReactRender312378103241
getState137101111229
initialActions1010122
loadScripts13441170166610714101554
setupStore15789161252
numNetworkReqs1366917863
WebpackPower User HomeuiStartup35643000487850239484878
load16931450224323919302243
domContentLoaded16931449224323919292243
domInteractive330130781212542781
firstPaint------
backgroundConnect47616110902735981090
firstReactRender915613121110131
getState16610926241177262
initialActions212022
loadScripts16281410213221918922132
setupStore18123597180190597
numNetworkReqs1548422556209225
📊 Page Load Benchmark Results

Current Commit: 72b8e2b | Date: 11/13/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.02s (±39ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 713ms (±37ms) 🟢 | historical mean value: 724ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±11ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.02s 39ms 1.00s 1.34s 1.05s 1.34s
domContentLoaded 713ms 37ms 693ms 1.01s 733ms 1.01s
firstPaint 75ms 11ms 60ms 168ms 84ms 168ms
firstContentfulPaint 75ms 11ms 60ms 168ms 84ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 798 Bytes (0.01%)
  • common: 229 Bytes (0%)

@metamaskbot
Copy link
Collaborator

Builds ready [d60faaf]
UI Startup Metrics (1183 ± 121 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1183990177412112291437
load1020849160911510621256
domContentLoaded1013841157511310551247
domInteractive231491162162
firstPaint67271161841110331228
backgroundConnect20317727420211242
firstReactRender29185183645
getState2276592737
initialActions104112
loadScripts81664713281078641034
setupStore1061821116
numNetworkReqs1367519672
BrowserifyPower User HomeuiStartup21171749262622222572626
load1145977175221112981752
domContentLoaded1124959172720812831727
domInteractive581820759135207
firstPaint755134138140810361381
backgroundConnect25322730319266303
firstReactRender78461482687148
getState20716928833234288
initialActions104124
loadScripts893740148620410511486
setupStore321162144062
numNetworkReqs1188516426153164
WebpackStandard HomeuiStartup86772512921058741147
load630569101892629901
domContentLoaded62256399588622883
domInteractive181277141555
firstPaint19961998206193843
backgroundConnect2611100162570
firstReactRender3520218233850
getState1162031416
initialActions102011
loadScripts61956198586620872
setupStore1263251420
numNetworkReqs1367319870
WebpackPower User HomeuiStartup1083898181325113321813
load68457510031568911003
domContentLoaded666565972145867972
domInteractive431314150120141
firstPaint372118975254572975
backgroundConnect4592485652248
firstReactRender43375854358
getState1419517023155170
initialActions101011
loadScripts662563961141857961
setupStore96244824
numNetworkReqs786112622103126
FirefoxBrowserifyStandard HomeuiStartup14621317200413214941789
load1230112415769312571442
domContentLoaded1230112415769312571442
domInteractive56332844252168
firstPaint------
backgroundConnect392395144678
firstReactRender28226262843
getState137217211122
initialActions208123
loadScripts1207110815519012271419
setupStore147195201232
numNetworkReqs1266215859
BrowserifyPower User HomeuiStartup34782665472262937894722
load15801369205622117132056
domContentLoaded15791368205622117122056
domInteractive25079662166348662
firstPaint------
backgroundConnect681173137343311071373
firstReactRender884812825111128
getState1607628751180287
initialActions213023
loadScripts15151300202522216432025
setupStore14737528149195528
numNetworkReqs1267823054186230
WebpackStandard HomeuiStartup16211410222313916461969
load13771214179410814161629
domContentLoaded13771213179410814151629
domInteractive54301752762119
firstPaint------
backgroundConnect49221542653119
firstReactRender32258693347
getState1175351117
initialActions102122
loadScripts13451197170710013731582
setupStore14683141251
numNetworkReqs1266816764
WebpackPower User HomeuiStartup31242630420445832184204
load16381426219019217952190
domContentLoaded16381426219019217932190
domInteractive27875750160384750
firstPaint------
backgroundConnect310176697155413697
firstReactRender83581071495107
getState1534523448190234
initialActions203123
loadScripts15931388214419517472144
setupStore19734533174392533
numNetworkReqs1257820243172202
📊 Page Load Benchmark Results

Current Commit: d60faaf | Date: 11/14/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±37ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 725ms (±34ms) 🟢 | historical mean value: 730ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 79ms (±11ms) 🟢 | historical mean value: 79ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 37ms 1.02s 1.33s 1.05s 1.33s
domContentLoaded 725ms 34ms 703ms 987ms 739ms 987ms
firstPaint 79ms 11ms 60ms 172ms 84ms 172ms
firstContentfulPaint 79ms 11ms 60ms 172ms 84ms 172ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 798 Bytes (0.01%)
  • common: 229 Bytes (0%)

@jpuri jpuri added this pull request to the merge queue Nov 14, 2025
Merged via the queue into main with commit dec9a3e Nov 14, 2025
174 checks passed
@jpuri jpuri deleted the dapp_shield_ui_fixes branch November 14, 2025 16:03
@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2025
@metamaskbot metamaskbot added the release-13.11.0 Issue or pull request that will be included in release 13.11.0 label Nov 14, 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-M team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants