Skip to content

Commit 678abd6

Browse files
fix(accounts-menu): remove network management feature flag gate (#27591)
## **Description** Removed the `mobileUxNetworkManagement` feature flag gate from mobile Accounts Menu so Networks is always shown. ### What changed - Deleted obsolete selector/hook files: - `app/selectors/featureFlagController/networkManagement/index.ts` - `app/selectors/featureFlagController/networkManagement/useNetworkManagementEnabled.ts` - Updated `AccountsMenu` to always render the Networks row (no remote-flag check). - Added unit tests for Networks row rendering and navigation. - Updated the AccountsMenu snapshot to reflect the always-visible Networks row. ## **Changelog** CHANGELOG entry: Removed a stale feature-flag gate so the Networks menu item is always available. ## **Related issues** Refs: TMCU-575 ## **Manual testing steps** ```gherkin Feature: Accounts menu network access Scenario: User opens network management from Accounts menu Given the user is on the wallet screen When the user opens the accounts menu Then the "accounts_menu.networks" row is visible When the user taps the Networks row Then the app navigates to Routes.SETTINGS.NETWORKS_MANAGEMENT ``` ## **Screenshots/Recordings** ### **Before** N/A ### **After** N/A ## **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. <div><a href="https://cursor.com/agents/bc-1420aca5-4f96-443f-a08c-03463cc0a7e3"><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>&nbsp;<a href="https://cursor.com/automations/a6f92749-bc3a-4b8d-8e9b-2ad3a127fa9f"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/view-automation-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/view-automation-light.png"><img alt="View Automation" width="141" height="28" src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a>&nbsp;</div> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Behavior change makes the Networks entry point visible to all users, so any incomplete/unsupported network management flows will now be reachable broadly. Changes are localized to UI/menu rendering plus selector deletions and test updates. > > **Overview** > **Accounts Menu now always shows the Networks row** by removing the `mobileUxNetworkManagement` remote feature-flag check, so tapping it consistently navigates to `Routes.SETTINGS.NETWORKS_MANAGEMENT`. > > This PR also removes the now-unused network-management feature-flag selector/hook and updates coverage (new Networks row tests + snapshot updates) to reflect the always-visible menu item. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit b81e3fe. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Patryk Łucka <PatrykLucka@users.noreply.github.com>
1 parent 2ba87de commit 678abd6

5 files changed

Lines changed: 172 additions & 50 deletions

File tree

app/components/Views/AccountsMenu/AccountsMenu.test.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,26 @@ describe('AccountsMenu', () => {
637637
});
638638
});
639639

640+
describe('Networks Row', () => {
641+
it('render Networks row', () => {
642+
const { getByText, getByTestId } = render(<AccountsMenu />);
643+
644+
expect(getByText('accounts_menu.networks')).toBeOnTheScreen();
645+
expect(getByTestId(AccountsMenuSelectorsIDs.NETWORKS)).toBeOnTheScreen();
646+
});
647+
648+
it('navigate to NetworksManagement when Networks is pressed', () => {
649+
const { getByTestId } = render(<AccountsMenu />);
650+
const networksButton = getByTestId(AccountsMenuSelectorsIDs.NETWORKS);
651+
652+
fireEvent.press(networksButton);
653+
654+
expect(mockNavigate).toHaveBeenCalledWith(
655+
Routes.SETTINGS.NETWORKS_MANAGEMENT,
656+
);
657+
});
658+
});
659+
640660
describe('RESOURCES Section', () => {
641661
describe('About MetaMask Row', () => {
642662
it('render About MetaMask row', () => {

app/components/Views/AccountsMenu/AccountsMenu.tsx

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import {
4242
selectIsMetamaskNotificationsEnabled,
4343
} from '../../../selectors/notifications';
4444
import { selectIsBackupAndSyncEnabled } from '../../../selectors/identity';
45-
import { useNetworkManagementEnabled } from '../../../selectors/featureFlagController/networkManagement/useNetworkManagementEnabled';
4645

4746
const AccountsMenu = () => {
4847
const tw = useTailwind();
@@ -121,8 +120,6 @@ const AccountsMenu = () => {
121120
readNotificationCount,
122121
isBackupAndSyncEnabled,
123122
]);
124-
const isNetworkManagementEnabled = useNetworkManagementEnabled();
125-
126123
const handleBack = useCallback(() => {
127124
navigation.goBack();
128125
}, [navigation]);
@@ -458,17 +455,13 @@ const AccountsMenu = () => {
458455
)}
459456

460457
{/* Networks Row */}
461-
{isNetworkManagementEnabled && (
462-
<ActionListItem
463-
startAccessory={
464-
<Icon name={IconName.Hierarchy} size={IconSize.Lg} />
465-
}
466-
label={strings('accounts_menu.networks')}
467-
endAccessory={arrowRightIcon}
468-
onPress={onPressNetworks}
469-
testID={AccountsMenuSelectorsIDs.NETWORKS}
470-
/>
471-
)}
458+
<ActionListItem
459+
startAccessory={<Icon name={IconName.Hierarchy} size={IconSize.Lg} />}
460+
label={strings('accounts_menu.networks')}
461+
endAccessory={arrowRightIcon}
462+
onPress={onPressNetworks}
463+
testID={AccountsMenuSelectorsIDs.NETWORKS}
464+
/>
472465

473466
{separator}
474467

app/components/Views/AccountsMenu/__snapshots__/AccountsMenu.test.tsx.snap

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,151 @@ exports[`AccountsMenu Snapshots match snapshot when MetaMask Card is hidden 1`]
770770
</View>
771771
</View>
772772
</View>
773+
<View
774+
accessibilityState={
775+
{
776+
"busy": undefined,
777+
"checked": undefined,
778+
"disabled": false,
779+
"expanded": undefined,
780+
"selected": undefined,
781+
}
782+
}
783+
accessibilityValue={
784+
{
785+
"max": undefined,
786+
"min": undefined,
787+
"now": undefined,
788+
"text": undefined,
789+
}
790+
}
791+
accessible={true}
792+
collapsable={false}
793+
focusable={true}
794+
onBlur={[Function]}
795+
onClick={[Function]}
796+
onFocus={[Function]}
797+
onResponderGrant={[Function]}
798+
onResponderMove={[Function]}
799+
onResponderRelease={[Function]}
800+
onResponderTerminate={[Function]}
801+
onResponderTerminationRequest={[Function]}
802+
onStartShouldSetResponder={[Function]}
803+
style={
804+
{
805+
"backgroundColor": "#ffffff",
806+
"paddingBottom": 12,
807+
"paddingLeft": 16,
808+
"paddingRight": 16,
809+
"paddingTop": 12,
810+
}
811+
}
812+
testID="networks-menu-item"
813+
>
814+
<View
815+
style={
816+
[
817+
{
818+
"alignItems": "center",
819+
"display": "flex",
820+
"flexDirection": "row",
821+
"gap": 16,
822+
"justifyContent": "space-between",
823+
},
824+
undefined,
825+
]
826+
}
827+
>
828+
<View
829+
style={
830+
[
831+
{
832+
"alignItems": "flex-start",
833+
"display": "flex",
834+
"flexBasis": "0%",
835+
"flexDirection": "row",
836+
"flexGrow": 1,
837+
"flexShrink": 1,
838+
"gap": 16,
839+
},
840+
undefined,
841+
]
842+
}
843+
>
844+
<SvgMock
845+
fill="currentColor"
846+
name="Hierarchy"
847+
style={
848+
[
849+
{
850+
"color": "#131416",
851+
"height": 24,
852+
"width": 24,
853+
},
854+
undefined,
855+
]
856+
}
857+
/>
858+
<View
859+
style={
860+
[
861+
{
862+
"display": "flex",
863+
"flexBasis": "0%",
864+
"flexGrow": 1,
865+
"flexShrink": 1,
866+
},
867+
undefined,
868+
]
869+
}
870+
>
871+
<Text
872+
accessibilityRole="text"
873+
style={
874+
[
875+
{
876+
"color": "#131416",
877+
"fontFamily": "Geist-Medium",
878+
"fontSize": 16,
879+
"fontWeight": 400,
880+
"letterSpacing": 0,
881+
"lineHeight": 24,
882+
},
883+
undefined,
884+
]
885+
}
886+
>
887+
accounts_menu.networks
888+
</Text>
889+
</View>
890+
</View>
891+
<View
892+
style={
893+
[
894+
{
895+
"display": "flex",
896+
},
897+
undefined,
898+
]
899+
}
900+
>
901+
<SvgMock
902+
fill="currentColor"
903+
name="ArrowRight"
904+
style={
905+
[
906+
{
907+
"color": "#66676a",
908+
"height": 16,
909+
"width": 16,
910+
},
911+
undefined,
912+
]
913+
}
914+
/>
915+
</View>
916+
</View>
917+
</View>
773918
<View
774919
style={
775920
[

app/selectors/featureFlagController/networkManagement/index.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

app/selectors/featureFlagController/networkManagement/useNetworkManagementEnabled.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)