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

Choose accounts refactor #13039

Merged
merged 30 commits into from Dec 14, 2021
Merged

Choose accounts refactor #13039

merged 30 commits into from Dec 14, 2021

Conversation

hmalik88
Copy link
Contributor

@hmalik88 hmalik88 commented Dec 9, 2021

Related to: Snaps Installation UI issue

Background Updates: Fixes to subjectMetadata were made to include the origin. An "unknown" subject type was added and integrated into the useOriginMetadata hook. Background updates are being made in this PR instead of a separate one, because in interest of time, the changes are relevant to this UI and because there aren't a significant number of changes.

UI Explanation: Flask designs (Figma) updated the ChooseAccount screen to have a bolded title and black subtitle. The account list was refactored into its own component (AccountList) in an effort to tidy up ChooseAccount. A wrapper div was added around the account list to prevent storybook from collapsing the div. ChooseAccount was also converted to a functional component. Following pics are of the collapsed account list in storybook before the wrapper, a before of it functioning and after of when the styles/text were updated:

Screen Shot 2021-12-09 at 3 08 31 PM

Screen Shot 2021-12-08 at 3 00 41 PM

Screen Shot 2021-12-09 at 2 45 45 PM

Note: ChooseAccount will be updated in the future to change the choose accounts text to conditionally end with either "site" or "snap" when snaps supports eth_requestAccounts.

Manual testing steps:

  • Start storybook
  • Navigate to ChooseAccount
  • Additionally, you may run yarn start, load the extension into chrome, navigate to a dapp (i.e. Aave) and connect to MetaMask.

@hmalik88 hmalik88 requested a review from a team as a code owner December 9, 2021 20:14
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2021

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.

@metamaskbot
Copy link
Collaborator

Builds ready [ccfa4a8]
Page Load Metrics (1015 ± 42 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint591193483453217
domContentLoaded928122610138943
load928122610158842
domInteractive928122510138943

highlights:

storybook

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.

UI looks good. There are a few rogue values here that don't adhere to the 8px grid convention but I think this is the UI that I myself tried to refactor and had a very hard time as the different components effect the layout of different pages. So for the sake of keeping things consistent. I'm happy to approve.

Copy link
Contributor

@darkwing darkwing left a comment

Choose a reason for hiding this comment

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

Very well done, just a few nits!

ui/components/ui/account-list/account-list.js Outdated Show resolved Hide resolved
flex: 0;
margin-top: 36px;
width: 100%;
padding-left: 15px;
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 use padding-inline-start and padding-inline-end for better RTL support.

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 use margin-inline-start and margin-inline-end elsewhere in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed up some changes, please let me know if that works.

@georgewrmarshall
Copy link
Contributor

One thing that's not apart of this PR but might be a good change is if we use sentence case for "Connect with MetaMask" in app/_locales/en/messages.json

app/_locales/en/messages.json Outdated Show resolved Hide resolved
@metamaskbot
Copy link
Collaborator

Builds ready [f52d5a7]
Page Load Metrics (977 ± 16 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint631040383396190
domContentLoaded93010469763316
load93010469773316
domInteractive93010469763316

highlights:

storybook

@metamaskbot
Copy link
Collaborator

Builds ready [f52d5a7]
Page Load Metrics (1071 ± 35 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint641255605478230
domContentLoaded931126310697436
load940126410717435
domInteractive931126310697436

highlights:

storybook

@metamaskbot
Copy link
Collaborator

Builds ready [91e7c4b]
Page Load Metrics (1134 ± 30 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint711263403459220
domContentLoaded1051127011336330
load1051127011346330
domInteractive1051126911336330

highlights:

storybook

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.

Looks like isn't receiving the correct data after the refactor.

Testing on E2E Test Dapp

Screen Shot 2021-12-14 at 9 23 15 AM

Screen Shot 2021-12-14 at 9 25 09 AM

Tested on uniwap as well
Screen Shot 2021-12-14 at 9 25 38 AM
Screen Shot 2021-12-14 at 9 25 54 AM

@metamaskbot
Copy link
Collaborator

Builds ready [ab59b4a]
Page Load Metrics (1191 ± 46 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint671340405485233
domContentLoaded1067139611909546
load1067139611919546
domInteractive1067139611909546

highlights:

storybook

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!

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!

@metamaskbot
Copy link
Collaborator

Builds ready [2d38d99]
Page Load Metrics (1167 ± 51 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint691363488492236
domContentLoaded10681417116610751
load10681417116710751
domInteractive10681417116610751

highlights:

storybook

Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

LGTM!

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

@darkwing
Copy link
Contributor

Wow, really excellent work @hmalik88 !

@hmalik88 hmalik88 merged commit f946c03 into develop Dec 14, 2021
@hmalik88 hmalik88 deleted the choose-accounts-refactor branch December 14, 2021 23:54
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2021
@metamaskbot
Copy link
Collaborator

Builds ready [262edb2]
Page Load Metrics (1232 ± 62 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint681492573550264
domContentLoaded10411494123212861
load10411501123212862
domInteractive10411494123212861

highlights:

storybook

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants