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

Security and Privacy Settings Re-org #16756

Merged
merged 5 commits into from
Dec 19, 2022
Merged

Conversation

segun
Copy link
Contributor

@segun segun commented Dec 1, 2022

Explanation

Reorganize settings so that all privacy related settings are easily discoverable, understood and toggleable.

Some settings (e.g Enhanced Token Detection) are in advanced tab, they should be moved to Security and Privacy Tab
There should also be a toggle to switch off/on all security and privacy toggles.

Screenshots/Screencaps

Before

Screenshot 2022-12-01 at 16 05 10

After

Screenshot 2022-12-01 at 16 05 22

Manual Testing Steps

  1. Launch MetaMask
  2. Open Settings
  3. Make sure all security and privacy settings (see Reorganize settings so that all privacy related settings are easily discoverable, understood and toggleable #16727) are under the Security and Privacy Tab
  4. Make sure there's a checkbox on the tab to switch off/on all checkboxes in the tab

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@segun segun requested a review from a team as a code owner December 1, 2022 10:25
@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2022

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.

@segun segun marked this pull request as draft December 1, 2022 10:26
@metamaskbot
Copy link
Collaborator

Builds ready [66c2577]
Page Load Metrics (2170 ± 94 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint962321292914
domContentLoaded16702538213919192
load16702538217019594
domInteractive16702538213919192
Bundle size diffs
  • background: 0 bytes
  • ui: 9 bytes
  • common: 0 bytes

highlights:

storybook

@@ -91,37 +89,6 @@ export default class AdvancedTab extends PureComponent {
handleSettingsRefs(t, t('advanced'), this.settingsRefs);
}

renderMobileSync() {
Copy link
Contributor Author

@segun segun Dec 1, 2022

Choose a reason for hiding this comment

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

The changes in this file are huge because I have to re-arrange the renderXXX methods such that if follows a logical order of this.settingsRefs[XXX], so this.settingsRefs[0] comes before this.settingsRefs[14] for instance.

This will make adding/removing new renderXXX method in the future easier.

</div>
</div>
</div>
);
}

renderTokenDetectionToggle() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only change logic-wise in this file, is that this method (and attendant variables) was removed and moved to security tab component.

@@ -83,6 +99,61 @@ export default class SecurityTab extends PureComponent {
);
}

renderIncomingTransactionsOptIn() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to make the same arrangement for renderXXX methods here like I did in advanced tab components.

@segun segun self-assigned this Dec 1, 2022
@segun segun marked this pull request as ready for review December 1, 2022 12:24
@metamaskbot
Copy link
Collaborator

Builds ready [bd0900b]
Page Load Metrics (2164 ± 115 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint96153118189
domContentLoaded162226652139243117
load162226652164240115
domInteractive162226652139243117
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 193 bytes
  • ui: 1425 bytes
  • common: 359 bytes

highlights:

storybook

@kevinghim
Copy link
Contributor

@segun please remove the Toggle All section

@segun segun force-pushed the dev-segun-security-privacy-settings branch 2 times, most recently from 7d17714 to b4e5797 Compare December 8, 2022 16:03
@PeterYinusa PeterYinusa added this to the v10.24.0 milestone Dec 8, 2022
@metamaskbot
Copy link
Collaborator

Builds ready [b4e5797]
Page Load Metrics (2528 ± 268 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1011284300402193
domContentLoaded188738442508560269
load188738442528559268
domInteractive188738442508560269
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 223 bytes
  • ui: 6342 bytes
  • common: 773 bytes

highlights:

storybook

@segun segun force-pushed the dev-segun-security-privacy-settings branch 2 times, most recently from e2a2875 to f8c7afd Compare December 12, 2022 17:35
@metamaskbot
Copy link
Collaborator

Builds ready [abb3b72]
Page Load Metrics (1928 ± 56 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint971791182110
domContentLoaded15562117192112158
load15562117192811756
domInteractive15562116192112158
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 223 bytes
  • ui: 7552 bytes
  • common: 773 bytes

highlights:

storybook

@@ -35,6 +35,7 @@ export default class PreferencesController {
useNonceField: false,
usePhishDetect: true,
dismissSeedBackUpReminder: false,
showGasFeeEstimationBuySwapTokens: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove the toggle that controls this boolean from this PR

@@ -1637,6 +1637,10 @@ export default class MetamaskController extends EventEmitter {
setUseTokenDetection: preferencesController.setUseTokenDetection.bind(
preferencesController,
),
setShowGasFeeEstimationBuySwapTokens:
Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove the toggle that this function controls from this PR

@@ -167,7 +230,218 @@ export default class SecurityTab extends PureComponent {
);
}

renderMultiAccountBalanceCheckerOptIn() {
renderShowGasFeeEstimationBuySwapTokensToggle() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove this from this PR. We will add this in a future PR, when we are ready to deal with those features being toggled off.

Copy link
Contributor

@danjm danjm left a comment

Choose a reason for hiding this comment

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

Code looks good. Only change needed is to remove the toggle and associated code, which I commented on

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Toggle all security & privacy settings by a single checkbox

Signed-off-by: Akintayo A. Olusegun <[email protected]>

i18n

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Global Settings toggle tests

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Add new privacy settings
    show balance and price checker

Signed-off-by: Akintayo A. Olusegun <[email protected]>

New settings

renderShowGasFeeEstimationBuySwapTokensToggle

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Some css changes

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Add other privacy links.

Signed-off-by: Akintayo A. Olusegun <[email protected]>

more i18n

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Add custom network

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Add custom IPFS gateway

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Autodetect tokens

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Batch account balance requests

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Renamed batch account balance checker to useMultiAccountBalanceChecker

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Tests

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Fixtures buikder change

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Fix rebase duplicate methods.

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Added the learn more link

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Remove Toggle All

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Remove preferences we don't already have

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Auto Detect NFTs

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Make tests pass

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Lint fixes

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Fix locales.

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Move settings to security section

Signed-off-by: Akintayo A. Olusegun <[email protected]>

Git ignore

Signed-off-by: Akintayo A. Olusegun <[email protected]>
Signed-off-by: Akintayo A. Olusegun <[email protected]>
Signed-off-by: Akintayo A. Olusegun <[email protected]>
@segun segun force-pushed the dev-segun-security-privacy-settings branch from abb3b72 to 085ac44 Compare December 14, 2022 23:20
Signed-off-by: Akintayo A. Olusegun <[email protected]>
@metamaskbot
Copy link
Collaborator

Builds ready [1515943]
Page Load Metrics (2149 ± 105 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1051811472211
domContentLoaded171425912145218105
load171525912149218105
domInteractive171425912145218105
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 bytes
  • ui: 5853 bytes
  • common: 530 bytes

highlights:

storybook

Copy link
Contributor

@danjm danjm left a comment

Choose a reason for hiding this comment

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

LGTM

{this.renderAutoDectectTokensToggle()}
{this.renderBatchAccountBalanceRequestsToggle()}
{this.renderCollectibleDetectionToggle()}
</div>
{this.renderMetaMetricsOptIn()}
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we're missing the title Usage above this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@darkwing if you mean the <span className="settings-page__security-tab-sub-header">, it was decided that we should leave this like that.

@segun segun merged commit 13de51e into develop Dec 19, 2022
@segun segun deleted the dev-segun-security-privacy-settings branch December 19, 2022 17:46
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reorganize settings so that all privacy related settings are easily discoverable, understood and toggleable
7 participants