Skip to content

feat: integrate streams with perps ui#40781

Merged
aganglada merged 124 commits intomainfrom
feat/integrate-perps-controller-ui-integration
Mar 23, 2026
Merged

feat: integrate streams with perps ui#40781
aganglada merged 124 commits intomainfrom
feat/integrate-perps-controller-ui-integration

Conversation

@gambinish
Copy link
Copy Markdown
Member

@gambinish gambinish commented Mar 10, 2026

Description

Builds on #40779 to apply the streaming hooks architecture across Perps UI surfaces. This completes the migration from direct PerpsController UI usage to background RPC + stream-manager driven data flow.

Why
The streaming infrastructure (PerpsStreamBridge, PerpsStreamManager, stream hooks) existed in the base branch but was not fully consumed by Perps UI. Components still accessed controller logic directly, crossing the intended UI/background boundary and leaving stream lifecycle behavior inconsistent across pages.

What changed

  • Perps pages now consume live stream hooks (usePerpsLive*) instead of direct controller reads.
  • Page-level effects activate/deactivate symbol scoped price/orderbook streams via submitRequestToBackground.
  • Added view-level stream gating so bridge emissions are active only while Perps surfaces are mounted (PerpsLayout routes + account-overview boundary).
  • Trading actions (place/close/reverse/update TP/SL/deposit) now go through background RPC paths rather than direct controller method calls.
  • Deposit flow moved to confirmation based flow (usePerpsDepositConfirmation).
  • usePerpsEligibility simplified to Redux-selector driven access.
  • Renamed PerpsTabView to PerpsView for future proofing.

Improvement / solution

  • Enforces extension composition boundaries (UI <-> background).
  • Aligns all Perps screens with one streaming lifecycle model.
  • Reduces stale/missing live-data risk during symbol/account transitions.
  • Establishes a single coherent branch for UAT instead of parallel diverging implementations.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

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

High Risk
High risk because it rewires Perps trading actions and live-data subscriptions to use background RPC/stream lifecycle controls across multiple routes and modals, which can break order execution or stale data handling if any method wiring/regression occurs.

Overview
Migrates Perps UI surfaces from direct PerpsController usage to background RPC + PerpsStreamManager channels, including order/position actions (perpsPlaceOrder, perpsClosePosition, perpsUpdateMargin, perpsUpdatePositionTPSL) and history fetches (perpsGetOrders, perpsGetOrderFills, perpsGetFunding, perpsGetUserHistory).

Introduces explicit stream lifecycle gating via usePerpsViewActive and new boundaries (PerpsLayout for routes, PerpsViewStreamBoundary for the account-overview tab), and adds page-level activation/deactivation for symbol-scoped price/orderbook streams.

Renames/rewires the main tab surface to PerpsView (replacing PerpsTabView), updates recent activity to be passed in via props (no longer using UI mocks by default), and adjusts order-entry calculations to use limit price when present; includes broad test updates/new tests for the new hooks and stream-based behavior.

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

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 10, 2026

✨ Files requiring CODEOWNER review ✨

🔑 @MetaMask/accounts-engineers (1 files, +4 -5)
  • 📁 ui/
    • 📁 components/
      • 📁 multichain/
        • 📁 account-overview/
          • 📄 account-overview-tabs.tsx +4 -5

👨‍🔧 @MetaMask/core-extension-ux (1 files, +4 -5)
  • 📁 ui/
    • 📁 components/
      • 📁 multichain/
        • 📁 account-overview/
          • 📄 account-overview-tabs.tsx +4 -5

👨‍🔧 @MetaMask/perps (28 files, +880 -455)
  • 📁 test/
    • 📁 e2e/
      • 📁 page-objects/
        • 📁 pages/
          • 📁 perps/
            • 📄 perps-home-page.ts +5 -4
            • 📄 perps-tab-page.ts +1 -1
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 perps/
          • 📁 close-position/
            • 📄 close-position-modal.tsx +7 -14
          • 📁 edit-margin/
            • 📄 edit-margin-expandable.test.tsx +24 -33
            • 📄 edit-margin-expandable.tsx +0 -4
            • 📄 edit-margin-modal-content.tsx +17 -15
            • 📄 edit-margin-modal.tsx +0 -4
          • 📁 hooks/
            • 📄 createPerpsDepositTransaction.test.ts +44 -0
            • 📄 createPerpsDepositTransaction.ts +33 -0
            • 📄 usePerpsDepositConfirmation.test.ts +164 -0
            • 📄 usePerpsDepositConfirmation.ts +93 -0
          • 📁 order-entry/
            • 📁 components/
              • 📁 amount-input/
                • 📄 amount-input.tsx +1 -2
              • 📄 index.ts +0 -12
          • 📁 perps-market-balance-actions/
            • 📄 perps-market-balance-actions.tsx +7 -2
          • 📁 perps-recent-activity/
            • 📄 perps-recent-activity.test.tsx +167 -93
            • 📄 perps-recent-activity.tsx +4 -3
          • 📁 reverse-position/
            • 📄 reverse-position-modal.test.tsx +97 -110
            • 📄 reverse-position-modal.tsx +27 -24
          • 📁 update-tpsl/
            • 📄 update-tpsl-modal-content.test.tsx +71 -40
            • 📄 update-tpsl-modal-content.tsx +18 -23
            • 📄 update-tpsl-modal.tsx +0 -4
            • 📄 index.ts +2 -1
            • 📄 mocks.ts +1 -0
            • 📄 perps-view-stream-boundary.test.tsx +39 -0
            • 📄 perps-view-stream-boundary.tsx +19 -0
            • 📄 perps-view.test.tsx +23 -30
            • 📄 perps-view.tsx +16 -34
    • 📁 hooks/
      • 📁 perps/
        • 📄 index.ts +0 -2

🧪 @MetaMask/qa (2 files, +6 -5)
  • 📁 test/
    • 📁 e2e/
      • 📁 page-objects/
        • 📁 pages/
          • 📁 perps/
            • 📄 perps-home-page.ts +5 -4
            • 📄 perps-tab-page.ts +1 -1

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 10, 2026

Builds ready [de2391a]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account29426932019302320
total29426932019302320
Confirm Txconfirm_tx6049600260793060716079
total6049600260793060716079
Bridge User Actionsbridge_load_page22220724312227243
bridge_load_asset_picker1811791821182182
bridge_search_token7057047061705706
total109710901102511001102
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup15701291192311316441750
load13051056153610513731459
domContentLoaded12981051151210413651450
domInteractive3117156252792
firstPaint181711299137241298
backgroundConnect22820631717233256
firstReactRender19135752024
initialActions107113
loadScripts1087848129610411591242
setupStore1484461624
numNetworkReqs362792193084
Power User HomeuiStartup5532194314569226463218990
load13111117294122013271606
domContentLoaded12911103284521213001586
domInteractive3919310473197
firstPaint215821286151257390
backgroundConnect178729610507193726795518
firstReactRender27186272942
initialActions104113
loadScripts1047900179513410751318
setupStore1573971828
numNetworkReqs21011645948219301
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202172232222223
srpButtonToSrpForm97959919999
confirmSrpToPwForm22222312323
pwFormToMetricsScreen16151601616
metricsToWalletReadyScreen16161701717
doneButtonToHomeScreen5945905994594599
openAccountMenuToAccountListLoaded292929232932329312932
total389838893902639023902
Onboarding New WalletcreateWalletToSocialScreen2192192200220220
srpButtonToPwForm1071041112108111
createPwToRecoveryScreen989099
skipBackupToMetricsScreen36343923739
agreeButtonToOnboardingSuccess17171801718
doneButtonToAssetList49648251111503511
total88486890415893904
Asset DetailsassetClickToPriceChart14912717315156173
total14912717315156173
Solana Asset DetailsassetClickToPriceChart80768438384
total80768438384
Import Srp HomeloginToHomeScreen2315226523733723322373
openAccountMenuAfterLogin936512422113124
homeAfterImportWithNewWallet2464242425535324522553
total4889486349091949094909
Send TransactionsopenSendPageFromHome29283013030
selectTokenToSendFormLoaded23182942729
reviewTransactionToConfirmationPage8508458574850857
total8998949096899909
SwapopenSwapPageFromHome311948134648
fetchAndDisplaySwapQuotes268926882691126892691
total2726270927371227352737
🌐 Dapp Page Load Benchmarks

Current Commit: de2391a | Date: 3/10/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.07s (±43ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 751ms (±40ms) 🟢 | historical mean value: 727ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 83ms (±10ms) 🟢 | historical mean value: 82ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.07s 43ms 1.04s 1.38s 1.09s 1.38s
domContentLoaded 751ms 40ms 733ms 1.05s 775ms 1.05s
firstPaint 83ms 10ms 68ms 168ms 92ms 168ms
firstContentfulPaint 83ms 10ms 68ms 168ms 92ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 7.6 MiB (100%)
  • ui: 8.36 MiB (100%)
  • common: 11 MiB (100%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 11, 2026

Builds ready [51ecc8a]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2632612641264264
total2632612641264264
Confirm Txconfirm_tx602960166037960366037
total602960166037960366037
Bridge User Actionsbridge_load_page22418326829239268
bridge_load_asset_picker15711918424171184
bridge_search_token7116997239720723
total110110931114911141114
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14721193199011915051685
load12201004170210712451409
domContentLoaded1212999166410412401401
domInteractive3017126212685
firstPaint1617049089212350
backgroundConnect21719627914220241
firstReactRender2213227212228
initialActions206225
loadScripts1011800145710410361195
setupStore1465771622
numNetworkReqs362793192785
Power User HomeuiStartup5850219014923245766639745
load13851147265517914021691
domContentLoaded13621136258317113751654
domInteractive38221452635107
firstPaint231901656168295351
backgroundConnect198630810165216628104925
firstReactRender30204963242
initialActions107113
loadScripts1112926150711311441393
setupStore1675682030
numNetworkReqs2098638247226297
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2182172191219219
srpButtonToSrpForm93929519395
confirmSrpToPwForm21212102121
pwFormToMetricsScreen16151811518
metricsToWalletReadyScreen15151601616
doneButtonToHomeScreen6556486679667667
openAccountMenuToAccountListLoaded27392474292421229172924
total37963499395616939393956
Onboarding New WalletcreateWalletToSocialScreen2202202211221221
srpButtonToPwForm1111091131111113
createPwToRecoveryScreen981011010
skipBackupToMetricsScreen37373803838
agreeButtonToOnboardingSuccess18181801818
doneButtonToAssetList580487761107647761
total980876118311710411183
Asset DetailsassetClickToPriceChart1159613414127134
total1159613414127134
Solana Asset DetailsassetClickToPriceChart87868918889
total87868918889
Import Srp HomeloginToHomeScreen2349233823691423692369
openAccountMenuAfterLogin64557277172
homeAfterImportWithNewWallet24882380261710626132617
total48334704505813447945058
Send TransactionsopenSendPageFromHome25183562735
selectTokenToSendFormLoaded19192002020
reviewTransactionToConfirmationPage8478458502850850
total8898858965890896
SwapopenSwapPageFromHome21202212122
fetchAndDisplaySwapQuotes268326822685126832685
total270427012706227062706
🌐 Dapp Page Load Benchmarks

Current Commit: 51ecc8a | Date: 3/11/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±47ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 735ms (±42ms) 🟢 | historical mean value: 729ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 81ms (±12ms) 🟢 | historical mean value: 84ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 47ms 1.01s 1.36s 1.08s 1.36s
domContentLoaded 735ms 42ms 707ms 1.02s 761ms 1.02s
firstPaint 81ms 12ms 64ms 188ms 88ms 188ms
firstContentfulPaint 81ms 12ms 64ms 188ms 88ms 188ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 7.6 MiB (100%)
  • ui: 8.36 MiB (100%)
  • common: 11 MiB (100%)

@gambinish gambinish marked this pull request as ready for review March 11, 2026 03:27
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 20, 2026

Builds ready [b4cda79]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account3062983116311311
total3062983116311311
Confirm Txconfirm_tx600860076010160106010
total600860076010160106010
Bridge User Actionsbridge_load_page20619022412207224
bridge_load_asset_picker23920727423251274
bridge_search_token72469574118739741
total1202110913267912481326
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup15281289197610415721718
load1262105716069913001437
domContentLoaded1255105015989712961421
domInteractive3218117222786
firstPaint1567242479216275
backgroundConnect22820528211233247
firstReactRender20144452230
initialActions2011124
loadScripts104284713829610761210
setupStore16794101727
numNetworkReqs393184154073
Power User HomeuiStartup5306240210600175062697445
load13361163174512913661660
domContentLoaded13111150171912213381566
domInteractive39201833333125
firstPaint225891537162294371
backgroundConnect15983147468157424354231
firstReactRender24165562634
initialActions106112
loadScripts1077941146111311131309
setupStore1664061830
numNetworkReqs19610532641212280
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202192211220221
srpButtonToSrpForm91899329293
confirmSrpToPwForm22212202222
pwFormToMetricsScreen15151501515
metricsToWalletReadyScreen16151711617
doneButtonToHomeScreen53751158729551587
openAccountMenuToAccountListLoaded3035292331188631023118
total39343794407210940064072
Onboarding New WalletcreateWalletToSocialScreen2212192242223224
srpButtonToPwForm1131121141114114
createPwToRecoveryScreen999099
skipBackupToMetricsScreen41404104141
agreeButtonToOnboardingSuccess16161701617
doneButtonToAssetList5034965126503512
total90989693616901936
Asset DetailsassetClickToPriceChart624981127381
total624981127381
Solana Asset DetailsassetClickToPriceChart93791231887123
total93791231887123
Import Srp HomeloginToHomeScreen2359231824013323812401
openAccountMenuAfterLogin45365165051
homeAfterImportWithNewWallet1528265236896123252368
total39882831481990647054819
Send TransactionsopenSendPageFromHome25192942829
selectTokenToSendFormLoaded30233753037
reviewTransactionToConfirmationPage13711013168426716231684
total14371079173126616931731
SwapopenSwapPageFromHome1249515521127155
fetchAndDisplaySwapQuotes2699268227111227082711
total280628032809228092809
🌐 Dapp Page Load Benchmarks

Current Commit: b4cda79 | Date: 3/20/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 961ms (±108ms) 🟢 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 681ms (±129ms) 🟢 | historical mean value: 732ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 93ms (±192ms) 🟢 | historical mean value: 86ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 961ms 108ms 926ms 2.01s 993ms 2.01s
domContentLoaded 681ms 129ms 653ms 1.94s 693ms 1.94s
firstPaint 93ms 192ms 60ms 2.00s 84ms 2.00s
firstContentfulPaint 93ms 192ms 60ms 2.00s 84ms 2.00s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 2.28 KiB (0.03%)
  • common: 23 Bytes (0%)

geositta
geositta previously approved these changes Mar 20, 2026
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 20, 2026

Builds ready [c1db839]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account391271552111478552
total391271552111478552
Confirm Txconfirm_tx6053603560882160526088
total6053603560882160526088
Bridge User Actionsbridge_load_page21117923523231235
bridge_load_asset_picker24622726114259261
bridge_search_token75372877417767774
total1211118412502712361250
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14931231179610715471689
load1237101814639612931398
domContentLoaded1230101314569412861389
domInteractive3017110202782
firstPaint1586644281215280
backgroundConnect22520326712230248
firstReactRender2112201192029
initialActions109124
loadScripts102481312409410761190
setupStore1577191829
numNetworkReqs393185163779
Power User HomeuiStartup74632088167483149797515563
load16031325378631916301993
domContentLoaded15821318376631715791961
domInteractive49233205041182
firstPaint3409716953533381522
backgroundConnect2435361135563170215611495
firstReactRender28185972939
initialActions105113
loadScripts13131062350331313131677
setupStore1784372130
numNetworkReqs2386846963258359
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2192172222221222
srpButtonToSrpForm93909529495
confirmSrpToPwForm22212202222
pwFormToMetricsScreen15151501515
metricsToWalletReadyScreen15151601616
doneButtonToHomeScreen5365305466536546
openAccountMenuToAccountListLoaded3034291631199131063119
total3917381340139240044013
Onboarding New WalletcreateWalletToSocialScreen2182172191219219
srpButtonToPwForm1101091121111112
createPwToRecoveryScreen989099
skipBackupToMetricsScreen39384014040
agreeButtonToOnboardingSuccess16161811618
doneButtonToAssetList50048251915519519
total89187291116911911
Asset DetailsassetClickToPriceChart694784147884
total694784147884
Solana Asset DetailsassetClickToPriceChart1173718655169186
total1173718655169186
Import Srp HomeloginToHomeScreen24772281279119125722791
openAccountMenuAfterLogin703596228796
homeAfterImportWithNewWallet1494266238897822902388
total40402806486386347354863
Send TransactionsopenSendPageFromHome31273743037
selectTokenToSendFormLoaded31283423334
reviewTransactionToConfirmationPage1122876138017212061380
total1189938144317512901443
SwapopenSwapPageFromHome1089111912119119
fetchAndDisplaySwapQuotes269026842698626942698
total2794277928031128032803
🌐 Dapp Page Load Benchmarks

Current Commit: c1db839 | Date: 3/20/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±45ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 734ms (±66ms) 🟢 | historical mean value: 732ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 84ms (±43ms) 🟢 | historical mean value: 86ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 45ms 1.02s 1.38s 1.08s 1.38s
domContentLoaded 734ms 66ms 709ms 1.34s 754ms 1.34s
firstPaint 84ms 43ms 64ms 508ms 88ms 508ms
firstContentfulPaint 84ms 43ms 64ms 508ms 88ms 508ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 2.28 KiB (0.03%)
  • common: 23 Bytes (0%)

aganglada
aganglada previously approved these changes Mar 21, 2026
racitores
racitores previously approved these changes Mar 21, 2026
ccharly
ccharly previously approved these changes Mar 23, 2026
Copy link
Copy Markdown
Contributor

@ccharly ccharly left a comment

Choose a reason for hiding this comment

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

LGTM for accounts files:

ui/components/multichain/account-overview/account-overview-tabs.tsx

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we revert as we removed the navigation changes?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also unnecessary as added for removed navigation changes.

}));

jest.mock('./alerts/useSpenderAlerts', () => ({
useSpenderAlerts: () => [],
Copy link
Copy Markdown
Member

@matthewwalsh0 matthewwalsh0 Mar 23, 2026

Choose a reason for hiding this comment

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

Can we revert these unit test changes also as no changes to the alerts in this PR?

navigate,
isHardwareWalletErrorModalVisible,
]);
}, [previousConfirmation, currentConfirmation, navigate]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Removed hardware wallet error modal navigation guard

High Severity

The isHardwareWalletErrorModalVisible check and shouldNavigateHomeRef deferred-navigation pattern were removed from the ConfirmContextProvider effect. Previously, when a confirmation disappeared (e.g. due to a network change), navigation home was deferred until the hardware wallet error modal was dismissed, allowing retry. Now the user is navigated away immediately, breaking retry functionality for hardware wallet users. The currentConfirmationOverride prop (used for gas modal in cancel-speedup) was also removed. A reviewer already flagged this for revert, but the changes remain in the diff.

Fix in Cursor Fix in Web

Copy link
Copy Markdown

@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.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@sonarqubecloud
Copy link
Copy Markdown

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 23, 2026

Builds ready [2eabf1c]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28927431115292311
total28927431115292311
Confirm Txconfirm_tx6043603160571160556057
total6043603160571160556057
Bridge User Actionsbridge_load_page21319823313220233
bridge_load_asset_picker26323729324291293
bridge_search_token7577547623757762
total1256121313404712671340
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14941253176810915451705
load1237104115009812811427
domContentLoaded1231103814939612691412
domInteractive3118143232690
firstPaint177711295177218356
backgroundConnect22820427714233253
firstReactRender2213191182132
initialActions108124
loadScripts101982012899510601193
setupStore1474061522
numNetworkReqs393184164076
Power User HomeuiStartup5397205914662209163808420
load13131185171510413551547
domContentLoaded12951151169910013351512
domInteractive3419180243386
firstPaint190851371150245334
backgroundConnect172030311826186524174470
firstReactRender25176872735
initialActions106112
loadScripts106592114679510951274
setupStore1574561626
numNetworkReqs2009438751225300
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2172162202218220
srpButtonToSrpForm93909839498
confirmSrpToPwForm23212512325
pwFormToMetricsScreen15141501515
metricsToWalletReadyScreen17141921919
doneButtonToHomeScreen58849769284685692
openAccountMenuToAccountListLoaded3038292131258831043125
total4000398240312240314031
Onboarding New WalletcreateWalletToSocialScreen2192192200219220
srpButtonToPwForm1121101152113115
createPwToRecoveryScreen989099
skipBackupToMetricsScreen42384524345
agreeButtonToOnboardingSuccess17171801818
doneButtonToAssetList55549469481518694
total9599091094789201094
Asset DetailsassetClickToPriceChart103971126104112
total103971126104112
Solana Asset DetailsassetClickToPriceChart1179414621137146
total1179414621137146
Import Srp HomeloginToHomeScreen2261220623184522932318
openAccountMenuAfterLogin70411092686109
homeAfterImportWithNewWallet2373231324585723902458
total4660463746751746754675
Send TransactionsopenSendPageFromHome462980216380
selectTokenToSendFormLoaded30253433034
reviewTransactionToConfirmationPage1124863158228113191582
total1203950163827013931638
SwapopenSwapPageFromHome912115357143153
fetchAndDisplaySwapQuotes268526812693526882693
total2776271328375328252837
🌐 Dapp Page Load Benchmarks

Current Commit: 2eabf1c | Date: 3/23/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±40ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 740ms (±37ms) 🟢 | historical mean value: 739ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 83ms (±13ms) 🟢 | historical mean value: 90ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 40ms 1.03s 1.35s 1.08s 1.35s
domContentLoaded 740ms 37ms 719ms 1.02s 761ms 1.02s
firstPaint 83ms 13ms 72ms 208ms 88ms 208ms
firstContentfulPaint 83ms 13ms 72ms 208ms 88ms 208ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 2.28 KiB (0.03%)
  • common: 23 Bytes (0%)

Copy link
Copy Markdown
Member

@matthewwalsh0 matthewwalsh0 left a comment

Choose a reason for hiding this comment

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

Approving on behalf of confirmations as no codeowner changes.

Copy link
Copy Markdown
Contributor

@ameliejyc ameliejyc left a comment

Choose a reason for hiding this comment

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

Approving for core extension ux files

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.25.0 Issue or pull request that will be included in release 13.25.0 size-XL skip-e2e-quality-gate team-perps Perps team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

9 participants