Commit ead303c
authored
feat: added pna-25 banner (#38112)
This PR is to add the updated privacy notice banner on homepage
# Feature Flow Diagram
```
┌─────────────────────────────────────────────────────────────────────┐
│ USER TYPE DETECTION │
└─────────────────────────────────────────────────────────────────────┘
│
┌────────────────┴────────────────┐
│ │
▼ ▼
┌─────────────────┐ ┌──────────────────┐
│ NEW USER │ │ EXISTING USER │
│ (Onboarding) │ │ (Already setup) │
└────────┬────────┘ └────────┬─────────┘
│ │
│ │
┌────────▼─────────┐ ┌───────▼──────────┐
│ Check LD Flag │ │ Check State │
│ (extensionUxPna25) │ │ newUserFeature │
│ │ │ Acknowledged? │
└────────┬─────────┘ └───────┬──────────┘
│ │
┌───────┴────────┐ ▼
│ │ = null or false
▼ ▼ (State didn't exist
LD = true LD = false when they onboarded)
│ │ │
│ │ │
▼ ▼ ┌───────▼──────────┐
┌───────────┐ ┌───────────┐ │ Check LD Flag │
│Set state │ │ State │ │ (Feature X) │
│to TRUE │ │ remains │ └────────┬─────────┘
│ │ │ null │ │
│(auto- │ │ │ ┌───────┴────────┐
│acknowledged)│ │(Feature │ │ │
└─────┬─────┘ │ disabled) │ ▼ ▼
│ └─────┬─────┘ LD = true LD = false
│ │ │ │
▼ ▼ │ │
┌──────────────────────────────┐ ▼ ▼
│ Continue with onboarding │ ┌──────────┐ ┌──────────┐
│ (User experiences feature │ │ SHOW │ │ DON'T │
│ naturally) │ │ BANNER │ │ SHOW │
└──────────────────────────────┘ │ │ │ BANNER │
│"Hey! New │ │ │
│ Feature" │ │(Feature │
└────┬─────┘ │ not │
│ │ enabled) │
│ └──────────┘
▼
┌──────────────────┐
│ User Clicks │
│ Banner/Button │
└────────┬─────────┘
│
▼
┌──────────────────┐
│ Set state to │
│ TRUE │
│ │
│ (Changed from │
│ null/false │
│ to true) │
└────────┬─────────┘
│
▼
┌──────────────────┐
│ Banner disappears│
│ (permanently) │
│ │
│ User now has │
│ acknowledged the │
│ new feature │
└──────────────────┘
┌─────────────────────────────────────────────────────────────────────┐
│ STATE VALUES │
├─────────────────────────────────────────────────────────────────────┤
│ TRUE = User has acknowledged the feature │
│ - NEW users: Set during onboarding (if LD flag ON) │
│ - EXISTING users: Set after clicking banner │
│ │
│ FALSE = User hasn't acknowledged yet (or feature was OFF) │
│ - EXISTING users: Start with FALSE (not null) │
│ - NEW users: If LD flag is OFF during onboarding │
│ │
│└─────────────────────────────────────────────────────────────────────┘
```
## **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: Introduces metametrics banner
## **Related issues**
Fixes:
[issue](https://consensyssoftware.atlassian.net/browse/CEUX-716?atlOrigin=eyJpIjoiNThiZDViYmI2NTA5NDVhYjhiMGVmMmIyODlmOTY1NmIiLCJwIjoiaiJ9)
## **Manual testing steps**
1. If user onboarded (existing user), opted for metametrics, LD flag on
-> Banner should show
2. If user onboarded (existing user), not opted for metametrics, LD flag
on -> Banner shouldn't show
3. New user and LD flag on -> Banner shouldn't show
4. LD flag off -> Banner shouldn't show
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**

## **Pre-merge author checklist**
- [ ] 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).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] 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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds a feature-flagged MetaMetrics privacy banner (`PNA25`) with
persisted `pna25Acknowledged` state, onboarding/use-metrics integration,
and supporting env/config/i18n updates.
>
> - **UI**:
> - **Toast**: New `Pna25Banner` in
`ui/components/app/toast-master/toast-master.js` with selector
`selectShowPna25Banner` and action to acknowledge
(`setPna25Acknowledged`).
> - **Selectors/Utils**: Add `selectShowPna25Banner` in
`toast-master/selectors.ts`; wire `setPna25Acknowledged` in
`toast-master/utils.ts`.
> - **Hooks**: `useEnableMetametrics` auto-acknowledges when
`extensionUxPna25` enabled and `pna25Acknowledged === false`.
> - **Onboarding**: `metametrics.js` and `welcome.js` set
`pna25Acknowledged` for new/social users when `EXTENSION_UX_PNA25` is
enabled; updated checkbox copy toggle.
> - **State/Controllers**:
> - Add `pna25Acknowledged` to `AppStateController` state, defaults,
metadata, setter `setPna25Acknowledged`, and background API exposure via
`metamask-controller.js`.
> - Include in Sentry safe-state:
`app/scripts/constants/sentry-state.ts`.
> - Types: add to `shared/types/background.ts`; selector
`getPna25Acknowledged`.
> - **Build/Env**:
> - New env flag `EXTENSION_UX_PNA25: true` across `builds.yml` and
default envs.
> - **i18n/Links**:
> - New messages `pna25BannerTitle`,
`onboardingMetametricCheckboxDescriptionOneUpdated` in
`app/_locales/en*/messages.json`.
> - Add `METAMETRICS_SETTINGS_LINK` in `shared/lib/ui-utils.js`.
> - **Tests/Fixtures**:
> - Update e2e fixtures and state-snapshot schemas to include
`pna25Acknowledged` and related ordering tweaks.
> - **Plumbing**:
> - UI actions: new `setPna25Acknowledged` in `ui/store/actions.ts` and
background wiring.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
bf7d334. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent f855a5e commit ead303c
File tree
23 files changed
+361
-176
lines changed- app
- _locales
- en_GB
- en
- scripts
- constants
- controllers
- test/e2e
- fixtures
- tests
- metrics/state-snapshots
- settings
- ui
- components/app/toast-master
- hooks
- pages/onboarding-flow
- metametrics
- welcome
- selectors
- store
23 files changed
+361
-176
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
792 | 792 | | |
793 | 793 | | |
794 | 794 | | |
| 795 | + | |
795 | 796 | | |
796 | 797 | | |
797 | 798 | | |
| |||
883 | 884 | | |
884 | 885 | | |
885 | 886 | | |
| 887 | + | |
886 | 888 | | |
887 | 889 | | |
888 | 890 | | |
| |||
963 | 965 | | |
964 | 966 | | |
965 | 967 | | |
| 968 | + | |
966 | 969 | | |
967 | 970 | | |
968 | 971 | | |
| |||
1053 | 1056 | | |
1054 | 1057 | | |
1055 | 1058 | | |
| 1059 | + | |
1056 | 1060 | | |
1057 | 1061 | | |
1058 | 1062 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
282 | 283 | | |
283 | 284 | | |
284 | 285 | | |
| 286 | + | |
285 | 287 | | |
286 | 288 | | |
287 | 289 | | |
| |||
479 | 481 | | |
480 | 482 | | |
481 | 483 | | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
482 | 490 | | |
483 | 491 | | |
484 | 492 | | |
| |||
887 | 895 | | |
888 | 896 | | |
889 | 897 | | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
890 | 904 | | |
891 | 905 | | |
892 | 906 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2986 | 2986 | | |
2987 | 2987 | | |
2988 | 2988 | | |
| 2989 | + | |
| 2990 | + | |
2989 | 2991 | | |
2990 | 2992 | | |
2991 | 2993 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| |||
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| 108 | + | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| |||
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
| 144 | + | |
141 | 145 | | |
142 | 146 | | |
143 | 147 | | |
| |||
460 | 464 | | |
461 | 465 | | |
462 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
0 commit comments