Skip to content

fix: bridge token address gets copied when Max button is clicked #33965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 30, 2025

Conversation

micaelae
Copy link
Member

@micaelae micaelae commented Jun 27, 2025

Description

Fixing a bug where the src token address gets copied to clipboard when the Max button is clicked. Also setting a fixed height for the balance row so it doesn't flicker when user changes the token or loads the page

Open in GitHub Codespaces

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-2523

Manual testing steps

  1. Go to bridge and select ERC20 src token
  2. Select ERC20 dest token
  3. Click Max
  4. Verify that address did not get copied to clipboard
  5. Verify that max amount is set
  6. Set amount greater than max
  7. Verify that balance amount turns red
  8. Click dest token address
  9. Verify that block explorer link is copied

Screenshots/Recordings

Before

After

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.

@metamaskbot metamaskbot added the team-swaps-and-bridge Swaps and Bridge team label Jun 27, 2025
@metamaskbot
Copy link
Collaborator

metamaskbot commented Jun 27, 2025

✨ Files requiring CODEOWNER review ✨

🔄 @MetaMask/swaps-engineers (3 files, +71 -111)
  • 📁 ui/
    • 📁 pages/
      • 📁 bridge/
        • 📁 __snapshots__/
          • 📄 index.test.tsx.snap +5 -19
        • 📁 prepare/
          • 📁 __snapshots__/
            • 📄 prepare-bridge-page.test.tsx.snap +10 -38
            • 📄 bridge-input-group.tsx +56 -54

@metamaskbot
Copy link
Collaborator

Builds ready [1d98033]
UI Startup Metrics (1172 ± 52 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1172107612995212141266
load100191610984410331066
domContentLoaded99490710904310251054
domInteractive18134971740
firstPaint643133106939310191049
backgroundConnect84335823
firstReactRender21174342126
getState1463371927
initialActions001001
loadScripts79070788642819851
setupStore85213817
WebpackHomeuiStartup21441594266922322622546
load16371192202019217551970
domContentLoaded16311188201519117521960
domInteractive171162131356
firstPaint1606638666176313
backgroundConnect2410279282235
firstReactRender22988420118377405
getState1143561225
initialActions216134
loadScripts16261187200519017451949
setupStore166236231622
FirefoxBrowserifyHomeuiStartup14751212227715815431797
load12821072212812913421430
domContentLoaded12821072212812913411430
domInteractive1343755288131337
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2715229252776
firstReactRender26223632832
getState155222301054
initialActions002001
loadScripts12581061210212513261398
setupStore154217301066
WebpackHomeuiStartup15921368255921216812089
load13701188200016714811787
domContentLoaded13691187200016714801787
domInteractive100324697491275
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2515285272541
firstReactRender41325444447
getState176216281333
initialActions002111
loadScripts13501167198116614641765
setupStore95427828
Benchmark value 24 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 2546 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 405 exceeds gate value 370 for chrome webpack home p95 firstReactRender
Benchmark value 1476 exceeds gate value 1405 for firefox browserify home mean uiStartup
Benchmark value 1282 exceeds gate value 1245 for firefox browserify home mean load
Benchmark value 1282 exceeds gate value 1239 for firefox browserify home mean domContentLoaded
Benchmark value 134 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 28 exceeds gate value 25 for firefox browserify home mean backgroundConnect
Benchmark value 26 exceeds gate value 25 for firefox browserify home mean firstReactRender
Benchmark value 16 exceeds gate value 11 for firefox browserify home mean getState
Benchmark value 1258 exceeds gate value 1230 for firefox browserify home mean loadScripts
Benchmark value 15 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 1797 exceeds gate value 1660 for firefox browserify home p95 uiStartup
Benchmark value 337 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 76 exceeds gate value 70 for firefox browserify home p95 backgroundConnect
Benchmark value 54 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 66 exceeds gate value 27 for firefox browserify home p95 setupStore
Benchmark value 101 exceeds gate value 100 for firefox webpack home mean domInteractive
Benchmark value 42 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 17 exceeds gate value 15 for firefox webpack home mean getState
Benchmark value 2089 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1787 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1787 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 275 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 33 exceeds gate value 32 for firefox webpack home p95 getState
Benchmark value 1765 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Sum of mean exceeds: 225ms | Sum of p95 exceeds: 1150ms
Sum of all benchmark exceeds: 1375ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 23 Bytes (0%)
  • ui: 96 Bytes (0%)
  • common: 15 Bytes (0%)

@metamaskbot
Copy link
Collaborator

Builds ready [79f442b]
UI Startup Metrics (1190 ± 65 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1190107914146512401306
load102091612296210561135
domContentLoaded101391012186210501125
domInteractive18145871739
firstPaint64980122641110311132
backgroundConnect84243813
firstReactRender23164572541
getState1466991928
initialActions001001
loadScripts80870699962846922
setupStore85193917
WebpackHomeuiStartup22431776276620423402666
load17061281219017117962005
domContentLoaded16991277218516917921991
domInteractive1812118161464
firstPaint1666368082175335
backgroundConnect289350432846
firstReactRender24590423111364406
getState1346081729
initialActions217134
loadScripts16961276217516817901979
setupStore197259262235
FirefoxBrowserifyHomeuiStartup13741231179311714191636
load1196106214407912521346
domContentLoaded1196106214397912521345
domInteractive1143645171114315
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2213146162137
firstReactRender25215842530
getState1149715933
initialActions001001
loadScripts1179104514247812371331
setupStore10420621726
WebpackHomeuiStartup16041385259221017102032
load13761181194116014981682
domContentLoaded13761180194116014981681
domInteractive100333436691287
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2715360352444
firstReactRender42325644549
getState177307301339
initialActions102111
loadScripts13561161192315914721662
setupStore11512315832
Benchmark value 24 exceeds gate value 23 for chrome browserify home mean firstReactRender
Benchmark value 2243 exceeds gate value 2192 for chrome webpack home mean uiStartup
Benchmark value 246 exceeds gate value 235 for chrome webpack home mean firstReactRender
Benchmark value 2667 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 65 exceeds gate value 57 for chrome webpack home p95 domInteractive
Benchmark value 335 exceeds gate value 334 for chrome webpack home p95 firstPaint
Benchmark value 406 exceeds gate value 370 for chrome webpack home p95 firstReactRender
Benchmark value 1980 exceeds gate value 1970 for chrome webpack home p95 loadScripts
Benchmark value 114 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 10 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 315 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 33 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 101 exceeds gate value 100 for firefox webpack home mean domInteractive
Benchmark value 27 exceeds gate value 26 for firefox webpack home mean backgroundConnect
Benchmark value 42 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 17 exceeds gate value 15 for firefox webpack home mean getState
Benchmark value 2032 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1682 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1681 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 287 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 39 exceeds gate value 32 for firefox webpack home p95 getState
Benchmark value 1662 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Benchmark value 32 exceeds gate value 28 for firefox webpack home p95 setupStore
Sum of mean exceeds: 76ms | Sum of p95 exceeds: 711ms
Sum of all benchmark exceeds: 787ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 23 Bytes (0%)
  • ui: 96 Bytes (0%)
  • common: 15 Bytes (0%)

@metamaskbot
Copy link
Collaborator

Builds ready [ad3e6c0]
UI Startup Metrics (1192 ± 74 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1192108014247412291374
load102091812367110551199
domContentLoaded101391412257110471192
domInteractive18144561734
firstPaint679100120940310291092
backgroundConnect84334813
firstReactRender22175862336
getState1564692032
initialActions001000
loadScripts807705101570843983
setupStore95264917
WebpackHomeuiStartup22731812284823923962755
load17421363213420018632040
domContentLoaded17351358211219818582028
domInteractive191272141560
firstPaint1686740378177347
backgroundConnect2610290292553
firstReactRender22393413104334405
getState14579111439
initialActions315134
loadScripts17321356210019618572017
setupStore1775892039
FirefoxBrowserifyHomeuiStartup14001241186511914441665
load1224108115558312851378
domContentLoaded1224108015558312851378
domInteractive1193557376122251
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect231486122348
firstReactRender25223422530
getState1158912927
initialActions001001
loadScripts1204106315408412651361
setupStore11423826624
WebpackHomeuiStartup16531367229320317612128
load14321175196916915411719
domContentLoaded14311175196916915401718
domInteractive105313877391314
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect22157092340
firstReactRender41335444347
getState157119151242
initialActions102111
loadScripts14131160194616815241701
setupStore11518218931
Benchmark value 1375 exceeds gate value 1365 for chrome browserify home p95 uiStartup
Benchmark value 1200 exceeds gate value 1190 for chrome browserify home p95 load
Benchmark value 1192 exceeds gate value 1180 for chrome browserify home p95 domContentLoaded
Benchmark value 983 exceeds gate value 940 for chrome browserify home p95 loadScripts
Benchmark value 2273 exceeds gate value 2192 for chrome webpack home mean uiStartup
Benchmark value 1742 exceeds gate value 1711 for chrome webpack home mean load
Benchmark value 1735 exceeds gate value 1704 for chrome webpack home mean domContentLoaded
Benchmark value 1732 exceeds gate value 1699 for chrome webpack home mean loadScripts
Benchmark value 2755 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 2041 exceeds gate value 2030 for chrome webpack home p95 load
Benchmark value 2029 exceeds gate value 2005 for chrome webpack home p95 domContentLoaded
Benchmark value 60 exceeds gate value 57 for chrome webpack home p95 domInteractive
Benchmark value 347 exceeds gate value 334 for chrome webpack home p95 firstPaint
Benchmark value 405 exceeds gate value 370 for chrome webpack home p95 firstReactRender
Benchmark value 2017 exceeds gate value 1970 for chrome webpack home p95 loadScripts
Benchmark value 120 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 12 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 1665 exceeds gate value 1660 for firefox browserify home p95 uiStartup
Benchmark value 251 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 27 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 1653 exceeds gate value 1615 for firefox webpack home mean uiStartup
Benchmark value 1432 exceeds gate value 1380 for firefox webpack home mean load
Benchmark value 1432 exceeds gate value 1380 for firefox webpack home mean domContentLoaded
Benchmark value 106 exceeds gate value 100 for firefox webpack home mean domInteractive
Benchmark value 41 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 16 exceeds gate value 15 for firefox webpack home mean getState
Benchmark value 1413 exceeds gate value 1360 for firefox webpack home mean loadScripts
Benchmark value 2128 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1719 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1718 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 314 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 42 exceeds gate value 32 for firefox webpack home p95 getState
Benchmark value 1701 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Benchmark value 31 exceeds gate value 28 for firefox webpack home p95 setupStore
Sum of mean exceeds: 394ms | Sum of p95 exceeds: 1125ms
Sum of all benchmark exceeds: 1519ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 23 Bytes (0%)
  • ui: 70 Bytes (0%)
  • common: 15 Bytes (0%)

@micaelae micaelae marked this pull request as ready for review June 27, 2025 18:16
@micaelae micaelae requested a review from a team as a code owner June 27, 2025 18:16
@micaelae micaelae enabled auto-merge June 27, 2025 18:39
@micaelae micaelae added this pull request to the merge queue Jun 30, 2025
Merged via the queue into main with commit 2ce425c Jun 30, 2025
149 checks passed
@micaelae micaelae deleted the swaps2523-bridge-max-button-copies-address branch June 30, 2025 16:28
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2025
@metamaskbot metamaskbot added the release-12.23.0 Issue or pull request that will be included in release 12.23.0 label Jun 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.23.0 Issue or pull request that will be included in release 12.23.0 team-swaps-and-bridge Swaps and Bridge team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants