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

UX: added badge status in account list #23006

Merged
merged 41 commits into from
Feb 27, 2024
Merged

UX: added badge status in account list #23006

merged 41 commits into from
Feb 27, 2024

Conversation

NidhiKJha
Copy link
Member

@NidhiKJha NidhiKJha commented Feb 16, 2024

This PR is to add badge status in the Account List

Related issues

Fixes: 1942

Manual testing steps

  1. Run extension using MULTICHAIN=1 yarn start
  2. Connect Metamask to a dapp
  3. Open extension in popup view
  4. Go to Accounts List
  5. Check the badge in accounts list

Screenshots/Recordings

Before

Screenshot 2024-02-19 at 2 28 09 PM

After

Popup View

Screenshot 2024-02-19 at 2 27 37 PM

Full Screen View

Screenshot 2024-02-19 at 2 28 44 PM

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • 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
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • 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.

@NidhiKJha NidhiKJha added team-wallet-ux needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. labels Feb 16, 2024
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Feb 16, 2024
) {
badgeBorderColor = BorderColor.successDefault;
badgeBackgroundColor = BackgroundColor.backgroundDefault;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we create a helper files in ui/helpers called connectivity.js where we have a few helper functions to re-use?

export function hasAnyAccountsConnected(accounts) {

}

export function getConnectivityColors(status) {
  // return { borderColor: '???', backgroundColor: '???' }
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Added this functionality in ConnectedStatus to separate the BadgeStatus here d8f85f2

@NidhiKJha NidhiKJha marked this pull request as ready for review February 19, 2024 15:27
@NidhiKJha NidhiKJha requested a review from a team as a code owner February 19, 2024 15:27
@metamaskbot
Copy link
Collaborator

Builds ready [071d4d5]
Page Load Metrics (1054 ± 50 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1132571903316
domContentLoaded12107482713
load8791233105410450
domInteractive12107482713
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 6.98 KiB (0.10%)
  • common: 53 Bytes (0.00%)

@darkwing darkwing changed the title (WIP 👷‍♀️ ) UX: added badge status in account list UX: added badge status in account list Feb 20, 2024
@darkwing darkwing self-assigned this Feb 20, 2024
@vthomas13 vthomas13 self-requested a review February 20, 2024 14:55
@@ -0,0 +1,87 @@
import React from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use typescript unless a compelling reason not to.

Copy link
Member Author

Choose a reason for hiding this comment

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

This component is used to set the color for the badge. I have converted the badge-status to ts. But if I try to convert this one to ts. It doesn't allow me to use the Color prop for BackgroundColor. And background color doesn't have this color by default. So, that's why kept this component in JS

Screenshot 2024-02-21 at 7 25 14 PM

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.

@darkwing
Copy link
Contributor

This is excellent work! Wow! Needs merge conflict updates but works great! Can we get a test here?

Base automatically changed from fix-1942 to develop February 22, 2024 10:12
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

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

Project coverage is 68.59%. Comparing base (05e267b) to head (58f9090).

Files Patch % Lines
...s/multichain/connected-status/connected-status.tsx 3.85% 25 Missing ⚠️
.../multichain/account-list-item/account-list-item.js 60.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #23006      +/-   ##
===========================================
- Coverage    68.60%   68.59%   -0.01%     
===========================================
  Files         1096     1097       +1     
  Lines        43251    43287      +36     
  Branches     11525    11538      +13     
===========================================
+ Hits         29670    29690      +20     
- Misses       13581    13597      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Collaborator

Builds ready [9584470]
Page Load Metrics (1778 ± 66 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1334732089345
domContentLoaded1097342110
load14851971177813766
domInteractive1097342110
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 6.66 KiB (0.10%)
  • common: 53 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [eae16e8]
Page Load Metrics (2827 ± 247 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint12265229111455
domContentLoaded18224754923
load185937152827514247
domInteractive18224754923
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 6.66 KiB (0.10%)
  • common: 53 Bytes (0.00%)

vthomas13
vthomas13 previously approved these changes Feb 23, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [78480d6]
Page Load Metrics (2371 ± 103 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint12544222910551
domContentLoaded127832178
load193527352371215103
domInteractive127832178
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 6.37 KiB (0.09%)
  • common: 53 Bytes (0.00%)

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.

A few tiny suggestions but this looks great!

);
};

ConnectedStatus.propTypes = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we define types instead?

ui/selectors/selectors.test.js Show resolved Hide resolved
@@ -1043,6 +1074,7 @@ describe('Selectors', () => {
balance: '0x0',
pinned: true,
hidden: false,
active: false,
Copy link
Member Author

Choose a reason for hiding this comment

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

I have updated the updated the test, by checking the active false. For the connected one, it's true else false

@metamaskbot
Copy link
Collaborator

Builds ready [58f9090]
Page Load Metrics (906 ± 399 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint751921083014
domContentLoaded1085282010
load641885906831399
domInteractive1085282010
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 6.18 KiB (0.09%)
  • common: 53 Bytes (0.00%)

@NidhiKJha NidhiKJha merged commit da7721b into develop Feb 27, 2024
66 checks passed
@NidhiKJha NidhiKJha deleted the fix-1942-b branch February 27, 2024 08:57
@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2024
@metamaskbot metamaskbot added the release-11.13.0 Issue or pull request that will be included in release 11.13.0 label Feb 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. release-11.13.0 Issue or pull request that will be included in release 11.13.0 team-wallet-ux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants