feat(predict): new feature flag with minimumVersion #22504
Merged
+360
−54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Description
This PR migrates the Predict feature flag from a simple boolean flag to a version-gated feature flag structure, aligning it with the pattern used by Perps and other features.
What is the reason for the change?
The Predict feature needs version gating to ensure users have the minimum required app version (7.60.0) before accessing the feature. The previous implementation used a simple boolean flag (
predictEnabled) which didn't support version checking.What is the improvement/solution?
predictEnabledtopredictTradingEnabledto follow naming conventionsenabledandminimumVersionpropertiesMM_PREDICT_ENABLED) for local developmentChangelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Not applicable - This is an internal refactoring with no UI changes.
Pre-merge author checklist
Pre-merge reviewer checklist
Technical Details
Files Modified (7 total)
app/components/UI/Predict/selectors/featureFlags/index.tsVersionGatedFeatureFlagstructurepredictEnabled→predictTradingEnabledMM_PREDICT_ENABLEDapp/components/UI/Predict/selectors/featureFlags/index.test.tsapp/components/UI/Predict/mocks/remoteFeatureFlagMocks.tsapp/components/Views/Wallet/index.test.tsxpredictEnabled→predictTradingEnabled.js.env.exampleMM_PREDICT_ENABLEDenvironment variable examplee2e/api-mocking/helpers/remoteFeatureFlagsHelper.tse2e/api-mocking/mock-responses/feature-flags-mocks.tsremoteFeatureFlagPredictEnabledfunctionKey Implementation Details
{ enabled: boolean, minimumVersion: string }predictTradingEnabled7.60.0MM_PREDICT_ENABLEDenvironment variable (defaults tofalse)validatedVersionGatedFeatureFlag()utility for type checking and version validationTest Coverage
Breaking Changes
None - The selector maintains the same boolean return type, ensuring backward compatibility with existing code.
Note
Migrates Predict flag to version-gated
predictTradingEnabled(with minimumVersion andMM_PREDICT_ENABLEDfallback) and updates selectors, tests, and mocks accordingly.predictEnabled→predictTradingEnabled.{ enabled, minimumVersion }(min app7.60.0).MM_PREDICT_ENABLED.selectors/featureFlags.Wallettests to usepredictTradingEnabledobjects.MM_PREDICT_ENABLEDto.js.env.example.Written by Cursor Bugbot for commit 8997c9e. This will update automatically on new commits. Configure here.