Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added AccountWatcher as preinstalled snap and added to menu list #26402

Merged
merged 37 commits into from
Aug 20, 2024

Conversation

k-g-j
Copy link
Contributor

@k-g-j k-g-j commented Aug 13, 2024

Description

This PR adds a new button in the Add Account Menu to direct users to the Account Watcher Homepage. The new feature is hidden behind an Experimental Feature toggle that is off by default for a stealthy launch.

Key changes include:

  1. Added a new menu item in the Add Account Menu for watching Ethereum accounts.
  2. Implemented an Experimental Feature toggle for "Watch Ethereum Accounts (Beta)".
  3. Added metric tracking for the toggle state.
  4. Ensured the toggle is disabled by default.

Note: flow and code changes based on support creation of Bitcoin testnet accounts

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/accounts-planning/issues/468#issue-2331781414

Manual testing steps

  1. Go to Settings > Experimental
  2. Locate the "Watch Ethereum Accounts (Beta)" toggle
  3. Enable the toggle
  4. Navigate to the Add Account Menu
  5. Verify that the new "Watch Ethereum account (Beta)" option is visible
  6. Click on the new option and confirm it redirects to the Account Watcher Homepage
  7. Watch an Ethereum account or ENS (mainnet)
  8. Navigate back to Account Watcher Homepage and press the back arrow in the modal header. It should redirect you to the default wallet page.
  9. Disable the toggle in Settings > Experimental
  10. Verify that the "Watch Ethereum Account" option is no longer visible in the Add Account Menu

Screenshots/Recordings

Screenshot 2024-08-13 at 5 30 53 PM Screenshot 2024-08-14 at 10 07 13 AM
Screen.Recording.2024-08-15.at.12.15.12.PM.mov

Pre-merge author checklist

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.

Copy link
Contributor

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.

Copy link

socket-security bot commented Aug 13, 2024

Copy link

socket-security bot commented Aug 13, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/@metamask/account-watcher@4.1.0

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

@k-g-j k-g-j added area-snaps area-accounts Relating to how sensitive account data is managed and stored. labels Aug 13, 2024
@k-g-j k-g-j marked this pull request as ready for review August 13, 2024 21:36
@k-g-j k-g-j requested review from a team as code owners August 13, 2024 21:36
@k-g-j
Copy link
Contributor Author

k-g-j commented Aug 13, 2024

@SocketSecurity ignore npm/@metamask/account-watcher@4.0.2

Copy link

codecov bot commented Aug 13, 2024

Codecov Report

Attention: Patch coverage is 44.00000% with 14 lines in your changes missing coverage. Please review.

Project coverage is 69.95%. Comparing base (81af2e8) to head (0efea14).

Files Patch % Lines
...multichain/account-list-menu/account-list-menu.tsx 55.56% 4 Missing ⚠️
ui/store/actions.ts 0.00% 4 Missing ⚠️
...gs/experimental-tab/experimental-tab.component.tsx 57.14% 3 Missing ⚠️
app/scripts/controllers/preferences.js 0.00% 2 Missing ⚠️
...ngs/experimental-tab/experimental-tab.container.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #26402      +/-   ##
===========================================
- Coverage    69.96%   69.95%   -0.01%     
===========================================
  Files         1405     1405              
  Lines        48996    49019      +23     
  Branches     13697    13700       +3     
===========================================
+ Hits         34280    34289       +9     
- Misses       14716    14730      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Collaborator

Builds ready [9efcdff]
Page Load Metrics (150 ± 211 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint62232853617
domContentLoaded87118178
load382068150440211
domInteractive87118178
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 435 Bytes (0.01%)
  • ui: 2.46 KiB (0.03%)
  • common: 470.04 KiB (6.67%)

@metamaskbot
Copy link
Collaborator

Builds ready [03a01d9]
Page Load Metrics (415 ± 326 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint703781157033
domContentLoaded98921178
load391802415679326
domInteractive98920178
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 435 Bytes (0.01%)
  • ui: 2.46 KiB (0.03%)
  • common: 470.04 KiB (6.67%)

@metamaskbot
Copy link
Collaborator

Builds ready [b14b0b0]
Page Load Metrics (765 ± 577 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint743801396230
domContentLoaded97827209
load4733137651202577
domInteractive97826209
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 435 Bytes (0.01%)
  • ui: 2.46 KiB (0.03%)
  • common: 470.04 KiB (6.67%)

@metamaskbot
Copy link
Collaborator

Builds ready [5789263]
Page Load Metrics (153 ± 189 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint792001022713
domContentLoaded105520136
load451863153393189
domInteractive105520136
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 435 Bytes (0.01%)
  • ui: 2.46 KiB (0.03%)
  • common: 470.04 KiB (6.67%)

@k-g-j
Copy link
Contributor Author

k-g-j commented Aug 14, 2024

@SocketSecurity ignore npm/@metamask/account-watcher@4.0.3

@metamaskbot
Copy link
Collaborator

Builds ready [e08a9b1]
Page Load Metrics (206 ± 222 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint772971356029
domContentLoaded984322110
load552216206463222
domInteractive984322110
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 435 Bytes (0.01%)
  • ui: 2.46 KiB (0.03%)
  • common: 470.05 KiB (6.67%)

@k-g-j
Copy link
Contributor Author

k-g-j commented Aug 16, 2024

@SocketSecurity ignore npm/@metamask/account-watcher@4.1.0

@k-g-j k-g-j requested a review from a team as a code owner August 19, 2024 15:18
@k-g-j
Copy link
Contributor Author

k-g-j commented Aug 19, 2024

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated

Copy link

sonarcloud bot commented Aug 19, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [0efea14]
Page Load Metrics (82 ± 13 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint701671082914
domContentLoaded38139773115
load45140822813
domInteractive96229157
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 28.56 KiB (0.86%)
  • ui: 2.58 KiB (0.04%)
  • common: 350.3 KiB (4.46%)

Copy link
Contributor

@owencraston owencraston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retested with the prod builds and everything looks good to me. Good work!

Screen.Recording.2024-08-19.at.2.58.10.PM.mov
Screen.Recording.2024-08-19.at.3.02.06.PM.1080.mov

Copy link
Contributor

@jpuri jpuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in code owned by confirmations team look good 👍

@k-g-j k-g-j merged commit f6fc55e into develop Aug 20, 2024
78 checks passed
@k-g-j k-g-j deleted the feat/add-account-watcher-snap branch August 20, 2024 19:56
@github-actions github-actions bot locked and limited conversation to collaborators Aug 20, 2024
@metamaskbot metamaskbot added the release-12.5.0 Issue or pull request that will be included in release 12.5.0 label Aug 20, 2024
@gauthierpetetin gauthierpetetin added release-12.4.0 Issue or pull request that will be included in release 12.4.0 and removed release-12.5.0 Issue or pull request that will be included in release 12.5.0 labels Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-accounts Relating to how sensitive account data is managed and stored. area-snaps release-12.4.0 Issue or pull request that will be included in release 12.4.0 team-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants