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

Replace ActionableMessage components with BannerAlerts in SIWE Sign-in with Ethereum page #18207

Merged

Conversation

digiwand
Copy link
Contributor

@digiwand digiwand commented Mar 16, 2023

Explanation

Fixes #18206

  • .mm-icon Icon component uses a element which was not supported by ActionableMessage
  • Replace SIWE ActionableMessage usage with BannerAlert
    • text in alerts are slightly larger due to the change
  • Add @deprecate jsdoc comment to ActionableMessage

Screenshots/Screencaps

Before (v10.26.1)

(actually, the icon locations were temp fixed in this hotfix #18200 just before this PR.)
Screen Shot 2023-03-16 at 4 49 31 PM
Screen Shot 2023-03-17 at 11 07 27 AM

After

Screen Shot 2023-03-17 at 10 31 51 AM

Screen Shot 2023-03-17 at 11 16 44 AM

Manual Testing Steps

Login to the extension
Navigate to the test dapp
Click Sign In With Ethereum (Bad Account)
Scroll to the bottom and observe the warning
Check other ActionableMessage components

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@digiwand digiwand requested a review from a team as a code owner March 16, 2023 23:53
@digiwand digiwand requested a review from ryanml March 16, 2023 23:53
@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.

@digiwand digiwand changed the base branch from develop to fix-siwe-unblock-mismatch-domain-with-warning-ui March 16, 2023 23:55
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.

We could deprecate ActionableMessage for BannerAlert would it be possible to add a deprecation message above the component as well as this fix?

in ui/components/ui/actionable-message/actionable-message.js

/**
 * @deprecated `<ActionableMessage />` has been deprecated in favour of the `<BannerAlert />` component in ./ui/components/component-library/banner-alert/banner-alert.js
 *
 * See storybook documentation for Text here https://metamask.github.io/metamask-storybook/?path=/docs/components-componentlibrary-banneralert--default-story#banneralert
 *
 * Help to replace `ActionableMessage` with `BannerAlert` by submitting a PR
 */

Screenshot 2023-03-16 at 5 24 28 PM

Screenshot 2023-03-16 at 5 24 58 PM

@metamaskbot
Copy link
Collaborator

Builds ready [e65a1a1]
Page Load Metrics (1670 ± 65 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint963141304521
domContentLoaded14321887162510952
load15001934167013665
domInteractive14321887162510952
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -176 bytes
  • ui: 19 bytes
  • common: 0 bytes

Base automatically changed from fix-siwe-unblock-mismatch-domain-with-warning-ui to develop March 17, 2023 17:36
@digiwand
Copy link
Contributor Author

Thanks @georgewrmarshall! BannerAlerts are looking much better in the UI and code 👍 I added the deprecation warning to the ActionableMessage component

@metamaskbot
Copy link
Collaborator

Builds ready [893ee6f]
Page Load Metrics (1596 ± 35 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint100173121188
domContentLoaded1472168515836531
load1472176615967335
domInteractive1472168515836531
Bundle size diffs
  • background: 0 bytes
  • ui: -518 bytes
  • common: 0 bytes

@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Merging #18207 (d7ab254) into develop (1d5e8a7) will increase coverage by 0.21%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop   #18207      +/-   ##
===========================================
+ Coverage    64.01%   64.22%   +0.21%     
===========================================
  Files          918      918              
  Lines        35310    35310              
  Branches      8993     8993              
===========================================
+ Hits         22602    22675      +73     
+ Misses       12708    12635      -73     
Impacted Files Coverage Δ
...onents/ui/actionable-message/actionable-message.js 82.22% <ø> (ø)
...p/signature-request-siwe/signature-request-siwe.js 67.39% <100.00%> (+65.22%) ⬆️

... and 6 files with indirect coverage changes

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

@metamaskbot
Copy link
Collaborator

Builds ready [c627db5]
Page Load Metrics (1791 ± 78 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1062491352914
domContentLoaded15032114178215976
load15032114179116278
domInteractive15032114178215976
Bundle size diffs
  • background: 0 bytes
  • ui: -518 bytes
  • common: 0 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.

Looking great! One small suggestion

Comment on lines 120 to 123
<Text variant={TextVariant.bodyMdBold}>
{t('SIWEDomainInvalidTitle')}
</Text>{' '}
<Text variant={TextVariant.bodyMd}>{t('SIWEDomainInvalidText')}</Text>
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to DS team to allow for ` tags cc @garrettbear so we could do something like

<Text>
  <strong>{t('SIWEDomainInvalidTitle')}</strong> {t('SIWEDomainInvalidText')}
</Text>

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! Just need to fix a linting issue that was probably introduced by my suggestions apologies!

@digiwand digiwand dismissed a stale review via de6a131 March 20, 2023 19:30
@digiwand
Copy link
Contributor Author

Thanks @georgewrmarshall! fixed de6a131

@digiwand digiwand changed the title ActionableMessage component styles do not support Icon component (.mm-icon) Replace ActionableMessage components with BannerAlerts in SIWE Sign-in with Ethereum page Mar 20, 2023
@metamaskbot
Copy link
Collaborator

Builds ready [d7ab254]
Page Load Metrics (1602 ± 57 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint98136115126
domContentLoaded14241854157810852
load14241854160211857
domInteractive14241854157810852
Bundle size diffs
  • background: 0 bytes
  • ui: -502 bytes
  • common: 0 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! 🚀

@digiwand digiwand merged commit 5e3770e into develop Mar 21, 2023
@digiwand digiwand deleted the update-siwe-actionable-msg-and-support-mm-icon-in-icon-comp branch March 21, 2023 16:49
@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] ActionableMessage component styles do not support Icon component (.mm-icon)
5 participants