Skip to content

feat: Implement the "Manage in settings" variation for the STX Opt In modal#24771

Merged
dan437 merged 4 commits intodevelopfrom
opt-in-variation
May 28, 2024
Merged

feat: Implement the "Manage in settings" variation for the STX Opt In modal#24771
dan437 merged 4 commits intodevelopfrom
opt-in-variation

Conversation

@dan437
Copy link
Copy Markdown
Contributor

@dan437 dan437 commented May 24, 2024

Description

Slight variation for the STX Opt In modal: Add a link to "Manage in settings"

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Install the extension from scratch
  2. After the initial setup you will see the STX Opt In modal
  3. It will show the "Manage in settings" link. After clicking on it we opt out a user from Smart Transactions, but they will be redirected to Advanced Settings, where they can turn it on if they want or just close the Settings

Screenshots/Recordings

STX Opt In modal:
image

Advanced Settings with STX:
image

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.

@dan437 dan437 requested a review from a team as a code owner May 24, 2024 13:30
@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.

dbrans
dbrans previously approved these changes May 24, 2024
Copy link
Copy Markdown
Contributor

@dbrans dbrans left a comment

Choose a reason for hiding this comment

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

Fantastic Dan!

@dbrans dbrans added the team-transactions Transactions team label May 24, 2024
@dbrans dbrans changed the title Implement the "Manage in settings" variation for the STX Opt In modal feat: Implement the "Manage in settings" variation for the STX Opt In modal May 24, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [1113c78]
Page Load Metrics (1403 ± 581 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint641831073216
domContentLoaded10301452
load51270114031211581
domInteractive10301452
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0.00%)
  • ui: 298 Bytes (0.00%)
  • common: -21 Bytes (-0.00%)

@codecov
Copy link
Copy Markdown

codecov bot commented May 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.72%. Comparing base (3af209b) to head (8448fe2).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #24771      +/-   ##
===========================================
+ Coverage    65.69%   65.72%   +0.03%     
===========================================
  Files         1360     1360              
  Lines        54081    54083       +2     
  Branches     14051    14051              
===========================================
+ Hits         35525    35542      +17     
+ Misses       18556    18541      -15     

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

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [8448fe2]
Page Load Metrics (751 ± 498 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint661791032813
domContentLoaded9381484
load5425747511038498
domInteractive9381484
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0.00%)
  • ui: 298 Bytes (0.00%)
  • common: -21 Bytes (-0.00%)

@dan437 dan437 force-pushed the opt-in-variation branch from 8448fe2 to 05bcec5 Compare May 28, 2024 12:19
dbrans
dbrans previously approved these changes May 28, 2024
className="mm-smart-transactions-opt-in-modal__no-thanks-link"
>
{t('dontEnableEnhancedProtection')}
{t('manageInSettings')}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Dan, I was thinking about the "managing in settings" button and had a small suggestion. The button text seems to imply that the user is deferring the opt-in decision rather than explicitly declining it. Since the default for an "opt-in" is false, calling setSmartTransactionsOptInStatus(false) might not be necessary when they click that button.

However, if we need to track whether the user has seen the opt-in modal (set smartTransactionsOptInStatus to something other than undefined), maybe we could rename the handler to "handleMarkOptInModalSeen" instead of "handleNoThanks"? And we could add a comment like: "We setSmartTransactionsOptInStatus(false) to track that user has seen the opt-in modal."

What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As we have discussed, I've renamed the NoThanks component to ManageInSettings + its on-click handler as well. I've also added an explanation comment about that we need to call setSmartTransactionsOptInStatus(false), so a user wouldn't see the opt-in modal again.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [05bcec5]
Page Load Metrics (834 ± 499 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint60177992813
domContentLoaded8461284
load4924008341040499
domInteractive8461284
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0.00%)
  • ui: 298 Bytes (0.00%)
  • common: -21 Bytes (-0.00%)

Copy link
Copy Markdown
Contributor

@dbrans dbrans left a comment

Choose a reason for hiding this comment

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

Amazing work, Dan!

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [c419b85]
Page Load Metrics (846 ± 504 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint701801022512
domContentLoaded9171121
load5824628461050504
domInteractive9171121
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0.00%)
  • ui: 314 Bytes (0.00%)
  • common: -21 Bytes (-0.00%)

@dan437 dan437 merged commit 82fe51c into develop May 28, 2024
@dan437 dan437 deleted the opt-in-variation branch May 28, 2024 16:18
@github-actions github-actions bot locked and limited conversation to collaborators May 28, 2024
@metamaskbot metamaskbot added release-11.18.0 release-11.16.1 Issue or pull request that will be included in release 11.16.1 and removed release-11.18.0 labels May 28, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-11.16.1 Issue or pull request that will be included in release 11.16.1 team-transactions Transactions team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants