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

Picker network updates #21301

Merged
merged 4 commits into from
Oct 13, 2023
Merged

Picker network updates #21301

merged 4 commits into from
Oct 13, 2023

Conversation

georgewrmarshall
Copy link
Contributor

@georgewrmarshall georgewrmarshall commented Oct 10, 2023

Description

In the new designs for Amon Hen the network picker(PickerNetwork) has been moved to inside of the tabs and needs to be full width. The current PickerNetwork requires some style updates to allow for this change

This PR updates the PickerNetwork component styles and props to allow for this updated design. It uses the pattern of inversion of control to allow for the label wrapper component to be accessed through a prop called labelProps. It also updates the unit tests to include coverage for this change as well as updates the documentation and stories to provide examples.

Manual testing steps

  1. Go to the storybook build of this PR
  2. Search PickerNetwork
  3. See that there are no visual regressions
  4. Check the updated documentation and Width story

Screenshots/Recordings

Before

before.mov

After

after.mov

Other instances of PickerNetwork without visual regressions

Screenshot 2023-10-10 at 10 29 55 PMScreenshot 2023-10-10 at 7 54 53 PM

Showing new-network-info modal with some deprecated components replaced and flex box added

Screenshot 2023-10-11 at 3 12 43 PM Screenshot 2023-10-10 at 9 53 33 PM Screenshot 2023-10-10 at 10 29 24 PM

Test coverage 100%
Screenshot 2023-10-10 at 6 41 48 PM

Related issues

https://github.com/MetaMask/metamask-extension/pull/21220/files#diff-afc7617dc1347d665d4f7a058e9ea8ac686f5ad520874a293f6e27e7c50f9568

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained:
    • What problem this PR is solving.
    • How this problem was solved.
    • How reviewers can test my changes.
  • I’ve indicated what issue this PR is linked to: Fixes #???
  • I’ve included tests if applicable.
  • I’ve documented any added code.
  • I’ve applied the right labels on the PR (see labeling guidelines).
  • 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.

@georgewrmarshall georgewrmarshall added the team-design-system All issues relating to design system in Extension label Oct 10, 2023
@georgewrmarshall georgewrmarshall self-assigned this Oct 10, 2023
@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.

@MaxwellDG
Copy link

@georgewrmarshall I take this as I should close #20825 #21051 and #21083. When this PR is completed I'll redo them to match the update

@georgewrmarshall georgewrmarshall removed their assignment Oct 10, 2023

export const DefaultStory = () => <NewNetworkInfo />;

DefaultStory.storyName = 'Default';
Copy link
Contributor Author

@georgewrmarshall georgewrmarshall Oct 10, 2023

Choose a reason for hiding this comment

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

Adding storybook file for new-network-info component for easy review and revision

Screenshot 2023-10-12 at 2 23 36 PM

Comment on lines 21 to 22
import Button from '../button';
import Popover from '../popover';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will replace these in another PR

@georgewrmarshall georgewrmarshall self-assigned this Oct 11, 2023
@georgewrmarshall georgewrmarshall force-pushed the picker-network-updates branch 2 times, most recently from f71e092 to 2532b37 Compare October 11, 2023 15:26
…el prop Text wrapper as well as removing the max width styles. Replacing some deprecated components in NewNetworkInfo modal
@@ -458,7 +458,7 @@ describe('Custom network', function () {
});
// verify network switched
const networkDisplayed = await driver.findElement({
tag: 'p',
tag: 'span',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the wrapping html element of the text from a p to span tag in the PickerNetwork

@@ -70,7 +70,7 @@ describe('Stores custom RPC history', function () {
'.networks-tab__add-network-form-footer .btn-primary',
);

await driver.findElement({ text: networkName, tag: 'p' });
await driver.findElement({ text: networkName, tag: 'span' });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the wrapping html element of the text from a p to span tag in the PickerNetwork

darkwing
darkwing previously approved these changes Oct 11, 2023
NidhiKJha
NidhiKJha previously approved these changes Oct 12, 2023
@georgewrmarshall georgewrmarshall dismissed stale reviews from NidhiKJha and darkwing via c2abed2 October 12, 2023 12:12
@@ -88,7 +88,7 @@ describe('Switch ethereum chain', function () {
await driver.switchToWindow(extension);

const currentNetworkName = await driver.findElement({
tag: 'p',
tag: 'span',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the wrapping html element of the text from a p to span tag in the PickerNetwork

@MaxwellDG
Copy link

MaxwellDG commented Oct 12, 2023

@georgewrmarshall I take this as I should close #20825 #21051 and #21083. When this PR is completed I'll redo them to match the update

@georgewrmarshall Do you agree? Should they be redone after these changes?

@georgewrmarshall georgewrmarshall marked this pull request as ready for review October 13, 2023 07:37
@georgewrmarshall georgewrmarshall requested a review from a team as a code owner October 13, 2023 07:37
@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (d6d324b) 68.61% compared to head (dbbf64e) 68.61%.
Report is 7 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #21301   +/-   ##
========================================
  Coverage    68.61%   68.61%           
========================================
  Files         1020     1020           
  Lines        40929    40929           
  Branches     10920    10920           
========================================
  Hits         28080    28080           
  Misses       12849    12849           
Files Coverage Δ
...omponent-library/picker-network/picker-network.tsx 100.00% <ø> (ø)
...components/ui/new-network-info/new-network-info.js 81.58% <ø> (ø)

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

@metamaskbot
Copy link
Collaborator

Builds ready [dbbf64e]
Page Load Metrics (1209 ± 391 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint841511072010
domContentLoaded691581012411
load8020581209815391
domInteractive691581012411
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: -11 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@georgewrmarshall georgewrmarshall merged commit 8646a76 into develop Oct 13, 2023
9 checks passed
@georgewrmarshall georgewrmarshall deleted the picker-network-updates branch October 13, 2023 08:46
@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2023
@metamaskbot metamaskbot added the release-11.5.0 Issue or pull request that will be included in release 11.5.0 label Oct 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.5.0 Issue or pull request that will be included in release 11.5.0 team-design-system All issues relating to design system in Extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants