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

feat: Skip wallet onboarding for developers

Open pedronfigueiredo opened this issue 11 months ago • 3 comments

Description

  • Implements a new development build script that skips onboarding by preloading state from the end-to-end test fixtures.
  • The vault state is dynamically generated from the environment variables TEST_SRP and PASSWORD.
  • This build hides all the "What's New?" modals and the "Product Tour" as well as all onboarding screens.
  • The network is set to "Sepolia" by default.
  • Alternatively, onboarding can be skipped without setting a TEST_SRP, in which case the e2e tests SRP and accounts are used.

Open in GitHub Codespaces

Related issues

Related: #23615, #19389

Manual testing steps

  1. Checkout this branch
  2. Set a TEST_SRP environment variable on your .metamaskrc file as well as PASSWORD if you haven't already
  3. Run yarn start:skip-onboarding
  4. Load the extension on your favorite browser and open the popup

Screenshots/Recordings

After

https://github.com/MetaMask/metamask-extension/assets/13814744/e34bac0f-8f6f-4d04-8452-b9962c99cfb9

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.

pedronfigueiredo avatar Mar 28 '24 14:03 pedronfigueiredo

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 Mar 28 '24 14:03 github-actions[bot]

hey cool idea :rocket: I think we could add a section in the README about this script. Somewhere here maybe? Also, adding a couple of comments (no-changes needed) but maybe this could also be useful to clarify in the documentation.

  • it seems to work only with fresh installs: if I have an older wallet instance and I re-build with a new SRP, I see the old wallet accounts and if I generate new accounts, it's using the old SRP

https://github.com/MetaMask/metamask-extension/assets/54408225/ad40b554-f250-4b94-a229-ccf068a05fe7

  • it loads only 1 Account, despite having more balance in subsequent accounts (similarly as in the e2e). Usually in regular builds, we load as many accounts as they have balance, in the following way:
    • Account1 is loaded
    • Account2 has balance -- is loaded
    • Account3 has balance --is loaded
    • Account4 doesn't have balance -- it is not loaded and we stop loading accounts at this point, no matter if the next account has balance

However, I think for the purposes of this script, it's totally fine to load only 1 account.

Screenshot from 2024-04-15 10-21-09

Screenshot from 2024-04-15 10-23-40

seaona avatar Apr 15 '24 09:04 seaona

LGTM ! Thanks for the changes, gonna be such a life-changing

DDDDDanica avatar May 24 '24 11:05 DDDDDanica

Builds ready [c44d152]
Page Load Metrics (530 ± 438 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6756611810450
domContentLoaded8331263
load522414530912438
domInteractive8331263
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 7.74 KiB (0.22%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar May 27 '24 13:05 metamaskbot