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

Upgrading the Import Account modal #17763

Merged
merged 14 commits into from
Mar 6, 2023

Conversation

HowardBraham
Copy link
Contributor

@HowardBraham HowardBraham commented Feb 15, 2023

When fixing these issues, I also tried to accomplish the following:

  • Use the Design System
  • Follow DRY principles (code length was reduced by 166 lines while adding more functionality)
  • Convert to React Hooks
  • Don't use Redux where it's not necessary

Fixes #16895 and #17719.
New error messages are in messages.json and are:

"You have entered a Secret Recovery Phrase (or mnemonic). To import an account here, you have to enter a private key, which is a hexadecimal string of length 64."

"This is not a valid private key. You have entered a hexadecimal string, but it must be 64 characters long."

"This is not a valid private key. You must enter a hexadecimal string of length 64."

Also helps with expectations around this multi-minute freeze when importing a JSON file #10113

image

@github-actions
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.

@HowardBraham HowardBraham changed the title Upgrade to Import Account modal Upgrading the Import Account modal Feb 15, 2023
@HowardBraham HowardBraham self-assigned this Feb 15, 2023
@HowardBraham HowardBraham force-pushed the fix/import-account-error-messages branch 2 times, most recently from 36be5bc to 2846570 Compare February 17, 2023 00:06
@HowardBraham HowardBraham marked this pull request as ready for review February 17, 2023 00:07
@HowardBraham HowardBraham requested a review from a team as a code owner February 17, 2023 00:07
@HowardBraham HowardBraham force-pushed the fix/import-account-error-messages branch 3 times, most recently from 87a1638 to e791d40 Compare February 22, 2023 04:04
@codecov-commenter
Copy link

codecov-commenter commented Feb 22, 2023

Codecov Report

Merging #17763 (9804d14) into develop (90ae498) will increase coverage by 0.07%.
The diff coverage is 29.63%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff             @@
##           develop   #17763      +/-   ##
===========================================
+ Coverage    62.96%   63.03%   +0.07%     
===========================================
  Files          909      910       +1     
  Lines        35419    35391      -28     
  Branches      8964     8964              
===========================================
+ Hits         22300    22308       +8     
+ Misses       13119    13083      -36     
Impacted Files Coverage Δ
.../components/app/asset-list-item/asset-list-item.js 66.67% <ø> (ø)
...mponent-library/form-text-field/form-text-field.js 71.43% <ø> (ø)
...omponents/component-library/help-text/help-text.js 89.47% <ø> (ø)
...i/pages/create-account/create-account.component.js 0.00% <0.00%> (ø)
...es/create-account/import-account/bottom-buttons.js 0.00% <0.00%> (ø)
...es/create-account/import-account/import-account.js 0.00% <0.00%> (ø)
ui/pages/create-account/import-account/json.js 0.00% <0.00%> (ø)
...pages/create-account/import-account/private-key.js 0.00% <0.00%> (ø)
ui/store/actions.ts 39.34% <40.91%> (-0.07%) ⬇️
app/scripts/account-import-strategies/index.js 92.86% <84.21%> (-4.20%) ⬇️
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@NidhiKJha NidhiKJha left a comment

Choose a reason for hiding this comment

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

Looking really good. Left a couple of UI suggestions

ui/pages/create-account/new-account.stories.js Outdated Show resolved Hide resolved
ui/pages/create-account/import-account/index.js Outdated Show resolved Hide resolved
ui/pages/create-account/import-account/index.js Outdated Show resolved Hide resolved
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.

This is looking great! I've made a few suggestions in #17905 - it requires a rebase of develop on this PR to see the changes effectively

ui/pages/create-account/import-account/bottom-buttons.js Outdated Show resolved Hide resolved
app/scripts/account-import-strategies/index.js Outdated Show resolved Hide resolved
ui/pages/create-account/import-account/index.js Outdated Show resolved Hide resolved
@HowardBraham HowardBraham force-pushed the fix/import-account-error-messages branch 5 times, most recently from 082b4f4 to 9804d14 Compare March 1, 2023 05:54
@MetaMask MetaMask deleted a comment from metamaskbot Mar 1, 2023
@MetaMask MetaMask deleted a comment from metamaskbot Mar 1, 2023
@MetaMask MetaMask deleted a comment from metamaskbot Mar 1, 2023
@MetaMask MetaMask deleted a comment from metamaskbot Mar 1, 2023
@MetaMask MetaMask deleted a comment from metamaskbot Mar 1, 2023
@HowardBraham HowardBraham force-pushed the fix/import-account-error-messages branch from 9804d14 to c2925f3 Compare March 2, 2023 04:56
@HowardBraham HowardBraham force-pushed the fix/import-account-error-messages branch from c2925f3 to abbfb03 Compare March 2, 2023 05:26
@metamaskbot
Copy link
Collaborator

Builds ready [abbfb03]
Page Load Metrics (1598 ± 52 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint95138115126
domContentLoaded1305178715639948
load13051792159810852
domInteractive1305178715639948
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 433 bytes
  • ui: -122982 bytes
  • common: 121374 bytes

@MetaMask MetaMask deleted a comment from metamaskbot Mar 2, 2023
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.

This is looking fantastic! Left some small suggestions. Also not sure about the invisible character but would like to get further opinions

@@ -103,7 +103,6 @@ export const FormTextField = ({
/>
{helpText && (
<HelpText
error={error}
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh thank you! Have a PR here for this #17939

ui/components/component-library/text/text.constants.js Outdated Show resolved Hide resolved
ui/pages/create-account/import-account/import-account.js Outdated Show resolved Hide resolved
ui/pages/create-account/import-account/bottom-buttons.js Outdated Show resolved Hide resolved
@HowardBraham HowardBraham force-pushed the fix/import-account-error-messages branch from ee95fc8 to 4ff6bfc Compare March 3, 2023 05:19
@metamaskbot
Copy link
Collaborator

Builds ready [7d70de3]
Page Load Metrics (1581 ± 45 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint98152118147
domContentLoaded1294171615378641
load1295171615819445
domInteractive1294171615378641
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 433 bytes
  • ui: -122984 bytes
  • common: 121374 bytes

const dispatch = useDispatch();

return (
<Box display={DISPLAY.FLEX}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<Box display={DISPLAY.FLEX}>
<Box display={DISPLAY.FLEX} gap={4}>

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 fixed this in a previous commit, I'm not sure how it came back 🤔

@metamaskbot
Copy link
Collaborator

Builds ready [104d553]
Page Load Metrics (1598 ± 59 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint99156120157
domContentLoaded13351819157612058
load13351819159812359
domInteractive13351819157612058
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 433 bytes
  • ui: -123030 bytes
  • common: 121374 bytes

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! 🚀

@HowardBraham HowardBraham merged commit 694773f into develop Mar 6, 2023
@HowardBraham HowardBraham deleted the fix/import-account-error-messages branch March 6, 2023 17:48
@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In the Import Account -> Private Key screen, error messages are confusing and unhelpful
7 participants