metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

feat: Add new privacy policy toast

Open jonybur opened this issue 11 months ago • 9 comments

Description

Changes: Adds a new privacy policy banner that will show up after June 4, 2024. If the user closes it manually, the privacy policy banner will not show up again. If the user does not close the toast manually, the privacy policy banner will cease to show up after a day of being shown for the first time. Changes the Survey banner so that we can display multiple banners at the same time without overlapping each other.

Considerations:

  • Make sure this doesn't show up during onboarding
  • This toast will show up even after years of the privacy policy being changed. We should set up a deadline for that or eventually revert this PR.
  • Check if copy is correct.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2319

Manual testing steps

  1. Go to the home page
  2. Check if there's a new privacy banner there (date should be edited in the code so that the privacy policy shows up earlier than May 6, 2024)
  3. When closing it, it shouldn't show up again
  4. If not closing it manually, the toast should not show up again after 1 day of being shown for the first time. This data is saved in localStorage so editing the timestamp there should be enough to test this feature out.

Screenshots/Recordings

Before

After

Screenshot 2024-04-22 at 15 51 53 Screenshot 2024-04-22 at 15 52 06 Screenshot 2024-04-22 at 15 52 20

Pre-merge author checklist

  • [x] I’ve followed MetaMask Coding Standards.
  • [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 format if applicable
  • [x] I’ve applied the right labels on the PR (see labeling guidelines). 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.

jonybur avatar Apr 03 '24 13:04 jonybur

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

github-actions[bot] avatar Apr 03 '24 13:04 github-actions[bot]

Kicked CI because test failures look intermittent. This looks awesome!

darkwing avatar Apr 08 '24 18:04 darkwing

To get CI tests to pass, you might need to update the error spec file and fixtures as you have added the state in the app-state directly. Use the command yarn build:test and once the build is generated. You need to run yarn test:e2e:single test/e2e/tests/errors.spec.js --browser chrome --update-snapshot

NidhiKJha avatar Apr 09 '24 06:04 NidhiKJha

Almost there! Looking really good so far!

darkwing avatar Apr 09 '24 22:04 darkwing

Builds ready [2b58957]
Page Load Metrics (1569 ± 657 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6913594199
domContentLoaded10331673
load56333015691369657
domInteractive10331673
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 450 Bytes (0.01%)
  • ui: 1.58 KiB (0.02%)
  • common: 1.25 KiB (0.02%)

metamaskbot avatar May 08 '24 23:05 metamaskbot

Builds ready [23a6b09]
Page Load Metrics (1262 ± 729 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint721861033115
domContentLoaded95419136
load59473912621518729
domInteractive95419146
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 450 Bytes (0.01%)
  • ui: 1.58 KiB (0.02%)
  • common: 1.25 KiB (0.02%)

metamaskbot avatar May 10 '24 19:05 metamaskbot

Builds ready [977936a]
Page Load Metrics (756 ± 576 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint55149902311
domContentLoaded76816136
load4433517561201576
domInteractive76816136
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 450 Bytes (0.01%)
  • ui: 1.58 KiB (0.02%)
  • common: 1.25 KiB (0.02%)

metamaskbot avatar May 10 '24 20:05 metamaskbot

Codecov Report

Attention: Patch coverage is 50.60241% with 41 lines in your changes are missing coverage. Please review.

Project coverage is 67.42%. Comparing base (cfcbd1e) to head (977936a).

Files Patch % Lines
ui/pages/routes/routes.component.js 51.85% 26 Missing :warning:
app/scripts/metamask-controller.js 0.00% 5 Missing :warning:
ui/store/actions.ts 33.33% 4 Missing :warning:
app/scripts/controllers/app-state.js 0.00% 3 Missing :warning:
ui/pages/routes/routes.container.js 0.00% 3 Missing :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #23838      +/-   ##
===========================================
- Coverage    67.48%   67.42%   -0.05%     
===========================================
  Files         1288     1289       +1     
  Lines        50153    50236      +83     
  Branches     13023    13023              
===========================================
+ Hits         33842    33871      +29     
- Misses       16311    16365      +54     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 10 '24 20:05 codecov[bot]

@jonybur I can confirm I no longer see the strange behavior of the toast not going away. 👍

darkwing avatar May 10 '24 20:05 darkwing

Missing release label release-11.16.0 on PR. Adding release label release-11.16.0 on PR and removing other release labels(release-11.18.0), as PR was cherry-picked in branch 11.16.0.

metamaskbot avatar May 22 '24 22:05 metamaskbot