feat: hoist perps providers for homepage hub tabs UI cp-7.77.0 #29757
Conversation
- Add HomepageDiscoveryTabs component with Portfolio, Perpetuals, and Predictions tabs - Wire A/B test gate in Wallet — treatment renders discovery tabs, control renders existing homepage - Lazy-mount Perps and Predictions inline as tab content with hideHeader prop to suppress duplicate headers - Extend TabsList/TabsBar/Tab to support per-tab icons using local icon system - Register portfolio and predict custom SVG icons - Add per-tab gradient overlay that bleeds into wallet header with color per tab - Fix Perps safe area top inset when rendered as embedded tab
…tmcu-591-homepage-hub-tabs-ui
…tmcu-591-homepage-hub-tabs-ui
…tmcu-591-homepage-hub-tabs-ui
…underline, re-enable A/B variant gating, and add test coverage for keepMounted and new PerpsHomeView props
…tmcu-591-homepage-hub-tabs-ui
Co-authored-by: Cursor <cursoragent@cursor.com>
…ndexRef update order and prevent control variant layout regression from shared portfolioHeader margin
Adds Tab, TabsBar, and TabsList to components-temp with animated underline, scrollable overflow detection, icon support, and height collapse animation. Adds Candlestick, Portfolio, and Predict icons.
Introduces TabsIconTab, TabsIconBar, and TabsIconList as a new icon-only tab variant alongside the existing Tabs family. Reverts all modifications to the base Tabs components to avoid downstream regressions.
…nges to Tab family
… fix style override and sparse array reset
…mcu-591-homepage-hub-tabs-ui
…tmcu-591-homepage-hub-tabs-ui
|
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. |
…tmcu-591-homepage-hub-tabs-ui-perps-providers-hoist
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 70aa9ef. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag Selection:
The unit tests cover the new behavior well, but E2E tests are needed to validate the actual WebSocket stream behavior, provider hoisting, and tab-switching interactions in a real device environment. Performance Test Selection: |
|




Description
Optimizes the hub page discovery tabs for Perps WebSocket efficiency and eliminates a double provider instance introduced by the tabs feature.
Provider hoisting:
PerpsConnectionProviderandPerpsStreamProviderwere instantiated twice under the hub tabs flag, once inside the Perps tab and again inside Homepage (for PerpsSection on the Portfolio tab). Both consumed the same singleton stream manager but mounted separate React provider trees. Providers are now hoisted to theHomepageDiscoveryTabsroot so both tabs share one instance under the Tabs UI feature flag.Homepageaccepts aperpsProvidersHoistedprop to skip its own providers when a parent already provides them.WS pause/resume: Added
pauseAllChannels()andresumeAllChannels()toPerpsStreamManager. When the user navigates to the Predictions tab , the only tab with no Perps consumers. All stream channels are paused, stopping subscriber notifications while keeping the WebSocket subscribed and the cache warm. Channels resume immediately on return to Portfolio or Perpetuals. A cleanup useEffect ensures channels are never left paused if the component unmounts mid-transition.Extensibility: Tab indices that require live Perps data are declared in a
PERPS_WS_TABSSet, making future tab additions a one-line change.Changelog
CHANGELOG entry:null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-737
Manual testing steps
Screenshots/Recordings
~Before
~After
~Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Medium risk because it changes Perps WebSocket stream emission behavior (new pause reference counting + global pause/resume) and restructures provider mounting in
HomepageDiscoveryTabs, which could affect live Perps data updates and tab navigation edge cases.Overview
Hoists
PerpsConnectionProvider+PerpsStreamProvidertoHomepageDiscoveryTabsso the Portfolio and Perpetuals tabs share a single Perps provider tree, and adds aperpsProvidersHoistedprop toHomepageto skip creating nested Perps providers.Updates Perps streaming to support reference-counted pausing (
pauseCount) and addspauseAllChannels()/resumeAllChannels();HomepageDiscoveryTabsnow pauses all Perps stream channels when switching to tabs that don’t consume Perps WS data (e.g. Predictions) and resumes on return, with unmount cleanup guarded to avoid unmatched resumes.Adds/extends unit tests covering pause reference counting, pause-all/resume-all behavior, and homepage/perps feature-flag rendering when providers are hoisted.
Reviewed by Cursor Bugbot for commit 084ec3d. Bugbot is set up for automated code reviews on this repo. Configure here.