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: add privacy toggle #8234

Merged
merged 11 commits into from
Feb 6, 2024
Merged

feat: add privacy toggle #8234

merged 11 commits into from
Feb 6, 2024

Conversation

salimtb
Copy link
Contributor

@salimtb salimtb commented Jan 10, 2024

Description

This task aims to add the ability to turn on and off the network verification feature. To do that, we will be adding both a toggleable section in the settings as well as a contextual banner and sheet for quickly toggling it on.

Related issues

Fixes: #1269

Manual testing steps

  1. Go to the setting page
  2. Go to Security and Privacy
  3. Enable/disable the network details check
  4. Go to add network
  5. if the toggle was disabled you should see a banner ( check the video below )

Screenshots/Recordings

Before

After

https://drive.google.com/drive/folders/1BeTFKHelGrzu5XPUfXLTa-om7inhtowU?usp=drive_link

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • 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.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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 January 10, 2024 13:31
@salimtb salimtb marked this pull request as draft January 10, 2024 13:31
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.

@salimtb salimtb force-pushed the feat/add-privacy-toggle branch 2 times, most recently from 756c61c to 3f70a36 Compare January 10, 2024 13:51
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/70d1699d-6d0e-40e5-aeba-735ebfcec33e
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@salimtb salimtb added needs-qa Any New Features that needs a full manual QA prior to being added to a release. team-mobile-ux DEPRECATED: please use "team-wallet-ux" label instead need-ux-ds-review A label to be used for design system and UX PR review labels Jan 10, 2024
@salimtb salimtb marked this pull request as ready for review January 10, 2024 14:43
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/58f823e6-cd4e-454e-ab76-5eb8bf3246f8
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@salimtb salimtb removed the needs-qa Any New Features that needs a full manual QA prior to being added to a release. label Jan 10, 2024
@Cal-L
Copy link
Contributor

Cal-L commented Jan 10, 2024

@salimtb There was a ticket 2 of 3 prior to this iteration. Is it correct to say those changes are also implemented in this PR? When you have the chance, could you also verify that the network verification errors are still being respected when adding network from both custom and dapps? A video would be fine

Copy link
Contributor

@tommasini tommasini left a comment

Choose a reason for hiding this comment

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

Awesome work!

Just some comments:

  • It seems that comparing it with figma is missing bold on the copy Settings -> Security and Privacy part
    image
    image

  • Can we also have a scenario with the recordings of the scenario with warning alerts?

    • When added a chain via Dapp
    • When adding a chain via Custom Network
  • It seems that I started the first PR of this Batch and I missed it or it was added to the Figma after, but the banners are missing a cross icon to be able to closed on the right side :( , let me know if you can add it!
    Figma:
    image

Recording from the first batch PR

  • Also it makes sense to add a condition before we check the networks here , we do not want to fetch anything if the toggle is disabled

NIT:
Do you think it would be better extracting the contextual sheet of enabling/disabling the new privacy toggle would be better for easier change/reusability on the future?

@tommasini
Copy link
Contributor

tommasini commented Jan 10, 2024

Also wanted to bring up a product question, I can see that on slide 28 we do show intention to show the warning banners of the network when adding it from our popular list.
I'm wondering if that should be the case, since we control all the add network flow from the networks on our popular list (all that networks data is hardcoded here)

It seems just new noise to the user, let me know your thoughts

cc: @hesterbruikman @alfeng6

@hesterbruikman hesterbruikman added the design-review Any feature that needs feedback from the design team label Jan 11, 2024
@hesterbruikman

This comment was marked as resolved.

@salimtb

This comment was marked as resolved.

@hesterbruikman
Copy link
Contributor

Also wanted to bring up a product question, I can see that on slide 28 we do show intention to show the warning banners of the network when adding it from our popular list. I'm wondering if that should be the case, since we control all the add network flow from the networks on our popular list (all that networks data is hardcoded here)

It seems just new noise to the user, let me know your thoughts

cc: @hesterbruikman @alfeng6

@tommasini Let me see if I understand the logic you're proposing correctly:

  • GIVEN User adds Custom Network (manually)
  • AND Details of Custom Network Details match those of hardcoded popular network list
  • THEN Don't show warning

If so I agree. And we can probably makes this smarter as a next step as well. This would be the sequence of implementation and logic:

  • Warn - Any Custom Network based on Chain ID verification [CURRENT BATCH]
  • Promote - Auto-populate Network details based on Chain ID (allows editing) - Current batch - Warn for any Custom Network based on Chain ID verification [TICKET OF INCIDENT 337 #1347]
  • Optimise for Popular Networks - Hide warning when Custom Network is added where details match Popular Network details [NO TICKET]
  • Recommend - Propose Popular Network hardcoded network details when custom is added with same ID of Popular Network list [NO TICKET]

@alfeng6 Wdyt? I do have reservation about my own proposal as a last step. UX improvement, but we should generally avoid making strong recommendations

@hesterbruikman

This comment was marked as resolved.

@coreyjanssen

This comment was marked as resolved.

@salimtb salimtb marked this pull request as draft January 12, 2024 09:03
@salimtb salimtb force-pushed the feat/add-privacy-toggle branch 5 times, most recently from a140545 to 897543f Compare January 16, 2024 11:12
@salimtb salimtb force-pushed the feat/add-privacy-toggle branch from 5af7e3c to a748747 Compare February 2, 2024 17:45
@chrisleewilcox
Copy link
Contributor

chrisleewilcox commented Feb 3, 2024

Hi @salimtb
Thanks for looking into this. Looks like the test is working on iOS but it's now failing for android device. Looks like when adding a custom network for android device the approve and switch modal is not showing like it does for iOS after adding a network. These are the lines that fail in the tests when running on android emulator. Can you take an look and ensure that after adding custom network the approve and switch views are shown for android devices?
I tested this locally and it took me awhile to notice this. The test seems to be good as is and should pass once the fix for showing approve and switch views are shown for android. Hope all this makes sense and reach out if you have any questions.
image
Regression tests showing iOS passes but android fails: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/d13b5fef-a88a-4515-bde7-c31b89c8b1cc

Recording showing approve and switch views not shown on android: https://recordit.co/82bDXlPoXa

@chrisleewilcox chrisleewilcox added QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed and removed QA in Progress QA has started on the feature. labels Feb 5, 2024
@salimtb salimtb force-pushed the feat/add-privacy-toggle branch from c5826a1 to d04931b Compare February 6, 2024 10:34
@salimtb salimtb force-pushed the feat/add-privacy-toggle branch from d04931b to 49943d2 Compare February 6, 2024 12:15
Copy link

sonarqubecloud bot commented Feb 6, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

7 New issues
0 Security Hotspots
69.2% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@salimtb salimtb added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 6, 2024
Copy link
Contributor

github-actions bot commented Feb 6, 2024

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/8de3fb2b-dcc1-4750-88e8-a2e2a60321f0
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@salimtb salimtb removed the Run Smoke E2E Triggers smoke e2e on Bitrise label Feb 6, 2024
@chrisleewilcox chrisleewilcox added QA Passed A successful QA run through has been done and removed QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed labels Feb 6, 2024
@chrisleewilcox chrisleewilcox merged commit 4fd60d9 into main Feb 6, 2024
33 checks passed
@chrisleewilcox chrisleewilcox deleted the feat/add-privacy-toggle branch February 6, 2024 18:14
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2024
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Feb 6, 2024
@metamaskbot metamaskbot added the release-7.17.0 Issue or pull request that will be included in release 7.17.0 label Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
design-review Any feature that needs feedback from the design team need-ux-ds-review A label to be used for design system and UX PR review QA Passed A successful QA run through has been done release-7.17.0 Issue or pull request that will be included in release 7.17.0 team-assets team-mobile-ux DEPRECATED: please use "team-wallet-ux" label instead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants