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 mode #28021

Merged
merged 31 commits into from
Oct 30, 2024
Merged

feat: add privacy mode #28021

merged 31 commits into from
Oct 30, 2024

Conversation

jonybur
Copy link
Contributor

@jonybur jonybur commented Oct 22, 2024

Description

Adds a privacy mode toggle (an eye icon next to the main balance) that hides all sensitive information/token balances

UPDATE
Here is feedback from @amandaye0h and has been currently implemented in this PR
Figma

Open in GitHub Codespaces

Related issues

Fixes:
https://github.com/MetaMask/MetaMask-planning/issues/3416
https://github.com/MetaMask/MetaMask-planning/issues/3418
https://github.com/MetaMask/MetaMask-planning/issues/3419

Manual testing steps

  1. Go to the Wallet page
  2. Click on the new Eye icon next to the balance
  3. All balances should be hidden
  4. Click on the Eye icon once again
  5. All balances should be shown

Screenshots/Recordings

Before

After

nocontent2.mp4
demo2.mp4
Screenshot 2024-10-22 at 18 43 19

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.

@jonybur jonybur requested review from a team as code owners October 22, 2024 18:38
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.

ui/store/actions.ts Outdated Show resolved Hide resolved
@metamaskbot
Copy link
Collaborator

Builds ready [02b49f1]
Page Load Metrics (2013 ± 72 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint18092557201216881
domContentLoaded17932394196114168
load18582495201315172
domInteractive22166523115
backgroundConnect11115483014
firstReactRender513031056531
getState493342613
initialActions01000
loadScripts12741822145413264
setupStore1390312110
uiStartup205429042281241116
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 45 Bytes (0.00%)
  • ui: 823 Bytes (0.01%)
  • common: 2.81 KiB (0.04%)

Copy link
Member

@andreahaku andreahaku left a comment

Choose a reason for hiding this comment

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

a few comments on the SensitiveText component

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Hey @jonybur, this is looking great! Could we pull out the SensitiveText component into its own PR for review? This way, we can ensure the docs, tests, and Storybook stories accurately reflect the component, making it more valuable for the rest of the org. Let me know if you have any questions or need support!

@metamaskbot
Copy link
Collaborator

Builds ready [8fc378a]
Page Load Metrics (2052 ± 128 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint41325781854492236
domContentLoaded170126311995242116
load171426542052267128
domInteractive1895492010
backgroundConnect9265495527
firstReactRender501981093517
getState5106262813
initialActions01000
loadScripts123321221494215103
setupStore1392292211
uiStartup191333022308361173
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 45 Bytes (0.00%)
  • ui: 823 Bytes (0.01%)
  • common: 3.33 KiB (0.04%)

@metamaskbot
Copy link
Collaborator

Builds ready [72198f0]
Page Load Metrics (2075 ± 71 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint18652527207215273
domContentLoaded18532470203914871
load18662478207514771
domInteractive338658199
backgroundConnect1078342211
firstReactRender691861143014
getState661232110
initialActions00000
loadScripts13411820151312359
setupStore1276292211
uiStartup20732826231117182
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 45 Bytes (0.00%)
  • ui: 1.27 KiB (0.02%)
  • common: 90 Bytes (0.00%)

github-merge-queue bot pushed a commit that referenced this pull request Oct 28, 2024
…28089)

## **Description**

This PR updates the Storybook stories for the `SensitiveText` component
to align with extension component library standards. The changes
include:

- Updating Storybook stories to use the CSF 3.0 format for better
organization and future-proofing.
- Converting `README.md` to `README.mdx`, leveraging Storybook stories
for documentation and improving the accessibility and usability of the
component documentation.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28089?quickstart=1)

## **Related issues**

Related: #28021

## **Manual testing steps**

1. Run Storybook locally and navigate to the `SensitiveText` component.
2. Verify that the stories render correctly in the CSF 3.0 format.
3. Check that the new `README.mdx` renders properly in the Storybook
Docs tab.

## **Screenshots/Recordings**

### **Before**



https://github.com/user-attachments/assets/e1804283-72d2-45e6-829b-e2ce38776e1e



### **After**



https://github.com/user-attachments/assets/5d776529-6fe3-4646-90f2-57f2ceceefd6



## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I’ve completed the PR template to the best of my ability.
- [x] I’ve included tests if applicable.
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable.
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I’ve manually tested the PR (e.g., pulled and built the branch,
ran the app, tested the code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria and
includes the necessary testing evidence, such as recordings or
screenshots.
@metamaskbot
Copy link
Collaborator

Builds ready [475a2d8]
Page Load Metrics (1883 ± 70 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16382230189014871
domContentLoaded16292142184712862
load16372238188314770
domInteractive157539168
backgroundConnect9111312813
firstReactRender46147842813
getState572202110
initialActions0482105
loadScripts11521642134312459
setupStore116826209
uiStartup18362498208016177
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 45 Bytes (0.00%)
  • ui: 1.27 KiB (0.02%)
  • common: 90 Bytes (0.00%)

gambinish
gambinish previously approved these changes Oct 29, 2024
Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Left one small comment!

ui/components/component-library/sensitive-text/README.md Outdated Show resolved Hide resolved
@metamaskbot
Copy link
Collaborator

Builds ready [ac9c738]
Page Load Metrics (1905 ± 60 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint17622292191212459
domContentLoaded17152279187612962
load17652296190512460
domInteractive197242157
backgroundConnect879322412
firstReactRender52129982010
getState57214189
initialActions01000
loadScripts12451738138311555
setupStore1075312512
uiStartup19402578211514469
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 45 Bytes (0.00%)
  • ui: 1.27 KiB (0.02%)
  • common: 90 Bytes (0.00%)

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 files owned by confirmation team look good 👍

@vinnyhoward vinnyhoward added this pull request to the merge queue Oct 30, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 30, 2024
@vinnyhoward vinnyhoward added this pull request to the merge queue Oct 30, 2024
@vinnyhoward vinnyhoward removed this pull request from the merge queue due to a manual request Oct 30, 2024
@vinnyhoward vinnyhoward added this pull request to the merge queue Oct 30, 2024
github-merge-queue bot pushed a commit that referenced this pull request Oct 30, 2024
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Adds a privacy mode toggle (an eye icon next to the main balance) that
hides all sensitive information/token balances

**UPDATE**
Here is feedback from @amandaye0h and has been currently implemented in
this PR

[Figma](https://www.figma.com/design/aMYisczaJyEsYl1TYdcPUL/Portfolio-View?node-id=6219-62460&t=aeTv5cenoUPUrg1c-4)

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28021?quickstart=1)

## **Related issues**

Fixes:
MetaMask/MetaMask-planning#3416
MetaMask/MetaMask-planning#3418
MetaMask/MetaMask-planning#3419

## **Manual testing steps**

1. Go to the Wallet page
2. Click on the new Eye icon next to the balance
3. All balances should be hidden
4. Click on the Eye icon once again
5. All balances should be shown

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**


https://github.com/user-attachments/assets/2950ac0c-593d-4daa-aa5d-3e6c3a2d5598


https://github.com/user-attachments/assets/6371c2a2-04fa-48a3-8744-991a1540d5f2

<img width="496" alt="Screenshot 2024-10-22 at 18 43 19"
src="https://github.com/user-attachments/assets/d7c2f681-75c7-4be0-921b-f3c5186f8d4a">



## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
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.

---------

Co-authored-by: vinnyhoward <vincenguyenhoward@gmail.com>
Co-authored-by: David Walsh <davidwalsh83@gmail.com>
@metamaskbot
Copy link
Collaborator

Builds ready [3d0eeda]
Page Load Metrics (1964 ± 65 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint17412194196113565
domContentLoaded16862169193213464
load17452197196413565
domInteractive13234544522
backgroundConnect891372512
firstReactRender44189973617
getState45714157
initialActions01000
loadScripts11441652142412158
setupStore1175362512
uiStartup18952396219315575
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 45 Bytes (0.00%)
  • ui: 1.27 KiB (0.02%)
  • common: 90 Bytes (0.00%)

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 30, 2024
salimtb pushed a commit that referenced this pull request Oct 30, 2024
…28089)

## **Description**

This PR updates the Storybook stories for the `SensitiveText` component
to align with extension component library standards. The changes
include:

- Updating Storybook stories to use the CSF 3.0 format for better
organization and future-proofing.
- Converting `README.md` to `README.mdx`, leveraging Storybook stories
for documentation and improving the accessibility and usability of the
component documentation.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28089?quickstart=1)

## **Related issues**

Related: #28021

## **Manual testing steps**

1. Run Storybook locally and navigate to the `SensitiveText` component.
2. Verify that the stories render correctly in the CSF 3.0 format.
3. Check that the new `README.mdx` renders properly in the Storybook
Docs tab.

## **Screenshots/Recordings**

### **Before**



https://github.com/user-attachments/assets/e1804283-72d2-45e6-829b-e2ce38776e1e



### **After**



https://github.com/user-attachments/assets/5d776529-6fe3-4646-90f2-57f2ceceefd6



## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I’ve completed the PR template to the best of my ability.
- [x] I’ve included tests if applicable.
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable.
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I’ve manually tested the PR (e.g., pulled and built the branch,
ran the app, tested the code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria and
includes the necessary testing evidence, such as recordings or
screenshots.
@darkwing darkwing added this pull request to the merge queue Oct 30, 2024
Merged via the queue into develop with commit 05da3f7 Oct 30, 2024
76 checks passed
@darkwing darkwing deleted the jb-privacy-mode branch October 30, 2024 13:24
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2024
@metamaskbot metamaskbot added the release-12.7.0 Issue or pull request that will be included in release 12.7.0 label Oct 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.7.0 Issue or pull request that will be included in release 12.7.0 team-wallet-ux
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

8 participants