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: design changes in signature paged message section #28038

Merged
merged 20 commits into from
Oct 24, 2024

Conversation

jpuri
Copy link
Contributor

@jpuri jpuri commented Oct 23, 2024

Description

Make message section in signature collapsible and add copy option.

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/3477

Manual testing steps

  1. Go to test dapp
  2. Submit signatures and check message section

Screenshots/Recordings

Screenshot 2024-10-23 at 5 27 35 PM

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.

@jpuri jpuri added the team-confirmations Push issues to confirmations team label Oct 23, 2024
@jpuri jpuri requested review from a team as code owners October 23, 2024 12:02
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.

@jpuri jpuri requested a review from a team as a code owner October 23, 2024 15:13
@metamaskbot
Copy link
Collaborator

Builds ready [c2aef7b]
Page Load Metrics (2103 ± 86 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint186428112123214103
domContentLoaded18532477207216378
load18622602210317986
domInteractive30110552211
backgroundConnect9136333115
firstReactRender542091163517
getState5178314120
initialActions01000
loadScripts13881902156814670
setupStore1274352412
uiStartup212832352366241116
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 695 Bytes (0.01%)
  • common: 22 Bytes (0.00%)

@@ -40,6 +40,7 @@ export type ConfirmInfoRowProps = {
copyEnabled?: boolean;
copyText?: string;
'data-testid'?: string;
collapsible?: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

Can we not re-use the existing ui/components/app/confirm/info/row/expandable-row.tsx?

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 designs are very different from expandable row.

alignItems={AlignItems.flexStart}
color={color}
>
<Box display={Display.Flex} alignItems={AlignItems.center}>
Copy link
Member

@matthewwalsh0 matthewwalsh0 Oct 24, 2024

Choose a reason for hiding this comment

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

Assuming this behaviour is different to the expandable row, while it's nice to add configuration to the core row, this adds a lot of logic and complexity, so would it be better to create an alternate component that potentially inherits the same properties of row? Or a wrapper component?

Or at the very least, should we break this very large schema up with local components?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changes are required in info row requires to support collapsible row, it is hard to only wrap into row and make it collapsible.

Copy link
Member

Choose a reason for hiding this comment

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

In that case, could we split this for readability into some local components (in this file) such as Container, CopyIcon, Tooltip, Content, CollapsibleIcon etc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, let me create a followup PR to do that, and avoid in this PR to change the scope here.

matthewwalsh0
matthewwalsh0 previously approved these changes Oct 24, 2024
matthewwalsh0
matthewwalsh0 previously approved these changes Oct 24, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [ac11fc3]
Page Load Metrics (2038 ± 77 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint17772408202816177
domContentLoaded17642368198216378
load17742416203815977
domInteractive19110532210
backgroundConnect1198542813
firstReactRender612861105326
getState764292311
initialActions01000
loadScripts12601701145512761
setupStore13106382713
uiStartup19742824230420599
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 1.16 KiB (0.02%)
  • common: 22 Bytes (0.00%)

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.

LGTM! 🚀

  • Checked collapse icon svg and that it renders in storybook correctly ✅
  • Checked collapse icon exists in Figma icon library for 1:1 match ✅
  • Did not check any other part of the code ❌

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="m422 64c5 0 9 2 13 5 7 8 7 19 0 26l-107 107 66 0c11 0 19 7 19 18 0 12-8 19-19 19l-110 0c-2 0-6 0-8-2-2 0-3-2-5-4-2-1-4-3-4-5-2-2-2-6-2-8l0-110c0-11 8-19 19-19 11 0 18 8 18 19l0 66 107-107c4-3 7-5 13-5z m-194 193l-110 0c-11 0-19 8-19 19 0 11 8 18 19 18l66 0-107 107c-7 7-7 19 0 26 8 7 19 7 26 0l107-107 0 66c0 11 7 19 18 19 11 0 19-8 19-19l0-110c0-2 0-6-2-8 0-1-2-3-4-5-2-2-3-4-5-4-2-2-6-2-8-2z"/></svg>
Copy link
Contributor

@georgewrmarshall georgewrmarshall Oct 24, 2024

Choose a reason for hiding this comment

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

Just pushed a commit to optimize the svg here. 44ec97d

Before

Screenshot 2024-10-24 at 8 40 34 AM

After

Screenshot 2024-10-24 at 8 40 54 AM

Checked in storybook

Screenshot 2024-10-24 at 8 39 53 AM

right: 0,
top: 2,
...style,
}}
onClick={handleClick}
Copy link
Contributor

@georgewrmarshall georgewrmarshall Oct 24, 2024

Choose a reason for hiding this comment

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

non-blocking: Is there any reason we aren't using the ButtonIcon component here? The current implementation has poor accessibility as it renders a span instead of a button, and it lacks an aria-label, making it inaccessible for screen reader users.

cc @matthewwalsh0

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 agree button icon is good idea. Let me create separate PR for this as it would need lot of snapshot updates in confirmation pages.

@jpuri jpuri enabled auto-merge October 24, 2024 15:58
@jpuri jpuri added this pull request to the merge queue Oct 24, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [44ec97d]
Page Load Metrics (1961 ± 101 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint35424421892412198
domContentLoaded15532431193019794
load156324431961209101
domInteractive23166613416
backgroundConnect9158323316
firstReactRender47304985325
getState486292914
initialActions01000
loadScripts11301954145317886
setupStore1083292110
uiStartup171027512212278133
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 1.16 KiB (0.02%)
  • common: 22 Bytes (0.00%)

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 24, 2024
@jpuri jpuri added this pull request to the merge queue Oct 24, 2024
Merged via the queue into develop with commit 1e55692 Oct 24, 2024
76 checks passed
@jpuri jpuri deleted the sig_message_changes branch October 24, 2024 17:20
@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 2024
@metamaskbot metamaskbot added the release-12.7.0 Issue or pull request that will be included in release 12.7.0 label Oct 24, 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-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants