From 266da0789c6797357d6dc9232b3ad32807a41a43 Mon Sep 17 00:00:00 2001 From: OGPoyraz Date: Thu, 24 Oct 2024 10:05:49 +0200 Subject: [PATCH 1/5] fix: Fix limited visibility of decrypt message (#27622) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** This PR aims to address UX issue where the extension displays only a limited portion of the entire message. Final designs could be find in this [Figma file](https://www.figma.com/design/aHdSNvg9ahXZMtThzz3bUo/Github-issues?node-id=645-1624&node-type=canvas&t=aesoQRhYJhITiGNv-0). And more information on: https://github.com/MetaMask/MetaMask-planning/issues/3002 It also adds scroll to bottom button to decrypt message pane. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27622?quickstart=1) ## **Related issues** Fixes: https://github.com/MetaMask/MetaMask-planning/issues/3002 ## **Manual testing steps** 1. Go to test-dapp 2. Use Encrypt / Decrypt section 3. Get encryption key 4. Then put long message to encrypt 5. Then decrypt that message by clicking "Decrypt" 6. Confirmation will appear, click decrpyt to see message in confirmation, and see your long message with "scroll to bottom" button ## **Screenshots/Recordings** ### **Before** Screenshot 2024-10-04 at 13 55 49 Screenshot 2024-10-04 at 13 55 57 ### **After** Screenshot 2024-10-04 at 13 52 05 Screenshot 2024-10-04 at 13 52 18 Screenshot 2024-10-04 at 13 52 23 ## **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. --- ...irm-decrypt-message.component.test.js.snap | 460 ++++++++------ .../confirm-decrypt-message.component.js | 592 +++++++++++------- .../confirm-decrypt-message.component.test.js | 330 +++++++--- .../confirm-decrypt-message.container.js | 76 --- .../confirm-decrypt-message.scss | 28 +- ui/pages/confirm-decrypt-message/index.js | 2 +- 6 files changed, 879 insertions(+), 609 deletions(-) delete mode 100644 ui/pages/confirm-decrypt-message/confirm-decrypt-message.container.js diff --git a/ui/pages/confirm-decrypt-message/__snapshots__/confirm-decrypt-message.component.test.js.snap b/ui/pages/confirm-decrypt-message/__snapshots__/confirm-decrypt-message.component.test.js.snap index cb4715881e27..d5e060e31d72 100644 --- a/ui/pages/confirm-decrypt-message/__snapshots__/confirm-decrypt-message.component.test.js.snap +++ b/ui/pages/confirm-decrypt-message/__snapshots__/confirm-decrypt-message.component.test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ConfirmDecryptMessage Component should match snapshot when preference is ETH currency 1`] = ` +exports[`ConfirmDecryptMessage Component matches snapshot 1`] = `
- -
-
- - -
-
-
-
- - - - -
@@ -189,7 +112,7 @@ exports[`ConfirmDecryptMessage Component should match snapshot when preference i
- 966.987986 ABC + 966.987986 ETH
@@ -210,35 +133,40 @@ exports[`ConfirmDecryptMessage Component should match snapshot when preference i
- {"domain":{"chainId":97,"name":"Ether Mail","verifyingContract":"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC","version":"1"},"message":{"contents":"Hello, Bob!","from":{"name":"Cow","wallets":["0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826","0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF"]},"to":[{"name":"Bob","wallets":["0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB","0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57","0xB0B0b0b0b0b0B000000000000000000000000000"]}]},"primaryType":"Mail","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Mail":[{"name":"from","type":"Person"},{"name":"to","type":"Person[]"},{"name":"contents","type":"string"}],"Person":[{"name":"name","type":"string"},{"name":"wallets","type":"address[]"}]}} - -
-
-
+ {"domain":{"chainId":97,"name":"Ether Mail","verifyingContract":"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC","version":"1"}} + +
+
+
-
- Decrypt message + +
+ Decrypt message +
+
-
+
+
+ Balance: +
+
+ 966.987986 ETH +
+
+
+
+
+ + T + +
+ test would like to read this message to complete your action +
+
+
+
+
+
+ + This message cannot be decrypted due to error: Decrypt inline error +
+
+
+
+ +
+ Decrypt message +
+
+
+
+
+
+
+ +
+
+`; + +exports[`ConfirmDecryptMessage Component shows the correct message data 1`] = ` +
+
+
+
+
+ Decrypt request +
+
+
+
+
+
+
@@ -472,35 +515,66 @@ exports[`ConfirmDecryptMessage Component should match snapshot when preference i
- {"domain":{"chainId":97,"name":"Ether Mail","verifyingContract":"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC","version":"1"},"message":{"contents":"Hello, Bob!","from":{"name":"Cow","wallets":["0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826","0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF"]},"to":[{"name":"Bob","wallets":["0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB","0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57","0xB0B0b0b0b0b0B000000000000000000000000000"]}]},"primaryType":"Mail","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Mail":[{"name":"from","type":"Person"},{"name":"to","type":"Person[]"},{"name":"contents","type":"string"}],"Person":[{"name":"name","type":"string"},{"name":"wallets","type":"address[]"}]}} - +
+ raw message + +
+
+
+
+ +
+ Decrypt message +
+
+
-
-
- Decrypt message +
+ Copy encrypted message +
+
-