Skip to content

Conversation

@amandaye0h
Copy link
Contributor

@amandaye0h amandaye0h commented Oct 3, 2025

Description

This PR refactors the slippage buttons to follow the Trade UI selection patterns used in our Mobile app. It improves cross-client consistency by replacing the old logic with ButtonSecondary, ensuring the buttons inherit design system standards.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null: UI fixes

Related issues

Fixes:

Manual testing steps

  1. Swap a token
  2. Click on the settings icon in the top right
  3. Check that all slippage buttons behave as expected

Screenshots/Recordings

Before

Screen.Recording.2025-10-08.at.4.17.09.PM.mov

After

Screen.Recording.2025-10-03.at.3.57.37.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

Refactors bridge slippage controls to use design-system Button variants/sizes and simplifies text field styling.

  • Bridge transaction settings modal (ui/pages/bridge/prepare/bridge-transaction-settings-modal.tsx):
    • Replace ButtonPrimary submit with Button (ButtonVariant.Primary, ButtonSize.Lg).
    • Update slippage selection buttons to ButtonSize.Md and use ButtonVariant.Primary/Secondary for selected state; remove manual border/background/text color logic.
    • Change label to Text with variant bodyMdMedium; adjust container padding (paddingInline, paddingBottom).
    • TextField: set size to Md, borderColor to borderMuted, borderRadius to XL; remove explicit border width.
  • Styles (ui/pages/bridge/prepare/index.scss):
    • Simplify .bridge-settings-modal .mm-text-field: remove fixed heights and input font-size/padding; keep width; maintain secondary button hover style.

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2025

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 3, 2025

✨ Files requiring CODEOWNER review ✨

🔄 @MetaMask/swaps-engineers (2 files, +32 -84)
  • 📁 ui/
    • 📁 pages/
      • 📁 bridge/
        • 📁 prepare/
          • 📄 bridge-transaction-settings-modal.tsx +32 -80
          • 📄 index.scss +0 -4

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 8d9f4c2 | Date: 10/3/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±72ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 731ms (±70ms) 🟢 | historical mean value: 738ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±10ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 72ms 1.00s 1.31s 1.30s 1.31s
domContentLoaded 731ms 70ms 697ms 993ms 979ms 993ms
firstPaint 76ms 10ms 60ms 156ms 88ms 156ms
firstContentfulPaint 76ms 10ms 60ms 156ms 88ms 156ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [8d9f4c2]
UI Startup Metrics (1230 ± 65 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1230109914386512691363
load106396512315610941154
domContentLoaded105796212205510871148
domInteractive17136881638
firstPaint55274120743310731131
backgroundConnect2522392766256262
firstReactRender23165052334
getState1365171626
initialActions50587514
loadScripts81172495753841899
setupStore962331016
WebpackHomeuiStartup20041540260226221652511
load16281264200820217451961
domContentLoaded16181259199820317391942
domInteractive171288141452
firstPaint1766436769212312
backgroundConnect2915296302775
firstReactRender87373257280310
getState3153267313273
initialActions52334511
loadScripts16151257198620117351930
setupStore185294441226
FirefoxBrowserifyHomeuiStartup14101227191812414611662
load1216107014258512881363
domContentLoaded1216106914258512881363
domInteractive993324348105232
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3320133203582
firstReactRender27245332832
getState9313516638
initialActions41616311
loadScripts1193105414058412641340
setupStore95548826
WebpackHomeuiStartup15751386220717816592030
load13321164182113314221596
domContentLoaded13321164182113214211596
domInteractive1053340864106298
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3322184173849
firstReactRender37315144048
getState10318024621
initialActions31233311
loadScripts13091141180213314031569
setupStore13522029922
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: -298 Bytes (0%)
  • common: 10 Bytes (0%)

@metamaskbot
Copy link
Collaborator

❌ test-e2e-chrome-api-specs failed. View the html report here.

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: bf01e69 | Date: 10/3/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±76ms) 🟡 | historical mean value: 1.06s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 742ms (±73ms) 🟢 | historical mean value: 741ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±16ms) 🟢 | historical mean value: 81ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 76ms 1.01s 1.42s 1.29s 1.42s
domContentLoaded 742ms 73ms 704ms 1.07s 957ms 1.07s
firstPaint 78ms 16ms 60ms 224ms 88ms 224ms
firstContentfulPaint 78ms 16ms 60ms 224ms 88ms 224ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [bf01e69]
UI Startup Metrics (1230 ± 62 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1230110613836212631346
load106395812225710901168
domContentLoaded105695212155610791161
domInteractive18135571741
firstPaint67495122542310691145
backgroundConnect2532402767257265
firstReactRender24185062538
getState1253761626
initialActions50214610
loadScripts81071596355835924
setupStore1052941020
WebpackHomeuiStartup21411565273328623212591
load16941237213621618481998
domContentLoaded16851226212021518361988
domInteractive2012120181675
firstPaint1757445767195316
backgroundConnect3415295293564
firstReactRender1113836091101329
getState3153226516253
initialActions8218118723
loadScripts16811223210821418311979
setupStore3253136917273
FirefoxBrowserifyHomeuiStartup15561324193212216141817
load1331115415368513861494
domContentLoaded1330115315358513851493
domInteractive1113837258113257
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect39231442340100
firstReactRender32256473350
getState11416520824
initialActions41445410
loadScripts1300113215128613551473
setupStore146186211049
WebpackHomeuiStartup15761378211514916811840
load13451161167013014521568
domContentLoaded13451161167013014521567
domInteractive1083436359108300
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect29205473642
firstReactRender37315133941
getState731641668
initialActions3144538
loadScripts13231142164913114351548
setupStore10511011919
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: -298 Bytes (0%)
  • common: 10 Bytes (0%)

@metamaskbot
Copy link
Collaborator

❌ test-e2e-chrome-api-specs failed. View the html report here.

@amandaye0h amandaye0h marked this pull request as ready for review October 8, 2025 08:18
@amandaye0h amandaye0h requested a review from a team as a code owner October 8, 2025 08:18
cursor[bot]

This comment was marked as outdated.

: `${customSlippage}%`}
</Text>
</Button>
<>
Copy link
Contributor

@infiniteflower infiniteflower Oct 8, 2025

Choose a reason for hiding this comment

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

Can we not use the variant prop way so we can prevent duplicating logic by having only a single button component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted, thanks for the suggestion!

I've updated the code to conditionally render the buttons using the variant prop. Now the logic is not duplicated.

!isAutoSelected && localSlippage === hardcodedSlippage;
return (
<Button
isAutoSelected === false && localSlippage === hardcodedSlippage;
Copy link
Member

Choose a reason for hiding this comment

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

@amandaye0h I agree with Cursor here. can you change this to check for !isAutoSelected instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted, I reverted the change:

Screenshot 2025-10-23 at 2 24 01 AM

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: e3c0ea8 | Date: 10/20/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±77ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 744ms (±72ms) 🟢 | historical mean value: 733ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±14ms) 🟢 | historical mean value: 79ms ⬆️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 77ms 1.00s 1.37s 1.31s 1.37s
domContentLoaded 744ms 72ms 699ms 1.02s 1.00s 1.02s
firstPaint 80ms 14ms 60ms 200ms 96ms 200ms
firstContentfulPaint 80ms 14ms 60ms 200ms 96ms 200ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [e3c0ea8]
UI Startup Metrics (1262 ± 84 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1262112417898413001372
load108096615537611131192
domContentLoaded107495515397511071180
domInteractive1914126131743
firstPaint71186121843210981188
backgroundConnect2562432879259276
firstReactRender27185073041
getState22890132645
initialActions50365613
loadScripts824707127573859924
setupStore1063041022
WebpackHomeuiStartup842723111565870952
load63357891764642768
domContentLoaded62557390363631763
domInteractive16115291445
firstPaint17154907164175609
backgroundConnect21104372637
firstReactRender26175583140
getState1153141416
initialActions3011248
loadScripts62357189261629761
setupStore952031114
FirefoxBrowserifyHomeuiStartup14801317194610815321638
load1253112114237313081374
domContentLoaded1253112014237313081374
domInteractive1153433058123261
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect4027120174381
firstReactRender26224752644
getState74344715
initialActions7118620316
loadScripts1228110114037112821347
setupStore15658101537
WebpackHomeuiStartup15911392218814116141927
load1350121916589013941523
domContentLoaded1350121816589013931522
domInteractive1063036058109275
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect4023102164774
firstReactRender312278133373
getState9412313915
initialActions9120830326
loadScripts1326120116318613661489
setupStore196217261455
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: -298 Bytes (0%)
  • common: 10 Bytes (0%)

@amandaye0h amandaye0h added the team-design-system All issues relating to design system in Extension label Oct 22, 2025
@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: d039c94 | Date: 10/22/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±72ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 726ms (±70ms) 🟢 | historical mean value: 740ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±11ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 72ms 998ms 1.31s 1.29s 1.31s
domContentLoaded 726ms 70ms 690ms 996ms 967ms 996ms
firstPaint 75ms 11ms 60ms 168ms 84ms 168ms
firstContentfulPaint 75ms 11ms 60ms 168ms 84ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [d039c94]
UI Startup Metrics (1274 ± 85 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1274111215538513231413
load109695914128511391243
domContentLoaded109195414028411321236
domInteractive19134771840
firstPaint64885141545111101205
backgroundConnect2332192597236246
firstReactRender26194562940
getState16591111933
initialActions60799716
loadScripts8637241154849031010
setupStore1062231118
BrowserifyPower User HomeuiStartup22321860353551028063535
load1112937167723414281677
domContentLoaded1104929166723314191667
domInteractive321585245885
firstPaint852194168237110141682
backgroundConnect25422331231292312
firstReactRender22212612326
getState20417923914211239
initialActions945212752
loadScripts859707136520411361365
setupStore1482972529
WebpackStandard HomeuiStartup8457331107668571004
load64359593571645846
domContentLoaded63558992870638837
domInteractive16126591437
firstPaint19058931199179807
backgroundConnect23124462635
firstReactRender27174773235
getState941831214
initialActions206136
loadScripts63258691568636826
setupStore1051621114
WebpackPower User HomeuiStartup15511251225930919632259
load707620949108849949
domContentLoaded68660692798810927
domInteractive221356132956
firstPaint319108881288618881
backgroundConnect731521173185211
firstReactRender21192522225
getState19013330343194303
initialActions812591925
loadScripts68160491294799912
setupStore17537102337
FirefoxBrowserifyStandard HomeuiStartup14721280200311415131705
load1249111214487012941388
domContentLoaded1249111214477012941388
domInteractive1163631857123297
firstPaint------
backgroundConnect4023121174375
firstReactRender26214852742
getState133196231044
initialActions519510411
loadScripts1222109314166512661341
setupStore125153151232
BrowserifyPower User HomeuiStartup26062248302626629043026
load14071141163414815591634
domContentLoaded14071141163414815591634
domInteractive15448490109227490
firstPaint------
backgroundConnect12527463112210463
firstReactRender38265694556
getState1512030063172300
initialActions61174817
loadScripts13581119155913915241559
setupStore4253458039345
WebpackStandard HomeuiStartup16281400224516516702066
load13871220173110314321610
domContentLoaded13871220173010314311610
domInteractive1133142271114375
firstPaint------
backgroundConnect4823149256494
firstReactRender312287103445
getState113177171019
initialActions9120425443
loadScripts1355116816599714111551
setupStore166224271155
WebpackPower User HomeuiStartup25352228298717825902987
load14741294173613815781736
domContentLoaded14741293173613815761736
domInteractive1323633185149331
firstPaint------
backgroundConnect843021760139217
firstReactRender462795194895
getState15610024645216246
initialActions11154141754
loadScripts14391262168712615441687
setupStore32583286083
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 124.16 KiB (2.76%)
  • ui: 44.51 KiB (0.69%)
  • common: 287.2 KiB (3.41%)

@amandaye0h amandaye0h added this pull request to the merge queue Oct 29, 2025
Merged via the queue into main with commit 2c1119a Oct 29, 2025
177 checks passed
@amandaye0h amandaye0h deleted the swaps/slippage-design-qa branch October 29, 2025 03:21
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2025
@metamaskbot metamaskbot added the release-13.8.0 Issue or pull request that will be included in release 13.8.0 label Oct 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.8.0 Issue or pull request that will be included in release 13.8.0 size-M team-assets team-design-system All issues relating to design system in Extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants