Skip to content

Commit 1572dc5

Browse files
chore(runway): cherry-pick fix: default explore feature to enabled cp-7.64.0 (#25654)
- fix: default explore feature to enabled cp-7.64.0 (#25608) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** This unblocks this issue #25474 The underlying issue is that the remote feature flag controller does not reset cache on version upgrades, so users will need to close their app and wait for the feature flag cache to expire before they can see the new feature. However the remote feature flag controller change would be pretty large, so to keep the scope small (and because the explore feature is released) we will be hardcoding the feature flag to true. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: fix: default explore feature to enabled ## **Related issues** Fixes: #25474 ## **Manual testing steps** ```gherkin 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** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** https://www.loom.com/share/a9112c646381436898a7bcd63c7ab028 ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. --- <a href="https://cursor.com/background-agent?bcId=bc-6a60576f-64a8-447f-843a-6d9be5062f1d"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?id=bc-6a60576f-64a8-447f-843a-6d9be5062f1d"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Forces a previously remote-controlled feature flag on for most builds, reducing the ability to disable the feature via remote config and potentially changing user-visible navigation behavior. Risk is limited to feature gating/UI flow, not security-critical logic. > > **Overview** > **Defaults the Explore/assets trending tokens feature on in production builds.** `selectAssetsTrendingTokensEnabled` now injects a `forcedTrueOverride` (based on `isE2E`) so the flag evaluates to enabled by default unless running E2E. > > Tests were adjusted to mock `isE2E` and preserve existing selector expectations, and the `MainNavigator` snapshots were updated to include the additional Explore-related screens (`ExploreSearch`, `SitesFullView`, `BrowserTabHome`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 51cd2d5. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [8286a85](8286a85) Co-authored-by: Prithpal Sooriya <prithpal.sooriya@consensys.net>
1 parent bd02a1b commit 1572dc5

3 files changed

Lines changed: 108 additions & 1 deletion

File tree

app/components/Nav/Main/__snapshots__/MainNavigator.test.tsx.snap

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,39 @@ exports[`MainNavigator Tab Bar Visibility hides tab bar when browser is active 1
253253
}
254254
}
255255
/>
256+
<Screen
257+
component={[Function]}
258+
name="ExploreSearch"
259+
options={
260+
{
261+
"animationEnabled": true,
262+
"cardStyleInterpolator": [Function],
263+
"headerShown": false,
264+
}
265+
}
266+
/>
267+
<Screen
268+
component={[Function]}
269+
name="SitesFullView"
270+
options={
271+
{
272+
"animationEnabled": true,
273+
"cardStyleInterpolator": [Function],
274+
"headerShown": false,
275+
}
276+
}
277+
/>
278+
<Screen
279+
component={[Function]}
280+
name="BrowserTabHome"
281+
options={
282+
{
283+
"animationEnabled": true,
284+
"cardStyleInterpolator": [Function],
285+
"headerShown": false,
286+
}
287+
}
288+
/>
256289
<Screen
257290
component={[Function]}
258291
headerStyle={
@@ -571,6 +604,39 @@ exports[`MainNavigator Tab Bar Visibility shows tab bar when not in browser 1`]
571604
}
572605
}
573606
/>
607+
<Screen
608+
component={[Function]}
609+
name="ExploreSearch"
610+
options={
611+
{
612+
"animationEnabled": true,
613+
"cardStyleInterpolator": [Function],
614+
"headerShown": false,
615+
}
616+
}
617+
/>
618+
<Screen
619+
component={[Function]}
620+
name="SitesFullView"
621+
options={
622+
{
623+
"animationEnabled": true,
624+
"cardStyleInterpolator": [Function],
625+
"headerShown": false,
626+
}
627+
}
628+
/>
629+
<Screen
630+
component={[Function]}
631+
name="BrowserTabHome"
632+
options={
633+
{
634+
"animationEnabled": true,
635+
"cardStyleInterpolator": [Function],
636+
"headerShown": false,
637+
}
638+
}
639+
/>
574640
<Screen
575641
component={[Function]}
576642
headerStyle={
@@ -889,6 +955,39 @@ exports[`MainNavigator matches rendered snapshot 1`] = `
889955
}
890956
}
891957
/>
958+
<Screen
959+
component={[Function]}
960+
name="ExploreSearch"
961+
options={
962+
{
963+
"animationEnabled": true,
964+
"cardStyleInterpolator": [Function],
965+
"headerShown": false,
966+
}
967+
}
968+
/>
969+
<Screen
970+
component={[Function]}
971+
name="SitesFullView"
972+
options={
973+
{
974+
"animationEnabled": true,
975+
"cardStyleInterpolator": [Function],
976+
"headerShown": false,
977+
}
978+
}
979+
/>
980+
<Screen
981+
component={[Function]}
982+
name="BrowserTabHome"
983+
options={
984+
{
985+
"animationEnabled": true,
986+
"cardStyleInterpolator": [Function],
987+
"headerShown": false,
988+
}
989+
}
990+
/>
892991
<Screen
893992
component={[Function]}
894993
headerStyle={

app/selectors/featureFlagController/assetsTrendingTokens/index.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jest.mock('../../../core/Engine', () => ({
1212
init: () => mockedEngine.init(),
1313
}));
1414

15+
jest.mock('../../../util/test/utils', () => ({
16+
isE2E: true,
17+
}));
18+
1519
beforeEach(() => {
1620
jest.clearAllMocks();
1721
});

app/selectors/featureFlagController/assetsTrendingTokens/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createSelector } from 'reselect';
22
import { selectRemoteFeatureFlags } from '..';
33
import compareVersions from 'compare-versions';
44
import packageJson from '../../../../package.json';
5+
import { isE2E } from '../../../util/test/utils';
56

67
const APP_VERSION = packageJson.version;
78

@@ -81,6 +82,9 @@ export const isAssetsTrendingTokensFeatureEnabled = (
8182
return evaluateAssetsTrendingTokensRemoteFlag(flagValue);
8283
};
8384

85+
// We are enabling this feature flag to be enabled by default for non-E2E builds
86+
const forcedTrueOverride = () => (!isE2E ? 'true' : undefined);
87+
8488
/**
8589
* Selector to check if the assets trending tokens feature flag is enabled.
8690
* Supports environment variable override (OVERRIDE_REMOTE_FEATURE_FLAGS + ASSETS_TRENDING_TOKENS_ENABLED).
@@ -103,7 +107,7 @@ export const selectAssetsTrendingTokensEnabled = createSelector(
103107

104108
return isAssetsTrendingTokensFeatureEnabled(
105109
value,
106-
envOverride || undefined,
110+
forcedTrueOverride() || envOverride || undefined,
107111
);
108112
},
109113
);

0 commit comments

Comments
 (0)