feat: add popular network list modal#25160
Conversation
|
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. |
Builds ready [a902473]
Page Load Metrics (49 ± 5 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #25160 +/- ##
===========================================
+ Coverage 65.59% 65.61% +0.02%
===========================================
Files 1362 1364 +2
Lines 54167 54209 +42
Branches 14167 14181 +14
===========================================
+ Hits 35527 35565 +38
- Misses 18640 18644 +4 ☔ View full report in Codecov by Sentry. |
60fd8c1 to
3dc3324
Compare
Builds ready [3dc3324]
Page Load Metrics (58 ± 4 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
darkwing
left a comment
There was a problem hiding this comment.
Functionally this works great!
...s/multichain/network-list-menu/network-confirmation-popover/network-confirmation-popover.tsx
Outdated
Show resolved
Hide resolved
...s/multichain/network-list-menu/network-confirmation-popover/network-confirmation-popover.tsx
Outdated
Show resolved
Hide resolved
...s/multichain/network-list-menu/network-confirmation-popover/network-confirmation-popover.tsx
Show resolved
Hide resolved
ui/components/multichain/network-list-menu/network-list-menu.js
Outdated
Show resolved
Hide resolved
ui/components/multichain/network-list-menu/network-list-menu.js
Outdated
Show resolved
Hide resolved
ui/components/multichain/network-list-menu/network-list-menu.js
Outdated
Show resolved
Hide resolved
ui/components/multichain/network-list-menu/popular-network-list/popular-network-list.tsx
Outdated
Show resolved
Hide resolved
ui/components/multichain/network-list-menu/popular-network-list/popular-network-list.tsx
Outdated
Show resolved
Hide resolved
darkwing
left a comment
There was a problem hiding this comment.
Sorry, requested a few changes
0a16f10 to
7e13f90
Compare
Builds ready [7e13f90]
Page Load Metrics (46 ± 4 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| variant={ButtonVariant.Link} | ||
| data-testid="test-add-button" | ||
| onClick={async () => { | ||
| dispatch(toggleNetworkMenu()); |
There was a problem hiding this comment.
Let's do this call second so that it disappears in the background instead of before the requestUserApproval finishes.
There was a problem hiding this comment.
eeem i think we will have a problem if we do it that way, The issue arises because requestUserApproval is an asynchronous function. When we use await requestUserApproval(), the execution pauses, waiting for the user to either approve or reject through the confirmation modal. This means the promise stays in a pending state until the user interacts with the "add network" confirmation modal, which is triggered by requestUserApproval. However, there's a complication: our modal ends up obscuring the confirmation modal because dispatch(toggleNetworkMenu()); is called after, not before, this interaction. As a result, from a functional standpoint, we encounter a problem where the user might not be able to see or interact with the confirmation modal as intended.
ui/components/multichain/network-list-menu/popular-network-list/popular-network-list.tsx
Outdated
Show resolved
Hide resolved
496f89c to
6eb16ed
Compare
6eb16ed to
dcf526b
Compare
dcf526b to
2a850e0
Compare
Builds ready [2a850e0]
Page Load Metrics (121 ± 158 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [b59b7e8]
Page Load Metrics (46 ± 2 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
bergeron
left a comment
There was a problem hiding this comment.
Worked for me locally, looks good
| const networkConfigurationChainIds = Object.values(networkConfigurations).map( | ||
| (net) => net.chainId, | ||
| ); | ||
|
|
||
| const sortedFeaturedNetworks = FEATURED_RPCS.sort((a, b) => | ||
| a.nickname > b.nickname ? 1 : -1, | ||
| ).slice(0, FEATURED_RPCS.length); | ||
|
|
||
| const notExistingNetworkConfigurations = sortedFeaturedNetworks.filter( | ||
| ({ chainId }) => !networkConfigurationChainIds.includes(chainId), | ||
| ); |
There was a problem hiding this comment.
maybe stuff that could be memoized with useMemo to avoid recalculating when unrelated stuff changes. For example, dragging networks to a different order will re-render this component, but shouldn't change this calculation.
Description
This PR introduces the addition of a Popular Networks list to the Add Network modal.
Related issues
Fixes:
Manual testing steps
yarn && ENABLE_NETWORK_UI_REDESIGN=1 yarn startScreenshots/Recordings
Before
before.mov
After
before-search.mov
Pre-merge author checklist
Pre-merge reviewer checklist