metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

refactor(snap-keyring): better UI messages

Open ccharly opened this issue 1 year ago • 1 comments

Description

Refactor and generalize success/error messages being used in the Snap-Keyring "adapter". This refactoring will ease additions of new metrics for Snap account management (future PR).

Related issues

Fixes: N/A

Manual testing steps

  1. Build and runs with yarn start:flask
  2. Use this test dapp: https://metamask.github.io/snap-simple-keyring/latest/
  3. Do each operations like create/remove an account.

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • [x] I’ve followed MetaMask Coding Standards.
  • [x] I've clearly explained what problem this PR is solving and how it is solved.
  • [ ] I've linked related issues
  • [x] I've included manual testing steps
  • [ ] I've included screenshots/recordings if applicable
  • [ ] I’ve included tests if applicable
  • [ ] I’ve documented my code using JSDoc format if applicable
  • [x] I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • [x] I’ve properly set the pull request status:
    • [x] In case it's not yet "ready for review", I've set it to "draft".
    • [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

ccharly avatar Feb 16 '24 16:02 ccharly

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.

github-actions[bot] avatar Feb 16 '24 16:02 github-actions[bot]

Codecov Report

Attention: Patch coverage is 28.00000% with 18 lines in your changes are missing coverage. Please review.

Project coverage is 68.65%. Comparing base (61a79e0) to head (2137ce4).

Files Patch % Lines
app/scripts/lib/snap-keyring/snap-keyring.ts 16.67% 10 Missing :warning:
app/scripts/lib/snap-keyring/utils/showResult.ts 37.50% 5 Missing :warning:
app/scripts/lib/snap-keyring/utils/getSnapName.ts 40.00% 3 Missing :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #23007      +/-   ##
===========================================
- Coverage    68.65%   68.65%   -0.00%     
===========================================
  Files         1098     1100       +2     
  Lines        43185    43197      +12     
  Branches     11532    11532              
===========================================
+ Hits         29647    29655       +8     
- Misses       13538    13542       +4     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 19 '24 09:02 codecov[bot]

Builds ready [72a75f2]
Page Load Metrics (1011 ± 39 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1352732043919
domContentLoaded1599402813
load890119510118039
domInteractive1599402813
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -645 Bytes (-0.02%)
  • ui: 4.71 KiB (0.07%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar Feb 19 '24 09:02 metamaskbot

I have read the CLA Document and I hereby sign the CLA

ccharly avatar Feb 19 '24 09:02 ccharly

Builds ready [7504d02]
Page Load Metrics (954 ± 64 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1134042006632
domContentLoaded985292412
load820149495413364
domInteractive985292412
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -645 Bytes (-0.02%)
  • ui: 4.71 KiB (0.07%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar Feb 19 '24 09:02 metamaskbot

Builds ready [ac743a4]
Page Load Metrics (1787 ± 56 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1184171967938
domContentLoaded17144383115
load15822102178711756
domInteractive17144383115
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -645 Bytes (-0.02%)
  • ui: 4.63 KiB (0.07%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar Feb 22 '24 16:02 metamaskbot

Builds ready [5124640]
Page Load Metrics (1937 ± 88 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint11770022314369
domContentLoaded117831199
load16802364193718388
domInteractive117831199
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 505 Bytes (0.01%)
  • ui: 4.66 KiB (0.07%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar Feb 23 '24 10:02 metamaskbot

Builds ready [f9f11e8]
Page Load Metrics (1845 ± 68 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1224101786330
domContentLoaded138535178
load15292074184514168
domInteractive138535178
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 505 Bytes (0.01%)
  • ui: 4.66 KiB (0.07%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar Feb 23 '24 13:02 metamaskbot

Builds ready [d29b107]
Page Load Metrics (1300 ± 381 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint732471233517
domContentLoaded147131168
load5919421300793381
domInteractive147130168
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 505 Bytes (0.01%)
  • ui: 4.66 KiB (0.07%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar Feb 27 '24 15:02 metamaskbot

Builds ready [d4fa44b]
Page Load Metrics (1054 ± 422 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint631771183115
domContentLoaded108131199
load5921321054879422
domInteractive108131199
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 505 Bytes (0.01%)
  • ui: 4.89 KiB (0.07%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar Feb 27 '24 18:02 metamaskbot

Builds ready [67ee5de]
Page Load Metrics (1036 ± 378 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint652021263818
domContentLoaded1074382411
load5319101036787378
domInteractive1074382411
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 505 Bytes (0.01%)
  • ui: 4.89 KiB (0.07%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar Feb 28 '24 15:02 metamaskbot

Interesting, I was not aware of that convention. Now that I think about it, having a more imperative tone in the test name does have a better ring to it. I'd push to take @danroc suggestion but I don't see it as blocker for this PR

gantunesr avatar Feb 29 '24 19:02 gantunesr

Builds ready [2137ce4]
Page Load Metrics (1220 ± 355 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint672391364421
domContentLoaded987352512
load5418501220739355
domInteractive987352512
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 505 Bytes (0.01%)
  • ui: 4.89 KiB (0.07%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar Mar 01 '24 14:03 metamaskbot