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

feat: adding / deleting additional RPC URLs #25452

Merged
merged 16 commits into from
Jun 28, 2024

Conversation

bergeron
Copy link
Contributor

@bergeron bergeron commented Jun 20, 2024

Description

Initial UI for adding and deleting multiple RPC URLs. The add and delete buttons don't do anything yet. Just UI until the network controller gets upgraded.

Open in GitHub Codespaces

Related issues

Manual testing steps

  1. Build with ENABLE_NETWORK_UI_REDESIGN=1 yarn start
  2. Open networks, right click edit one
  3. Click RPC dropdown
  4. Add and delete RPC endpoints

Screenshots/Recordings

Before

After

Screen.Recording.2024-06-21.at.1.26.25.PM.mov

Pre-merge author checklist

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.

@bergeron bergeron changed the base branch from develop to edit-custom-network-flow June 20, 2024 19:45
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.

Base automatically changed from edit-custom-network-flow to develop June 21, 2024 14:50
@bergeron bergeron marked this pull request as ready for review June 21, 2024 20:25
@bergeron bergeron requested a review from a team as a code owner June 21, 2024 20:25
@bergeron bergeron added the needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. label Jun 21, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [7ff6370]
Page Load Metrics (53 ± 13 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint66195842713
domContentLoaded97614147
load40170532813
domInteractive97614147
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 4.96 KiB (0.07%)
  • common: 273 Bytes (0.00%)

Copy link

codecov bot commented Jun 21, 2024

Codecov Report

Attention: Patch coverage is 32.81250% with 43 lines in your changes missing coverage. Please review.

Project coverage is 69.65%. Comparing base (d403213) to head (2e4d1fb).
Report is 9 commits behind head on develop.

Files Patch % Lines
.../multichain/network-list-menu/network-list-menu.js 45.83% 13 Missing ⚠️
...ete-rpc-url-modal/confirm-delete-rpc-url-modal.tsx 8.33% 11 Missing ⚠️
...ings/networks-tab/networks-form/rpc-url-editor.tsx 38.46% 8 Missing ⚠️
ui/pages/routes/routes.component.js 0.00% 4 Missing ⚠️
...-list-menu/add-rpc-url-modal/add-rpc-url-modal.tsx 33.33% 2 Missing ⚠️
ui/pages/home/home.component.js 0.00% 1 Missing ⚠️
ui/pages/home/home.container.js 0.00% 1 Missing ⚠️
ui/pages/routes/routes.container.js 0.00% 1 Missing ⚠️
...ttings/networks-tab/networks-form/networks-form.js 50.00% 1 Missing ⚠️
ui/store/actions.ts 66.67% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25452      +/-   ##
===========================================
- Coverage    69.69%   69.65%   -0.03%     
===========================================
  Files         1350     1352       +2     
  Lines        47865    47903      +38     
  Branches     13199    13207       +8     
===========================================
+ Hits         33355    33365      +10     
- Misses       14510    14538      +28     

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

@bergeron bergeron requested a review from salimtb June 24, 2024 18:42
<Modal
isClosedOnEscapeKey={true}
isClosedOnOutsideClick={true}
isOpen={true}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think ={true} is required here; I think the presence of the attribute infers true

<ButtonPrimary
width={BlockSize.Full}
size={ButtonPrimarySize.Lg}
danger={true}
Copy link
Contributor

Choose a reason for hiding this comment

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

same here you can just use danger

id="additional-rpc-url"
label={t('additionalRpcUrl')}
labelProps={{
children: undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to specify the value of children to undefined here? doesn't this take undefined by default ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i got a type error without it

Screenshot 2024-06-25 at 8 18 38 AM

@salimtb
Copy link
Contributor

salimtb commented Jun 25, 2024

hey @bergeron
I'd like to inquire about the validation process for the rpcURL. Specifically, when adding a new rpcURL by clicking the "add" button, which opens another modal, what happens if the entered rpcURL either doesn't correspond with the chainID or is a duplicate of an existing rpcURL? Will there be an alert or error message to indicate this issue? Is this scenario accounted for in the design?

>
{t('addUrl')}
</ButtonPrimary>
</Box>
Copy link
Contributor

Choose a reason for hiding this comment

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

if we decide to include input validation here, it would be a good idea to write unit tests for this modal with the different scenarios ( rpcUrl doesn't match with chainID, rpcURL already added ...etc )

@salimtb
Copy link
Contributor

salimtb commented Jun 25, 2024

works as expected for me, i just raised one question about input validation if you have more informations on that

@bergeron
Copy link
Contributor Author

hey @bergeron I'd like to inquire about the validation process for the rpcURL.

I think it'd be best to perform that validation on the page where the url is being added. So when you click add, it validates before returning you to the main edit form. Better to get those errors earlier. I don't see explicit design for this, but I'd use the same red warnings as the other edit validations.

@metamaskbot
Copy link
Collaborator

Builds ready [2e4d1fb]
Page Load Metrics (46 ± 3 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint69918063
domContentLoaded9211131
load38624663
domInteractive9211131
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 4.96 KiB (0.07%)
  • common: 273 Bytes (0.00%)

@sahar-fehri
Copy link
Contributor

Looks great! Thank you! Sorry if this was already talked about 🙏 tested the following scenario, i kinda expected it to say "foobar" is not a valid url,, but it said nothing after typing nor when i clicked, is it intentional?

Screen.Recording.2024-06-27.at.17.08.52.mov

@bergeron
Copy link
Contributor Author

i kinda expected it to say "foobar" is not a valid url,, but it said nothing after typing nor when i clicked, is it intentional?

Validation still needs to be added in a future PR

@bergeron bergeron merged commit 1f74b08 into develop Jun 28, 2024
70 checks passed
@bergeron bergeron deleted the brian/edit-custom-network-flow4 branch June 28, 2024 15:18
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 28, 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-12.1.0 Issue or pull request that will be included in release 12.1.0 team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants