Skip to content

Commit 462fce8

Browse files
feat: introduce Accounts Menu screen (#25611)
## **Description** Implements a new Accounts Menu screen as an intermediary page between the hamburger menu and settings, improving navigation organization for users. This is the first iteration and will eventually look like this <img width="2000" alt="image" src="https://github.com/user-attachments/assets/cd8add7a-4b45-44c6-8b69-661116803646" /> **What is the reason for the change?** The settings section is difficult to navigate. This new page organizes settings into logical sections (Settings, Manage, Resources) to improve UX while we plan a full redesign. **What is the improvement/solution?** Created a new AccountsMenu screen with: - Settings navigation - Resources section (About MetaMask, Request Feature, Support) - Log out functionality - Analytics tracking for all interactions - Performance optimizations (memoized components, Tailwind styling) - Comprehensive test coverage (24 tests) **NOTE:** There will be a follow up PR to address regression related E2E tests. I am working on them at this moment ## **Changelog** CHANGELOG entry: Added new Accounts Menu screen to organize settings navigation with Settings, Manage, and Resources sections ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-397 ## **Manual testing steps** ```gherkin Feature: Accounts Menu Navigation Scenario: user navigates from hamburger menu to settings Given user is on the main app screen When user taps the hamburger menu And user sees the new Accounts Menu screen Then user should see Settings, Manage, Resources sections Scenario: user accesses settings from Accounts Menu Given user is on the Accounts Menu screen When user taps "Settings" Then user should navigate to the Settings screen And analytics should track SETTINGS_VIEWED event Scenario: user logs out with confirmation Given user is on the Accounts Menu screen When user taps "Log Out" Then user should see a confirmation alert When user confirms logout Then app should lock And analytics should track NAVIGATION_TAPS_LOGOUT event Scenario: user cancels logout Given user is on the Accounts Menu screen When user taps "Log Out" And user taps "Cancel" on confirmation alert Then alert should dismiss And analytics should NOT track logout event ``` ## **Screenshots/Recordings** ### First Iteration <img width="350" alt="image" src="https://github.com/user-attachments/assets/1e67ed03-543e-4da6-a4ca-cea476152b59" /> ### Light https://github.com/user-attachments/assets/f79fbc12-4ce2-42db-978f-259bd6cb73c2 ### Dark https://github.com/user-attachments/assets/384a46ab-5436-4e3c-9482-82271a7efcd4 ### **Before** `~` ### **After** `~` ## **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** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes the app’s primary navigation path into settings and relocates logout/support links, which could cause regressions in deep links/back navigation and E2E flows despite added unit/snapshot coverage. > > **Overview** > Introduces a new `AccountsMenu` screen that sits between the hamburger/menu entry and the existing settings pages, providing *Manage* and *Resources* sections (Settings, Contacts, optional MetaMask Card, optional Permissions, About, Request Feature, Support, and Log out) with associated analytics events and a logout confirmation flow. > > Updates navigation so the Settings tab and `SettingsFlow` now land on `Routes.ACCOUNTS_MENU_VIEW` first, adds the new route constants, and removes the SDK connections section from `SecuritySettings` plus several resource/contact/logout rows from the `Settings` screen; tests, snapshots, and Detox page objects/smoke tests are updated accordingly. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit cc6905d. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Amanda Yeoh <147617420+amandaye0h@users.noreply.github.com>
1 parent b0df5f4 commit 462fce8

23 files changed

Lines changed: 3485 additions & 629 deletions

File tree

app/component-library/components/Navigation/TabBar/TabBar.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ describe('TabBar', () => {
160160

161161
fireEvent.press(getByTestId(`tab-bar-item-${TabBarIconKey.Setting}`));
162162
expect(navigation.navigate).toHaveBeenCalledWith(Routes.SETTINGS_VIEW, {
163-
screen: 'Settings',
163+
screen: Routes.ACCOUNTS_MENU_VIEW,
164164
});
165165
});
166166

app/component-library/components/Navigation/TabBar/TabBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const TabBar = ({ state, descriptors, navigation }: TabBarProps) => {
9898
break;
9999
case Routes.SETTINGS_VIEW:
100100
navigation.navigate(Routes.SETTINGS_VIEW, {
101-
screen: 'Settings',
101+
screen: Routes.ACCOUNTS_MENU_VIEW,
102102
});
103103
break;
104104
case Routes.TRENDING_VIEW:

app/components/Nav/Main/MainNavigator.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Browser from '../../Views/Browser';
77
import { ChainId } from '@metamask/controller-utils';
88
import AddBookmark from '../../Views/AddBookmark';
99
import SimpleWebview from '../../Views/SimpleWebview';
10+
import AccountsMenu from '../../Views/AccountsMenu';
1011
import Settings from '../../Views/Settings';
1112
import GeneralSettings from '../../Views/Settings/GeneralSettings';
1213
import AdvancedSettings from '../../Views/Settings/AdvancedSettings';
@@ -354,7 +355,12 @@ const NotificationsOptInStack = () => (
354355
);
355356

356357
const SettingsFlow = () => (
357-
<Stack.Navigator initialRouteName={'Settings'}>
358+
<Stack.Navigator initialRouteName={Routes.ACCOUNTS_MENU_VIEW}>
359+
<Stack.Screen
360+
name={Routes.ACCOUNTS_MENU_VIEW}
361+
component={AccountsMenu}
362+
options={{ headerShown: false }}
363+
/>
358364
<Stack.Screen
359365
name="Settings"
360366
component={Settings}

0 commit comments

Comments
 (0)