Skip to content

Conversation

@jonybur
Copy link
Contributor

@jonybur jonybur commented Mar 1, 2024

Description

Implements the 'Switch to this account' and the 'Disconnect' buttons on the ConnectedAccountsMenu panel.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2172

Manual testing steps

  1. Connect two accounts to a dApp
  2. Open the Connected Accounts menu panel
  3. Switch between the accounts
  4. Disconnect an account

Screenshots/Recordings

vid1.mp4
switch2.mp4

Before

After

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.

@jonybur jonybur requested review from a team, brad-decker and kumavis as code owners March 1, 2024 04:00
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2024

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.

@jonybur jonybur added the team-core-extension-ux Core Extension UX team label Mar 1, 2024
@jonybur jonybur marked this pull request as draft March 1, 2024 04:00
Base automatically changed from fix-account-menu to develop March 4, 2024 08:10
@jonybur jonybur marked this pull request as ready for review March 4, 2024 12:51
@jonybur jonybur added the needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. label Mar 4, 2024
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.

Great work @jonybur Left some suggestions but overall looks great!
Can we add a condition to not show switch to this account option when there is only one account connected?
Screenshot 2024-03-04 at 7 21 17 PM

@@ -0,0 +1,8 @@
@use "design-system";
Copy link
Member

Choose a reason for hiding this comment

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

Do we need 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.

My understanding is that it is needed for this line:
z-index: design-system.$popover-in-modal-z-index;

@NidhiKJha NidhiKJha removed the request for review from brad-decker March 4, 2024 13:52
…ounts-menu.tsx

Co-authored-by: Nidhi Kumari <nidhi.kumari@consensys.net>
@jonybur jonybur requested a review from NidhiKJha March 4, 2024 14:08
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.

Almost there! Just some small nits

isOpen,
identity,
anchorElement,
disableAccountSwitcher,
Copy link
Member

Choose a reason for hiding this comment

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

By default this should be false?

identity={identity}
onClose={() => setAccountOptionsMenuOpen(false)}
closeMenu={closeMenu}
disableAccountSwitcher={accountsCount === 1}
Copy link
Member

Choose a reason for hiding this comment

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

Hmmm...Do you think we should create a separate variable for this?

@metamaskbot
Copy link
Collaborator

Builds ready [d5e445c]
Page Load Metrics (1245 ± 364 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint852391333818
domContentLoaded1083392411
load7118911245759364
domInteractive1083392411
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 944 Bytes (0.01%)
  • common: 0 Bytes (0.00%)

@codecov
Copy link

codecov bot commented Mar 5, 2024

Codecov Report

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

Project coverage is 68.68%. Comparing base (c249bd8) to head (903f702).
Report is 1 commits behind head on develop.

Files Patch % Lines
...onnected-accounts-menu/connected-accounts-menu.tsx 42.86% 12 Missing ⚠️
.../multichain/account-list-item/account-list-item.js 50.00% 2 Missing ⚠️
...nents/multichain/pages/connections/connections.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #23258      +/-   ##
===========================================
- Coverage    68.70%   68.68%   -0.01%     
===========================================
  Files         1102     1102              
  Lines        43221    43246      +25     
  Branches     11558    11566       +8     
===========================================
+ Hits         29691    29702      +11     
- Misses       13530    13544      +14     

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

NidhiKJha
NidhiKJha previously approved these changes Mar 5, 2024
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.

LGTM

darkwing
darkwing previously approved these changes Mar 5, 2024
@jonybur jonybur dismissed stale reviews from darkwing and NidhiKJha via fa44bb3 March 5, 2024 16:07
@metamaskbot
Copy link
Collaborator

Builds ready [903f702]
Page Load Metrics (1069 ± 474 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint991981362612
domContentLoaded87433178
load8924851069987474
domInteractive87433178
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 1.13 KiB (0.02%)
  • common: 0 Bytes (0.00%)

@jonybur jonybur merged commit b110819 into develop Mar 7, 2024
@jonybur jonybur deleted the fix-2172 branch March 7, 2024 13:10
@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2024
@metamaskbot metamaskbot added the release-11.14.0 Issue or pull request that will be included in release 11.14.0 label Mar 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. release-11.14.0 Issue or pull request that will be included in release 11.14.0 team-core-extension-ux Core Extension UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants