Skip to content

Conversation

@micaelae
Copy link
Member

@micaelae micaelae commented Jan 29, 2026

Description

This fixes a bug in which the extension could get in an invalid state when it's open both in fullscreen and sidepanel mode.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: fix: restore swap quote only when using extension in popup mode

Related issues

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

Manual testing steps

  1. Open wallet full screen mode
  2. Open sidepanel wallet
  3. Request swap quote
  4. Full-screen extension should not change
  5. Toggle popup view
  6. Request swap quote while extension is open in full-screen
  7. Click outside popup to close it
  8. Reopen wallet popup
  9. Verify that source and dest swap params match previous quote

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.

Note

Medium Risk
Changes routing logic that controls automatic navigation into swap/bridge flows, which could alter user navigation behavior across fullscreen/notification/popup environments. Risk is moderate because it affects swap/bridge UX but does not touch security-sensitive code.

Overview
Popup-only swap/bridge restoration: Updates ConfirmationHandler to detect ENVIRONMENT_TYPE_POPUP and only auto-redirect to the cross-chain swap prepare route when bridge quotes exist in popup mode.

This removes the prior auto-redirect into PREPARE_SWAP_ROUTE based on swap quotes/fetch params, reducing unexpected navigation in non-popup contexts while preserving the awaiting-swap redirect and approval-routing behavior.

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

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Jan 29, 2026

Builds ready [ed4a86d]
UI Startup Metrics (1337 ± 107 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13371094164110714081496
load--1136927141510412041287
domContentLoaded--1130920140910411971279
domInteractive--271798182382
firstPaint--1516839366199292
backgroundConnect--24022129012243269
firstReactRender--19124372331
initialActions--1011113
loadScripts--90470211821039721055
setupStore--1363561624
numNetworkReqs--211583161569
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--272217187821126127995476
load--1161991175115112161512
domContentLoaded--1142977173214911971473
domInteractive--39181692837106
firstPaint--235811751247259342
backgroundConnect--73428734637885682511
firstReactRender--261772102856
initialActions--106112
loadScripts--89474614441349461179
setupStore--1654971933
numNetworkReqs--1305434351165231
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--8526731051939231023
load--70859995285781869
domContentLoaded--70259694784775864
domInteractive--251690162373
firstPaint--1005830347120201
backgroundConnect--3719123194275
firstReactRender--15103251729
initialActions--105113
loadScripts--69959494583768862
setupStore--1162641319
numNetworkReqs--221585181574
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1247859244626014241763
load--70860610621126991035
domContentLoaded--69860010561126871029
domInteractive--37182283134111
firstPaint--1516951996191443
backgroundConnect--16013152758158340
firstReactRender--22173532329
initialActions--102111
loadScripts--69659810471116851021
setupStore--1142741319
numNetworkReqs--1465035161167279
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14311141229418915191780
load--1164989208216112211450
domContentLoaded--1163989208216112211449
domInteractive--8034971100100170
firstPaint--------
backgroundConnect--64212484688165
firstReactRender--14108991319
initialActions--103112
loadScripts--1131970204615311831402
setupStore--145119171150
numNetworkReqs--231288191881
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--26711861775168427833423
load--12551041182616713091683
domContentLoaded--12551041182616713091682
domInteractive--1403645785178346
firstPaint--------
backgroundConnect--43314140944685401132
firstReactRender--21146972228
initialActions--207123
loadScripts--11941022163511712491493
setupStore--11614672148125475
numNetworkReqs--85382554791205
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16531407213615717531965
load--14001167173211314811594
domContentLoaded--14001167173211314771594
domInteractive--953122644132172
firstPaint--------
backgroundConnect--722418440108146
firstReactRender--14114641523
initialActions--104122
loadScripts--1358114216239914051537
setupStore--2152213613123
numNetworkReqs--241293211887
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--28782200662449430583473
load--15381189373930916082060
domContentLoaded--15371183373830916082060
domInteractive--168441217197157627
firstPaint--------
backgroundConnect--3571261027235451910
firstReactRender--21153242328
initialActions--2137423
loadScripts--14991172368930615022033
setupStore--16010724188170618
numNetworkReqs--85372954997182
19--------
📊 Page Load Benchmark Results

Current Commit: ed4a86d | Date: 1/29/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 996ms (±44ms) 🟢 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 690ms (±37ms) 🟢 | historical mean value: 724ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±10ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 996ms 44ms 946ms 1.24s 1.06s 1.24s
domContentLoaded 690ms 37ms 655ms 928ms 742ms 928ms
firstPaint 76ms 10ms 60ms 164ms 84ms 164ms
firstContentfulPaint 76ms 10ms 60ms 164ms 84ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 4.26 KiB (0.05%)
  • common: 20 Bytes (0%)

@micaelae micaelae marked this pull request as ready for review January 29, 2026 23:01
@micaelae micaelae enabled auto-merge January 30, 2026 00:40
@micaelae micaelae changed the title fix: restore swap quote if using extension in popup mode fix: restore swap/bridge quote if using extension in popup mode Jan 30, 2026
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Jan 30, 2026

Builds ready [5fc28c5]
UI Startup Metrics (1299 ± 118 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--12991033151811813781486
load--1103868131611511831294
domContentLoaded--1095864129411511681282
domInteractive--251693182278
firstPaint--1526132360191252
backgroundConnect--21619726612220242
firstReactRender--17103351828
initialActions--104113
loadScripts--89566810971169701087
setupStore--1363761526
numNetworkReqs--221590191579
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--290917388017128240555186
load--1194974167813612401494
domContentLoaded--1175968166313512031484
domInteractive--42193334436142
firstPaint--243811509205272481
backgroundConnect--869292319886012382726
firstReactRender--25186772838
initialActions--104112
loadScripts--92673613681239681207
setupStore--1686781734
numNetworkReqs--1265131449145236
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--8466771066939141011
load--70460094185779857
domContentLoaded--69959593584773852
domInteractive--261688172376
firstPaint--1096223352151217
backgroundConnect--40191702844123
firstReactRender--15103851628
initialActions--104112
loadScripts--69659393383766849
setupStore--1263961328
numNetworkReqs--221583181572
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1326839263033515441812
load--72362310961127221047
domContentLoaded--71261610901137101039
domInteractive--40181593039134
firstPaint--1577350181206279
backgroundConnect--15513037734158194
firstReactRender--23174242529
initialActions--103111
loadScripts--70961410821117081024
setupStore--1254051522
numNetworkReqs--1565132556172283
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13581101194116514601658
load--1104955162211811711308
domContentLoaded--1103955162211811711308
domInteractive--63322113787135
firstPaint--------
backgroundConnect--59231904166160
firstReactRender--12103841316
initialActions--103122
loadScripts--1074940159510511421236
setupStore--13692141035
numNetworkReqs--231284181879
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--28271915551958829984061
load--13491096323733513751822
domContentLoaded--13491096323733513741821
domInteractive--165471236160175500
firstPaint--------
backgroundConnect--51312424183787511087
firstReactRender--21156572227
initialActions--203122
loadScripts--12701065316325713031668
setupStore--10613611124120420
numNetworkReqs--94412554992244
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--15491275205916416091886
load--13371099186613513781618
domContentLoaded--13371099186513513781618
domInteractive--832722943128147
firstPaint--------
backgroundConnect--67222605084163
firstReactRender--13102221417
initialActions--102122
loadScripts--12961076172611613461504
setupStore--1159913929
numNetworkReqs--221287151859
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--29702162599452031583835
load--15781266440739416862139
domContentLoaded--15781266440739416862139
domInteractive--172341416197172632
firstPaint--------
backgroundConnect--44712814253227211079
firstReactRender--22146062433
initialActions--113123
loadScripts--15391232437539216272098
setupStore--12912777152153531
numNetworkReqs--91322324496200
19--------
📊 Page Load Benchmark Results

Current Commit: 5fc28c5 | Date: 1/30/2026

📄 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: 718ms (±35ms) 🟢 | historical mean value: 722ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±10ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 38ms 1.00s 1.31s 1.06s 1.31s
domContentLoaded 718ms 35ms 695ms 982ms 736ms 982ms
firstPaint 77ms 10ms 60ms 164ms 88ms 164ms
firstContentfulPaint 77ms 10ms 60ms 164ms 88ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: -50 Bytes (0%)
  • common: 20 Bytes (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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Jan 30, 2026

Builds ready [27a3c04]
UI Startup Metrics (1318 ± 103 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13181091151810313931463
load--111289312769611871248
domContentLoaded--110689112689611801245
domInteractive--2715120202481
firstPaint--161611158156193299
backgroundConnect--23521532715238266
firstReactRender--1811168161926
initialActions--105112
loadScripts--8856731046959611025
setupStore--1364361525
numNetworkReqs--221585171573
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--21961626609670821914521
load--1138982169216111591542
domContentLoaded--1120967167915811441521
domInteractive--38191642539108
firstPaint--203731547161256393
backgroundConnect--4252832598391363814
firstReactRender--24164562641
initialActions--107113
loadScripts--87772413551449001242
setupStore--1765892036
numNetworkReqs--1285425854162248
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--84466713081289231061
load--7015921212110763899
domContentLoaded--6945851205109757893
domInteractive--251584172181
firstPaint--1035631948134195
backgroundConnect--38171352446100
firstReactRender--16103661827
initialActions--105112
loadScripts--6915831202109754891
setupStore--1263351225
numNetworkReqs--221582181579
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1296878188224715081756
load--7196151088100724997
domContentLoaded--7096081083100710985
domInteractive--3518112233598
firstPaint--1386748075164328
backgroundConnect--15613237538155226
firstReactRender--22173632329
initialActions--102111
loadScripts--707606107598708974
setupStore--1253941419
numNetworkReqs--974923146110208
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14161139190416515201729
load--1140967144310812231333
domContentLoaded--1139963144310812191333
domInteractive--74322134199162
firstPaint--------
backgroundConnect--65202304679170
firstReactRender--189494481321
initialActions--102122
loadScripts--110695213269311851280
setupStore--154160241144
numNetworkReqs--231286191879
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--26071912411743527313587
load--12571029247626412431954
domContentLoaded--12571029247526412431954
domInteractive--13236634107131399
firstPaint--------
backgroundConnect--32110512282683301090
firstReactRender--21156562227
initialActions--2056523
loadScripts--12041010233223112141745
setupStore--19810862227342688
numNetworkReqs--78392194192180
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16651371258620217622115
load--14251182207414314861665
domContentLoaded--14251182207414314861664
domInteractive--852919844130160
firstPaint--------
backgroundConnect--69242305084178
firstReactRender--14104841417
initialActions--108112
loadScripts--13851165196112714461574
setupStore--2042703912108
numNetworkReqs--241293201880
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--28612122439147329854038
load--15501257264930916612346
domContentLoaded--15501252264930916612346
domInteractive--122321381158104410
firstPaint--------
backgroundConnect--3271211094231374893
firstReactRender--22146572430
initialActions--217123
loadScripts--15031234261828515972209
setupStore--1649810217245757
numNetworkReqs--75382594682190
19--------
📊 Page Load Benchmark Results

Current Commit: 27a3c04 | Date: 1/30/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±46ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 743ms (±42ms) 🟢 | historical mean value: 717ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 81ms (±14ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 46ms 1.03s 1.41s 1.09s 1.41s
domContentLoaded 743ms 42ms 716ms 1.06s 757ms 1.06s
firstPaint 81ms 14ms 68ms 208ms 92ms 208ms
firstContentfulPaint 81ms 14ms 68ms 208ms 92ms 208ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: -50 Bytes (0%)
  • common: 20 Bytes (0%)

@micaelae micaelae added this pull request to the merge queue Feb 2, 2026
Merged via the queue into main with commit d4b5dae Feb 2, 2026
402 of 503 checks passed
@micaelae micaelae deleted the swaps3598-sidebar-restore-quote branch February 2, 2026 18:08
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2026
@metamaskbot metamaskbot added the release-13.18.0 Issue or pull request that will be included in release 13.18.0 label Feb 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.18.0 Issue or pull request that will be included in release 13.18.0 size-XS team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants