-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: enable predict for non-evm networks #22657
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
Conversation
|
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. |
7da8ca1 to
6b3c299
Compare
app/components/Views/TradeWalletActions/TradeWalletActions.test.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Hardcoded Index Breaks Predict Tab Functionality
The predictTabIndex is hardcoded to 3, assuming Perps tab is always present. However, Perps is conditionally rendered based on isPerpsEnabled && isEvmSelected. On non-EVM networks where Predict is enabled but Perps is disabled, the Predict tab will actually be at index 2, causing isPredictTabActive to always be false and breaking Predict tab functionality.
app/components/Views/ActivityView/index.js#L256-L260
metamask-mobile/app/components/Views/ActivityView/index.js
Lines 256 to 260 in 160aa26
| const perpsTabIndex = 2; | |
| const predictTabIndex = 3; | |
| const isPerpsTabActive = isPerpsEnabled && activeTabIndex === perpsTabIndex; | |
| const isPredictTabActive = | |
| isPredictEnabled && activeTabIndex === predictTabIndex; |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsFallback: AI analysis did not complete successfully. Running all tests. |
|




Description
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Removes EVM-only gating for Predict, updates activity tab indexing, and adjusts tests and UI to show Predict across networks.
isPredictEnablednow mirrorsselectPredictEnabledFlaginapp/components/Nav/Main/MainNavigator.jsandapp/components/Views/ActivityView/index.js.app/components/Views/TradeWalletActions/TradeWalletActions.tsx.predictTabIndex = isPerpsEnabled ? 3 : 2inapp/components/Views/ActivityView/index.js.app/components/Views/TradeWalletActions/TradeWalletActions.test.tsx.Written by Cursor Bugbot for commit bcbbe91. This will update automatically on new commits. Configure here.