Skip to content

Commit 59895b9

Browse files
authored
feat(money): add first-visit splash for the Money account (#47626)
## **Description** First-time Money users currently land directly on Money home or a deposit confirmation, with no introduction to the account. This adds a one-time splash with the Money value proposition, benefits and FAQs, shown when they first open Money or start a deposit from an Earn CTA. The Money tab opens it over the current screen and only navigates to Money home after acknowledgement; the seen flag lives in `AppStateController` and the FAQ section reuses the existing Money component. ## **Changelog** CHANGELOG entry: Added a first-visit Money account splash that introduces earning, trading, sending, and spending. ## **Related issues** Fixes: [MUSD-1504](https://consensyssoftware.atlassian.net/browse/MUSD-1504) ## **Manual testing steps** 1. Build with Money enabled and a geo-eligible wallet, starting from a state where `moneyFtueSeen` is `false`. 2. Open the popup, side panel and full screen. Click the Money tab and verify the splash appears over the current screen with a faded background; in the side panel the card is centered and tall enough to show the first two benefits. 3. Scroll through the five benefits and the ten FAQs, then press **Start earning** and verify you land on Money home. Repeat with the X button. 4. Reopen Money, then reload and reopen it. Verify the splash does not appear either time. 5. Reset `moneyFtueSeen` to `false`, then use an Earn CTA on an eligible stablecoin row from the wallet home. Verify the splash appears and **Start earning** / X opens the Add funds confirmation with that token preselected. ## **Screenshots/Recordings** ### **Before** Not applicable — new surface. ### **After** Popup View <img width="385" height="579" alt="popup_1" src="https://github.com/user-attachments/assets/377a8784-a348-4161-9087-a2a33972d3de" /> <img width="386" height="574" alt="popup_2" src="https://github.com/user-attachments/assets/eb921b5e-2bfd-4abb-8024-e0e5356403cf" /> <img width="382" height="568" alt="popup_3" src="https://github.com/user-attachments/assets/67e62f16-ce5b-44e5-b0a5-21107baf5b48" /> Side Panel View <img width="364" height="833" alt="sidepanel_1" src="https://github.com/user-attachments/assets/e7707eea-831e-45e2-ae0e-8bf590fcbc8c" /> <img width="368" height="859" alt="sidepanel_2" src="https://github.com/user-attachments/assets/fb988cfd-72e8-444d-8733-b9b2b53c4460" /> Full-screen View <img width="832" height="857" alt="fullscreen_1" src="https://github.com/user-attachments/assets/9fe53bac-dbc3-4471-8ac7-b26fd3080fde" /> <img width="847" height="856" alt="fullscreen_2" src="https://github.com/user-attachments/assets/38734649-af0a-4e27-80f1-293b799fa81e" /> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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 - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/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. [MUSD-1504]: https://consensyssoftware.atlassian.net/browse/MUSD-1504?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes first-touch Money navigation and deposit initiation, which can block or redirect funding flows if gating regresses; new risk/disclosure copy is user-facing but not auth or custody logic. > > **Overview** > Adds a **one-time MetaMask Money splash** (benefits, APY copy, shared FAQs, **Start earning** / close) shown before users reach Money home or a deposit flow when `moneyFtueSeen` is false. > > **Persistence and UI state:** `AppStateController` gains persisted `moneyFtueSeen` plus `setMoneyFtueSeen`; a `moneyFtue` Redux slice tracks open/close, deposit vs tab source, pending deposit intent, and session `acknowledged` so the splash does not reopen mid-session. > > **Entry points:** The Money tab opens the splash instead of navigating on first click; `useMoneyAccountDeposit` intercepts deposits until acknowledgement (then continues with `skipFtue`); Money home uses `useOpenMoneyFtueOnFirstVisit`. `MoneyFtueSplash` is mounted globally when unlocked. FAQ definitions move to `MONEY_FAQ_ITEMS` (adds safety/controls FAQs) for How it works and the splash. > > **Coverage:** New unit/e2e tests, fixtures default `moneyFtueSeen: true` for existing deposit specs, and en/en_GB locale strings. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 55f24e6. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 448dd92 commit 59895b9

41 files changed

Lines changed: 1681 additions & 68 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎app/_locales/en/messages.json‎

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/_locales/en_GB/messages.json‎

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/scripts/controllers/app-state-controller-method-action-types.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,17 @@ export type AppStateControllerSetPerpsTabBadgeSeenAction = {
301301
handler: AppStateController['setPerpsTabBadgeSeen'];
302302
};
303303

304+
/**
305+
* Sets whether the Money account first-time-user-experience (FTUE) splash
306+
* has been seen.
307+
*
308+
* @param value - Whether the Money FTUE splash has been seen
309+
*/
310+
export type AppStateControllerSetMoneyFtueSeenAction = {
311+
type: `AppStateController:setMoneyFtueSeen`;
312+
handler: AppStateController['setMoneyFtueSeen'];
313+
};
314+
304315
/**
305316
* Sets whether the mUSD conversion education screen has been seen.
306317
*
@@ -636,6 +647,7 @@ export type AppStateControllerMethodActions =
636647
| AppStateControllerClearPollingTokensAction
637648
| AppStateControllerSetHasShownMultichainAccountsIntroModalAction
638649
| AppStateControllerSetPerpsTabBadgeSeenAction
650+
| AppStateControllerSetMoneyFtueSeenAction
639651
| AppStateControllerSetMusdConversionEducationSeenAction
640652
| AppStateControllerAddMusdConversionDismissedCtaKeyAction
641653
| AppStateControllerAddMoneyEarnBannerDismissedTokenKeyAction

‎app/scripts/controllers/app-state-controller.test.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,18 @@ describe('AppStateController', () => {
495495
});
496496
});
497497

498+
describe('setMoneyFtueSeen', () => {
499+
it('defaults to unseen and updates when set', async () => {
500+
await withController(({ controller }) => {
501+
expect(controller.state.moneyFtueSeen).toStrictEqual(false);
502+
503+
controller.setMoneyFtueSeen(true);
504+
505+
expect(controller.state.moneyFtueSeen).toStrictEqual(true);
506+
});
507+
});
508+
});
509+
498510
describe('setOnboardingDate', () => {
499511
it('set the onboardingDate', async () => {
500512
await withController(({ controller }) => {
@@ -870,6 +882,7 @@ describe('AppStateController', () => {
870882
"lastViewedUserSurvey": null,
871883
"lastVisitedRoute": null,
872884
"moneyEarnBannerDismissedTokenKeys": [],
885+
"moneyFtueSeen": false,
873886
"musdConversionDismissedCtaKeys": [],
874887
"musdConversionEducationSeen": false,
875888
"newPrivacyPolicyToastClickedOrClosed": null,
@@ -961,6 +974,7 @@ describe('AppStateController', () => {
961974
"lastUpdatedFromVersion": null,
962975
"lastViewedUserSurvey": null,
963976
"moneyEarnBannerDismissedTokenKeys": [],
977+
"moneyFtueSeen": false,
964978
"musdConversionDismissedCtaKeys": [],
965979
"musdConversionEducationSeen": false,
966980
"newPrivacyPolicyToastClickedOrClosed": null,
@@ -1046,6 +1060,7 @@ describe('AppStateController', () => {
10461060
"lastUpdatedFromVersion": null,
10471061
"lastViewedUserSurvey": null,
10481062
"moneyEarnBannerDismissedTokenKeys": [],
1063+
"moneyFtueSeen": false,
10491064
"musdConversionDismissedCtaKeys": [],
10501065
"musdConversionEducationSeen": false,
10511066
"newPrivacyPolicyToastClickedOrClosed": null,
@@ -1129,6 +1144,7 @@ describe('AppStateController', () => {
11291144
"lastViewedUserSurvey": null,
11301145
"lastVisitedRoute": null,
11311146
"moneyEarnBannerDismissedTokenKeys": [],
1147+
"moneyFtueSeen": false,
11321148
"musdConversionDismissedCtaKeys": [],
11331149
"musdConversionEducationSeen": false,
11341150
"newPrivacyPolicyToastClickedOrClosed": null,

‎app/scripts/controllers/app-state-controller.ts‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ export type AppStateControllerState = {
151151
musdConversionEducationSeen: boolean;
152152
musdConversionDismissedCtaKeys: string[];
153153
moneyEarnBannerDismissedTokenKeys: string[];
154+
moneyFtueSeen: boolean;
154155
showShieldEntryModalOnce: boolean | null;
155156
/**
156157
* The pending redirect route to be applied after the default page is loaded.
@@ -330,6 +331,7 @@ const getDefaultAppStateControllerState = (): AppStateControllerState => ({
330331
musdConversionEducationSeen: false,
331332
musdConversionDismissedCtaKeys: [],
332333
moneyEarnBannerDismissedTokenKeys: [],
334+
moneyFtueSeen: false,
333335
showShieldEntryModalOnce: null,
334336
pendingRedirectRoute: null,
335337
lastVisitedRoute: null,
@@ -639,6 +641,12 @@ const controllerMetadata: StateMetadata<AppStateControllerState> = {
639641
usedInUi: true,
640642
includeInStateLogs: true,
641643
},
644+
moneyFtueSeen: {
645+
persist: true,
646+
includeInDebugSnapshot: true,
647+
usedInUi: true,
648+
includeInStateLogs: true,
649+
},
642650
showShieldEntryModalOnce: {
643651
includeInStateLogs: true,
644652
persist: true,
@@ -773,6 +781,7 @@ const MESSENGER_EXPOSED_METHODS = [
773781
'setLastUpdatedFromVersion',
774782
'setLastViewedUserSurvey',
775783
'setLastVisitedRoute',
784+
'setMoneyFtueSeen',
776785
'setMusdConversionEducationSeen',
777786
'setNewPrivacyPolicyToastClickedOrClosed',
778787
'setNewPrivacyPolicyToastShownDate',
@@ -1383,6 +1392,18 @@ export class AppStateController extends BaseController<
13831392
});
13841393
}
13851394

1395+
/**
1396+
* Sets whether the Money account first-time-user-experience (FTUE) splash
1397+
* has been seen.
1398+
*
1399+
* @param value - Whether the Money FTUE splash has been seen
1400+
*/
1401+
setMoneyFtueSeen(value: boolean): void {
1402+
this.update((state) => {
1403+
state.moneyFtueSeen = value;
1404+
});
1405+
}
1406+
13861407
/**
13871408
* Sets whether the mUSD conversion education screen has been seen.
13881409
*

‎shared/types/background.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ export type ControllerStatePropertiesEnumerated = {
143143
musdConversionEducationSeen: AppStateControllerState['musdConversionEducationSeen'];
144144
musdConversionDismissedCtaKeys: AppStateControllerState['musdConversionDismissedCtaKeys'];
145145
moneyEarnBannerDismissedTokenKeys: AppStateControllerState['moneyEarnBannerDismissedTokenKeys'];
146+
moneyFtueSeen: AppStateControllerState['moneyFtueSeen'];
146147
lastInteractedConfirmationInfo?: AppStateControllerState['lastInteractedConfirmationInfo'];
147148
termsOfUseLastAgreed?: AppStateControllerState['termsOfUseLastAgreed'];
148149
snapsInstallPrivacyWarningShown?: AppStateControllerState['snapsInstallPrivacyWarningShown'];

‎test/e2e/fixtures/default-fixture.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@
209209
"lastUpdatedFromVersion": null,
210210
"lastViewedUserSurvey": null,
211211
"moneyEarnBannerDismissedTokenKeys": [],
212+
"moneyFtueSeen": false,
212213
"musdConversionDismissedCtaKeys": [],
213214
"musdConversionEducationSeen": false,
214215
"newPrivacyPolicyToastClickedOrClosed": true,

‎test/e2e/fixtures/onboarding-fixture.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"lastUpdatedFromVersion": null,
7878
"lastViewedUserSurvey": null,
7979
"moneyEarnBannerDismissedTokenKeys": [],
80+
"moneyFtueSeen": false,
8081
"musdConversionDismissedCtaKeys": [],
8182
"musdConversionEducationSeen": false,
8283
"newPrivacyPolicyToastClickedOrClosed": null,

‎test/e2e/page-objects/flows/money-account-deposit.flow.ts‎

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,47 @@ import type { Anvil } from '../../seeder/anvil';
33
import { Driver } from '../../webdriver/driver';
44
import { MoneyAccountDepositConfirmation } from '../pages/confirmations/money-account-deposit-confirmation';
55
import BottomNavBar from '../pages/home/bottom-nav-bar-page';
6+
import MoneyFtueSplashPage from '../pages/money/money-ftue-splash-page';
67
import MoneyHomePage from '../pages/money/money-home-page';
78
import MoneyTransactionDetailsPage from '../pages/money/money-transaction-details-page';
89
import { login } from './login.flow';
910

11+
/**
12+
* Open the Money home page via the bottom nav Money tab. Assumes the wallet
13+
* is already unlocked.
14+
*
15+
* @param driver - The WebDriver instance.
16+
* @returns The loaded `MoneyHomePage`.
17+
*/
18+
export async function openMoneyHome(driver: Driver): Promise<MoneyHomePage> {
19+
const bottomNavBar = new BottomNavBar(driver);
20+
await bottomNavBar.checkPageIsLoaded();
21+
await bottomNavBar.clickMoney();
22+
23+
const moneyHomePage = new MoneyHomePage(driver);
24+
await moneyHomePage.checkPageIsLoaded();
25+
return moneyHomePage;
26+
}
27+
28+
/**
29+
* Open the Money FTUE splash via the bottom nav Money tab. Assumes the wallet
30+
* is already unlocked.
31+
*
32+
* @param driver - The WebDriver instance.
33+
* @returns The loaded `MoneyFtueSplashPage`.
34+
*/
35+
export async function openMoneyFtueSplash(
36+
driver: Driver,
37+
): Promise<MoneyFtueSplashPage> {
38+
const bottomNavBar = new BottomNavBar(driver);
39+
await bottomNavBar.checkPageIsLoaded();
40+
await bottomNavBar.clickMoney({ assertRoute: false });
41+
42+
const splash = new MoneyFtueSplashPage(driver);
43+
await splash.checkPageIsLoaded();
44+
return splash;
45+
}
46+
1047
/**
1148
* Unlock the wallet and open the Money home page via the bottom nav Money
1249
* tab (bottom nav AB test treatment).
@@ -21,13 +58,7 @@ export async function loginAndOpenMoneyHome(
2158
): Promise<MoneyHomePage> {
2259
await login(driver, { localNode, validateBalance: false });
2360

24-
const bottomNavBar = new BottomNavBar(driver);
25-
await bottomNavBar.checkPageIsLoaded();
26-
await bottomNavBar.clickMoney();
27-
28-
const moneyHomePage = new MoneyHomePage(driver);
29-
await moneyHomePage.checkPageIsLoaded();
30-
return moneyHomePage;
61+
return openMoneyHome(driver);
3162
}
3263

3364
/**

‎test/e2e/page-objects/pages/home/bottom-nav-bar-page.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,19 @@ class BottomNavBar {
4848
/**
4949
* Click the Money tab. Only rendered once the Money Account availability
5050
* query resolves, so wait for it rather than failing on first paint.
51+
*
52+
* @param options - Click options.
53+
* @param [options.assertRoute] - Whether to assert the Money home route. Set
54+
* to `false` when the first-visit FTUE splash is expected instead.
5155
*/
52-
async clickMoney(): Promise<void> {
56+
async clickMoney({
57+
assertRoute = true,
58+
}: { assertRoute?: boolean } = {}): Promise<void> {
5359
console.log('Click bottom nav money tab');
5460
await this.driver.clickElement(this.moneyTab);
55-
await this.assertOnRoute('/money-home');
61+
if (assertRoute) {
62+
await this.assertOnRoute('/money-home');
63+
}
5664
}
5765
}
5866

0 commit comments

Comments
 (0)