Skip to content

Conversation

@caieu
Copy link
Contributor

@caieu caieu commented Nov 13, 2025

Description

  • enable predict for non-evm networks

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

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

Removes EVM-only gating for Predict, updates activity tab indexing, and adjusts tests and UI to show Predict across networks.

  • Predict enablement
    • Removes EVM-only gating: isPredictEnabled now mirrors selectPredictEnabledFlag in app/components/Nav/Main/MainNavigator.js and app/components/Views/ActivityView/index.js.
    • Shows Predict action regardless of network in app/components/Views/TradeWalletActions/TradeWalletActions.tsx.
  • Activity tabs
    • Adjusts Predict tab index to account for optional Perps tab: predictTabIndex = isPerpsEnabled ? 3 : 2 in app/components/Views/ActivityView/index.js.
  • Tests
    • Updates test to expect Predict button on non-EVM networks in app/components/Views/TradeWalletActions/TradeWalletActions.test.tsx.

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

@github-actions
Copy link
Contributor

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.

@metamaskbot metamaskbot added the team-predict Predict team label Nov 13, 2025
@caieu caieu force-pushed the chore/predict-enable-non-evm branch from 7da8ca1 to 6b3c299 Compare November 13, 2025 17:31
@github-actions github-actions bot added size-S and removed size-XS labels Nov 13, 2025
@caieu caieu marked this pull request as ready for review November 13, 2025 17:57
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.

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

const perpsTabIndex = 2;
const predictTabIndex = 3;
const isPerpsTabActive = isPerpsEnabled && activeTabIndex === perpsTabIndex;
const isPredictTabActive =
isPredictEnabled && activeTabIndex === predictTabIndex;

Fix in Cursor Fix in Web


@caieu caieu added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Nov 13, 2025
@github-actions
Copy link
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeCore, SmokeConfirmationsRedesigned, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeTrade, SmokeWalletPlatform, SmokeWalletUX, SmokeAssets, SmokeSwaps, SmokeStake, SmokeCard, SmokeNotifications, SmokeRewards, SmokePerps, SmokeRamps, SmokeMultiChainPermissions, SmokeAnalytics, SmokeMultiChainAPI, SmokePredictions
  • Risk Level: high
  • AI Confidence: %
click to see 🤖 AI reasoning details

Fallback: AI analysis did not complete successfully. Running all tests.

View GitHub Actions results

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@matallui matallui added this pull request to the merge queue Nov 13, 2025
Merged via the queue into main with commit 26b7dd2 Nov 13, 2025
87 of 88 checks passed
@matallui matallui deleted the chore/predict-enable-non-evm branch November 13, 2025 20:30
@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2025
@metamaskbot metamaskbot added the release-7.60.0 Issue or pull request that will be included in release 7.60.0 label Nov 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.60.0 Issue or pull request that will be included in release 7.60.0 size-S skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants