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
Let users browse among all possible RPC networks #3464
Comments
This looks useful. I think we spoke about (or I wanted to but forgot) showing the chain icon here too. Do you think we could add both as a separate change, separate from this issue? The chain data can be pulled from https://github.com/ethereum-lists/chains so it's not a problem. But the chain data is sometimes wrong or possibly outdated and is community maintained. We can help to fix the data as we discover them (e.g ethereum-lists/chains#440). Do you think we should have a disclaimer message somewhere in the Browser tab? Another thing is the repo doesn't say whether each chain is a testnet or not (eg. https://github.com/AlphaWallet/chains/blob/0f95f16c35fa6794a03941453a397480798ce02f/_data/chains/eip155-42161.json). So I suppose we can only show a single list and then when the user taps one, switch back to the |
Yeah, we need two issues.
I would not overcomplicate this. We can connect (message) to each one of these networks and let them know that this is available in the AlphaWallet app now. And we can kindly request them to file an issue if something has changed.
You can figure this out with their names. If hasTestnet = true, then put this into Testnets. We need to write simple scripts that will automate the work for us. |
Ah yes, and there's actually a "network" field that says whether it is testnet or not, though the data is dirty too. But we can make a guess. |
@eviltofu can you help to work on this? But excluding: #3511, i.e. don't change that screen to add the icon/chain ID. Probably need to look at https://github.com/ethereum-lists/chains and see if we should include it as a submodule (how big is it?) or download it on-demand |
@hboon @colourfreak Some notes and clarifications. Browse Screen
|
You might be referring to caching either of these: A. chains that are added through Browse A. Chains that are added through BrowseAfter the user adds their selections, we must not automatically/silently modify the copy they have added to B. The list of chains in the Browse tabI am leaning towards just embedding it as a git submodule, for us to refresh when we update the app but need to see how much it adds to the app size
It's a third party repo, but community maintained. But we are free to include a script to created an amalgamation JSON based on https://github.com/ethereum-lists/chains/tree/master/_data/chains. If you create such a file, just include it in the PR and we can probably create a separate repo for it
Seems like we are missing an "Add" button in the top right when the "Browse" tab is selected. Tapping that button (which is hidden for the Enter tab) will add the selected chains ignorig whatever was entered in the Enter tab. Similiarly, tapping "Save Network" in the Enter tab ignores selection made in the Browser tab. Simpler UI and code
Run through the processed chains like how we process the one submitted chain during manual entry and display an error dialog with the first error in the first selected chain in the simplest manner for now? It's a rarely used screen, don't waste too much time on it (because the better version is much more fancier). If we discover that it turns out to be a popular function, we can come back and improve it. |
@colourfreak Can we have a pop up appear after you tap the + button which then lets the user pick manual or browse and then just go to that screen? |
I updated the prototype: Changes:
|
@hboon We embed https://github.com/ethereum-lists/chains as a git submodule and run the Kotlin code to generate "chains.json" which we then embed into our app as the source for RPC networks? |
@eviltofu Ah. Didn't realise there's already a |
We should provide a base We can use the HTTP header |
We can do the caching as you suggested. But I don't think we should include the file. It's huge for what it does, but can you verify how big it is if compressed? It seems unnecessary to include it when most users will never access it in the app. |
Is this the complete list? In the |
I don't know. Can you compare chains.json and chains_mini.json to see what's the difference? If it is small enough to bundle (say 30k or less, zipped?), then let's just download a copy and bundle and skip the runtime caching entirely. Simplest approach. |
|
Ah, pick one. The mini if possible and let's just bundle. |
From the Kotlin source code, the mini version only contains |
Some of the entries in chains_mini.json have empty attributes for |
Filter out those that aren’t valid for uss |
I'll use the validation routines in the |
Having trouble with using UISearchController in a child container. Temporarily using a SearchBar to do the filtering. |
@hboon Is there a reason why we have switches in section headers to select Mainnet or Testnet Custom RPC Servers? |
@eviltofu UI design decision. But we wanted to be clear it is mainnet vs testnet, and it worked in that way. |
@colourfreak Can you recommend the phrase / position of the empty search result message? Currently, it is placed in the middle of the screen. (Also font, colour, etc) |
@hboon What happens when someone adds multiple CustomRPCs but one of the CustomRPCs is invalid? For error recovery, do we want the state to be exactly as before the add operation or allow those added to remain? When we return to the Browse screen, is the entry which caused the error unchecked? |
@hboon @colourfreak Adding a single CustomRPC takes some time. Adding multiple will take a long time. Do we want to limit the number of servers that can be added? We also need to be able to allow the user to cancel in the middle of the add operation if it takes too long. |
@hboon Any solutions to something like this? Simulator.Screen.Recording.-.iPhone.12.-.2021-12-24.at.18.18.51.mp4 |
What we could do is pop up a modal view that lists all the customRPCs in a tableview and have an animation indicating which customRPC is being added (we automatically do the check on the blockchain explorer url). Once added, we add a check mark at the end of the row. There are buttons that will allow the user to cancel the entire operation. All added networks are actually only added after all networks have been cleared. |
If you are referring to the layout of the UI elements being animated when it appears, they have to be laid out before the screen is animated. The keyboard showing up might be causing it. Try disable the call to |
Presuming these 2 are about the same point:
Just block the app with a UIActivityView for now? If the user tries to add 20 chains at a go, they have to make extra efforts to do it (we don't have a Select All button). But we do have to make sure that if the app is terminated while processing the chains that we don't end up in an inconsistent state, but just adding X out of 20 chain is fine. It's not a common operation and we don't know if it's going to be used much yet and we can come back and polish the UI up if we need something better. I think you asked somewhere about what happens if there's an error, if you don't have an answer yet try this:
|
BTW, are we still changing this to a pop up that lets the user choose between browsing and manual entry? |
No, it is now a combined screen. |
Ok. BTW, according to https://projects.invisionapp.com/share/MW1220T36ET3#/screens/461348027, the tab title should be "Enter", not "Manual" |
It's not setting the keyboard for firstResponder. I think I made a design mistake by adding/removing the child view controllers. I'm going to try and add them both child view controllers' views to the container view and then show/hide the correct view. Yes, the weird animation went away once I added both view controllers and just changed the relevant view's |
@hboon I'm going to make a simple view controller to handle this. Just a simple progress bar with a "x/y" caption so no localisation will be needed, and a cancel button. There is no difference if the user adds a few main nets and test nets networks together? |
Does browsing to add chains have a UISwitch in the mainnet and testnet headers as shown in #3464 (comment) ? If there is, then we should only allow them to add mainnets or testnets separately each time, i.e. X mainnet or Y testnets, but not X mainnet + y testnets to mirror the behavior enabling/disabling screen. If there are no |
@hboon Currently, the user is able to switch from mainnet to testnet in both browse and search modes. What happens to the selected networks when I switch sections? Simulator.Screen.Recording.-.iPhone.12.-.2021-12-30.at.10.33.54.mp4 |
Remember them so they remain selected when the user toggles back, but don't add them unless the user switchs back to that tab. Unrelated: seems a bit odd the user has to tap |
@colourfreak @hboon What should the error message be when some networks failed when being added? |
Reuse something that we already have in the manual/enter screen if we can. Otherwise propose something. Faster that way, because it's not so critical. We can tweak it after that. |
Problem: users have to enter RPC networks manually, where in most cases it can be automated.
Changes:
Prototype:
https://invis.io/MW1220T36ET3
Screen.Recording.2021-11-23.at.12.26.04.mov
The text was updated successfully, but these errors were encountered: