feat: integrate streams with perps ui#40781
Conversation
…rps-controller-infrastructure-stream
✨ Files requiring CODEOWNER review ✨🔑 @MetaMask/accounts-engineers (1 files, +4 -5)
👨🔧 @MetaMask/core-extension-ux (1 files, +4 -5)
👨🔧 @MetaMask/perps (28 files, +880 -455)
🧪 @MetaMask/qa (2 files, +6 -5)
|
Builds ready [de2391a]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [51ecc8a]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [b4cda79]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
This reverts commit e359ae5.
Builds ready [c1db839]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
ccharly
left a comment
There was a problem hiding this comment.
LGTM for accounts files:
ui/components/multichain/account-overview/account-overview-tabs.tsx
There was a problem hiding this comment.
Can we revert as we removed the navigation changes?
There was a problem hiding this comment.
Also unnecessary as added for removed navigation changes.
| })); | ||
|
|
||
| jest.mock('./alerts/useSpenderAlerts', () => ({ | ||
| useSpenderAlerts: () => [], |
There was a problem hiding this comment.
Can we revert these unit test changes also as no changes to the alerts in this PR?
| navigate, | ||
| isHardwareWalletErrorModalVisible, | ||
| ]); | ||
| }, [previousConfirmation, currentConfirmation, navigate]); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
ui/components/app/perps/order-entry/components/amount-input/amount-input.tsx
Show resolved
Hide resolved
|
Builds ready [2eabf1c]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
matthewwalsh0
left a comment
There was a problem hiding this comment.
Approving on behalf of confirmations as no codeowner changes.
ameliejyc
left a comment
There was a problem hiding this comment.
Approving for core extension ux files





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
usePerpsEligibilitysimplified to Redux-selector driven access.Improvement / solution
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
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
PerpsControllerusage to background RPC +PerpsStreamManagerchannels, including order/position actions (perpsPlaceOrder,perpsClosePosition,perpsUpdateMargin,perpsUpdatePositionTPSL) and history fetches (perpsGetOrders,perpsGetOrderFills,perpsGetFunding,perpsGetUserHistory).Introduces explicit stream lifecycle gating via
usePerpsViewActiveand new boundaries (PerpsLayoutfor routes,PerpsViewStreamBoundaryfor the account-overview tab), and adds page-level activation/deactivation for symbol-scoped price/orderbook streams.Renames/rewires the main tab surface to
PerpsView(replacingPerpsTabView), 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.