Skip to content

feat: add token autodetect modal#24281

Merged
salimtb merged 7 commits intodevelopfrom
auto-detect-token-modal
May 31, 2024
Merged

feat: add token autodetect modal#24281
salimtb merged 7 commits intodevelopfrom
auto-detect-token-modal

Conversation

@salimtb
Copy link
Copy Markdown
Contributor

@salimtb salimtb commented Apr 29, 2024

Description

Add in recommended auto token enablement button in new Extension app update, once we enable auto token detection by default for new users, for existing users, we need to get them to turn on auto token detection as well.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. you are an existing user and you have token autodetection off
  2. once the upgrade will be done , you should see the modal below right after what's new pop up
  3. if you have it of and you decide to disable , you should see the pop up once

Screenshots/Recordings

Before

No Modal was displayed

After

Existing users with toggle off

Screen.Recording.2024-05-02.at.16.25.31.mov

Users with toggle on and want to disable it ( the modal should be displayed once )

Screen.Recording.2024-05-02.at.16.36.09.mov

Pre-merge author checklist

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

@salimtb salimtb requested a review from a team as a code owner April 29, 2024 14:13
@github-actions
Copy link
Copy Markdown
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.

@salimtb salimtb self-assigned this Apr 29, 2024
@salimtb salimtb added team-assets needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. labels Apr 29, 2024
@salimtb salimtb force-pushed the auto-detect-token-modal branch 2 times, most recently from 1277bd2 to c5e0978 Compare April 29, 2024 15:12
@salimtb salimtb marked this pull request as draft April 30, 2024 08:24
@salimtb salimtb force-pushed the auto-detect-token-modal branch 4 times, most recently from 0f0a7f9 to 85398c5 Compare May 2, 2024 10:36
@codecov
Copy link
Copy Markdown

codecov bot commented May 2, 2024

Codecov Report

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

Project coverage is 65.76%. Comparing base (5f22357) to head (283fd03).

Files Patch % Lines
ui/store/actions.ts 16.67% 10 Missing ⚠️
app/scripts/metamask-controller.js 0.00% 6 Missing ⚠️
shared/modules/selectors/token-auto-detect.ts 58.33% 5 Missing ⚠️
ui/ducks/metamask/metamask.js 0.00% 4 Missing ⚠️
ui/pages/home/home.container.js 0.00% 4 Missing ⚠️
ui/pages/home/home.component.js 25.00% 3 Missing ⚠️
app/scripts/controllers/app-metadata.ts 0.00% 2 Missing ⚠️
.../app/auto-detect-token/auto-detect-token-modal.tsx 94.12% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #24281      +/-   ##
===========================================
- Coverage    65.79%   65.76%   -0.02%     
===========================================
  Files         1364     1366       +2     
  Lines        54315    54385      +70     
  Branches     14126    14139      +13     
===========================================
+ Hits         35732    35766      +34     
- Misses       18583    18619      +36     

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

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [85398c5]
Page Load Metrics (581 ± 501 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint60161822612
domContentLoaded86013115
load4727015811043501
domInteractive86013115
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 30 Bytes (0.00%)
  • ui: 4.94 KiB (0.08%)
  • common: 1.64 KiB (0.03%)

@salimtb salimtb marked this pull request as ready for review May 2, 2024 11:40
@salimtb salimtb force-pushed the auto-detect-token-modal branch from 85398c5 to 423ff7e Compare May 7, 2024 10:38
@salimtb salimtb force-pushed the auto-detect-token-modal branch from 28d25b5 to 5237b5b Compare May 7, 2024 22:19
@salimtb salimtb requested a review from a team May 7, 2024 22:20
@bergeron
Copy link
Copy Markdown
Contributor

I haven't been able to get this modal to appear yet. Maybe my process is wrong, and not sufficient to simulate the upgrade.

I imported a fresh build from develop and disabled token autodetect. Then I changed to a build of this branch. But it doesn't show the modal because this is undefined instead of null:

Screenshot 2024-05-14 at 10 33 42 AM

@salimtb salimtb force-pushed the auto-detect-token-modal branch from 5237b5b to d14ab2e Compare May 15, 2024 08:13
@salimtb
Copy link
Copy Markdown
Contributor Author

salimtb commented May 15, 2024

I haven't been able to get this modal to appear yet. Maybe my process is wrong, and not sufficient to simulate the upgrade.

I imported a fresh build from develop and disabled token autodetect. Then I changed to a build of this branch. But it doesn't show the modal because this is undefined instead of null:

Screenshot 2024-05-14 at 10 33 42 AM

Hey @bergeron ,

It seems there's an issue with the process you're following. The modal in question is designed to show up exclusively during the onboarding/upgrade process, and it will only do so after a fresh installation of the app.

if you're doing the fresh app using develop branch, you'll not see the modal.

To replicate the issue, there are two methods. The first method applies to users who have the auto-detection feature turned off by default:

  • In the preferences.js file, set the state to false (this simulates users who have token auto-detection disabled by default).
  • Build and import your app using the auto-detect-token-modal branch.
  • Import your account.
  • You should see the modal appear right after the transaction simulation (refer to the linked video for clarity).
default-off.mov

The second method is for users who had auto-detection enabled by default upon installing the app:

  • Install your app from the build using the auto-detect-token-modal branch.
  • Navigate to settings and turn off token auto-detection.
  • Return to the wallet view, and the modal should appear.
  • For this scenario, please refer to the provided video for more details.
default-on.mov

Let me know if you need any further information or clarification.

@salimtb salimtb force-pushed the auto-detect-token-modal branch from d14ab2e to 73b61f5 Compare May 15, 2024 08:56
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [73b61f5]
Page Load Metrics (1353 ± 684 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint73160972512
domContentLoaded108618178
load59345413531424684
domInteractive108618178
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 30 Bytes (0.00%)
  • ui: 4.94 KiB (0.08%)
  • common: 1.68 KiB (0.03%)

@salimtb salimtb force-pushed the auto-detect-token-modal branch 2 times, most recently from cca53f3 to f9986a0 Compare May 30, 2024 16:11
@sahar-fehri
Copy link
Copy Markdown
Contributor

I ve tested the upgrade scenario and the fresh import, the modal was displayed correctly, thnx 🙏

sahar-fehri
sahar-fehri previously approved these changes May 30, 2024
sahar-fehri
sahar-fehri previously approved these changes May 31, 2024
@salimtb salimtb force-pushed the auto-detect-token-modal branch 2 times, most recently from 83ba180 to 0f1081c Compare May 31, 2024 09:11
@salimtb salimtb force-pushed the auto-detect-token-modal branch from c85becb to 9814ae8 Compare May 31, 2024 12:36
@salimtb salimtb force-pushed the auto-detect-token-modal branch from 9814ae8 to 283fd03 Compare May 31, 2024 15:47
@salimtb salimtb requested a review from georgewrmarshall May 31, 2024 16:11
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [283fd03]
Page Load Metrics (66 ± 8 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint8012798126
domContentLoaded11241331
load4810966168
domInteractive11231331

@salimtb salimtb merged commit b560fdc into develop May 31, 2024
@salimtb salimtb deleted the auto-detect-token-modal branch May 31, 2024 17:19
@github-actions github-actions bot locked and limited conversation to collaborators May 31, 2024
@gauthierpetetin gauthierpetetin added the release-12.0.0 Issue or pull request that will be included in release 12.0.0 label Jun 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. release-12.0.0 Issue or pull request that will be included in release 12.0.0 team-assets

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants