Introducing an improved IP Address and Port input control in ProxySettings component#391
Conversation
a4f4263 to
fe547af
Compare
| activeFocusOnTab: true | ||
| onEditingFinished: { | ||
| defaultProxy.forceActiveFocus() | ||
| if (isValidIPPort(text)) { |
There was a problem hiding this comment.
I think it might be a good idea to encapsulate the validation logic in the IPAddressValueInput component itself. I think one possible way to do that is to add a Connections element to onEditingFinished signal in the IPAddressValueInput definition so the validation can't be overridden. Then just expose a bool for if the input is valid or not.
There was a problem hiding this comment.
Ok, it makes sense, I'll try to do that. Thanks!
There was a problem hiding this comment.
Updated it with the Connection element and removed the onEditingFinished from IPAddressValueInput, please let me know what you think.
|
Just tested on Android mobile. This is a nice update. I don't think the input field needs to turn orange when it goes from disabled to enabled state (by toggling the line above). Also interesting how the "Enable" title briefly turns orange when tapping. Feels a bit surprising and unnecessary. I think the title could just remain white. The copy for the Tor proxy is too confusing still.
Can we remove that second line? |
D33r-Gee
left a comment
There was a problem hiding this comment.
aefd53b to
7994009
Compare
Making the option switches work to enable and disable the IP Address and Port fields (Proxy and Tor - ValueInput) accordingly to the user's intentions.
7994009 to
7893dfb
Compare
I've incorrectly used a different The new
|
It seems I did something wrong when I updated the 1st commit. I'll correct it in a bit with your |
7893dfb to
c294e59
Compare
|
Sorry, you've found another bug in the code, the Tor IP input points to the Default Proxy one. I'll fix it immediately.
The |
c294e59 to
6b2621e
Compare
|
I understand your point, but for me I'd prefer that behavior. The few users who use this and enter it will only enter it rarely. (in contrast to maybe regularly manually typing in a BTC address, then yes such behavior might be annoying.)
no, the above was.
yes I'd say to leave it, as user intent was to enter something else |
|
6b2621e is a bit glitchy when hovering proxysettings.webm |
Ok, let me update that. It would be also good to see others reviewers takes on this. |
Thanks, I'll investigate what's going on. |
Adding a new improved ValueInput control to handle both IP address and port values combined in the same field with the correct visual formatting (255.255.255.255:65535). In this iteration, validation for this control is implemented using both a function within the control itself focused solely on ensuring correct formatting and a simple regex validator for the valid input characters. Future versions will see integration with network model classes, enabling parsing of IP addresses and ports and additional checks, such as those outlined in doc/p2p-bad-ports.md.
6b2621e to
d47bc1a
Compare
|
|
Tested on macOS M1, very nice! One thing I would change:
I feel like this is redundant here a bit, and Tor proxy description says it all |
Follow-up from bitcoin-core#391 (comment). Removing redundant Tor Proxy description from the top Default Proxy label.
Follow-up from bitcoin-core#391 (comment). Removing redundant Tor Proxy description from the top Default Proxy header label. Rewording Tor Proxy description to be consistent with the top header label.
… - Follow-up #391 d558b05 qml, component: Fix labelling on ProxySettings (pablomartin4btc) Pull request description: This is a follow-up from #391 (comment). <details> <summary>Currently/ <code>main</code> branch screenshot.</summary>  </details> <details> <summary> This PR branch screenshot.</summary>  </details> ACKs for top commit: GBKS: tACK d558b05 D33r-Gee: tACK d558b05 Tree-SHA512: b849bf2addafeac85e645281be162cf22d2f34da613f3da3fcef42377546a33e1b19beacb66660e06bc2e55b6b3c10bae08cf0ecdafb1e470fb8d44b040b6ff0
This was overlooked in bitcoin-core#391.
@GBKS could you please comment on this? If you agree on where the validation takes place at the moment? Otherwise we might have to update it in #430. Many thanks! |
…d Port input control in ProxySettings component fa89142 qml, control: new IPAddressValueInput (pablomartin4btc) b5983fd qml, component: correct ProxySettings behaviour (pablomartin4btc) Pull request description: Adding a new improved `ValueInput` control to handle both `IP` address and port values combined in the same field (as it was designed for `QML`, current `QT` project have them separately) with the correct visual formatting (`255.255.255.255:65535`). In order to add/ change the `IP` address and port value, user needs to enable the fields (currently in `main` branch this doesn't work and this PR fixes it). Currently the `IP` address and port input fields don't allow more than 5 digits and this PR also correct it so the user can enter a complete `IP` address and port value. <details> <summary>If an invalid <code>IP</code> address (e.g. <code>127.0.:9050</code>) and/ or port (e.g. <code>127.0.0.1:</code>) are entered an error message will be shown as we do in other fields.</summary>  </details> <details> <summary>Current <code>master</code>/ <code>main</code> branch screenshot.</summary>  </details> <details> <summary>Current master branch in <code>QT</code> <a href="https://github.com/bitcoin-core/gui">repo</a> (just for reference).</summary>  </details> <details> <summary>This PRs branch screenshot.</summary>  </details> <details> <summary><a href="https://www.figma.com/file/ek8w3n3upbluw5UL2lGhRx/Bitcoin-Core-App-Design?type=design&node-id=7635-19847&mode=design&t=Ns1KRBputDp3sBjs-0">Design</a> in Figma.</summary>  </details> --- **Implementation details**: In this iteration, validation for this control is implemented using both a function within the control itself focused solely on ensuring correct formatting and a simple regex validator for the valid input characters. Future versions will see integration with network model classes, enabling parsing of IP addresses and ports and additional checks, such as those outlined in [`doc/p2p-bad-ports.md`](https://github.com/bitcoin/bitcoin/tree/master/doc/p2p-bad-ports.md). **Note**: Persistence/ wiring of the settings and creating the proper network connection thru the Proxy will be performed in a different PR, the idea is to isolate UI experience/ testing in case we need to make changes on that aspect separately and we concentrate on the functionality behind later. ACKs for top commit: johnny9: ACK fa89142 Tree-SHA512: f471a40696e5fcf0ba60808f379c5f89fbecc714971b7d69aa91ad38a002fe8d33accd0138ddb9b34c7a2fdd3ab30001088dbb8c74a3b6b9a91c700bcacd7455
Follow-up from bitcoin-core/gui-qml#391 (comment). Removing redundant Tor Proxy description from the top Default Proxy header label. Rewording Tor Proxy description to be consistent with the top header label.
…ion on ProxySettings - Follow-up #391 edbe749 qml, component: Fix labelling on ProxySettings (pablomartin4btc) Pull request description: This is a follow-up from bitcoin-core/gui-qml#391 (comment). <details> <summary>Currently/ <code>main</code> branch screenshot.</summary>  </details> <details> <summary> This PR branch screenshot.</summary>  </details> ACKs for top commit: GBKS: tACK edbe749 D33r-Gee: tACK edbe749 Tree-SHA512: b849bf2addafeac85e645281be162cf22d2f34da613f3da3fcef42377546a33e1b19beacb66660e06bc2e55b6b3c10bae08cf0ecdafb1e470fb8d44b040b6ff0
…d Port input control in ProxySettings component fa89142f38d6a3a60bd81c54d93a425c57e41392 qml, control: new IPAddressValueInput (pablomartin4btc) b5983fdc5752e902d821c91c51cf38987383cfab qml, component: correct ProxySettings behaviour (pablomartin4btc) Pull request description: Adding a new improved `ValueInput` control to handle both `IP` address and port values combined in the same field (as it was designed for `QML`, current `QT` project have them separately) with the correct visual formatting (`255.255.255.255:65535`). In order to add/ change the `IP` address and port value, user needs to enable the fields (currently in `main` branch this doesn't work and this PR fixes it). Currently the `IP` address and port input fields don't allow more than 5 digits and this PR also correct it so the user can enter a complete `IP` address and port value. <details> <summary>If an invalid <code>IP</code> address (e.g. <code>127.0.:9050</code>) and/ or port (e.g. <code>127.0.0.1:</code>) are entered an error message will be shown as we do in other fields.</summary>  </details> <details> <summary>Current <code>master</code>/ <code>main</code> branch screenshot.</summary>  </details> <details> <summary>Current master branch in <code>QT</code> <a href="https://github.com/bitcoin-core/gui">repo</a> (just for reference).</summary>  </details> <details> <summary>This PRs branch screenshot.</summary>  </details> <details> <summary><a href="https://www.figma.com/file/ek8w3n3upbluw5UL2lGhRx/Bitcoin-Core-App-Design?type=design&node-id=7635-19847&mode=design&t=Ns1KRBputDp3sBjs-0">Design</a> in Figma.</summary>  </details> --- **Implementation details**: In this iteration, validation for this control is implemented using both a function within the control itself focused solely on ensuring correct formatting and a simple regex validator for the valid input characters. Future versions will see integration with network model classes, enabling parsing of IP addresses and ports and additional checks, such as those outlined in [`doc/p2p-bad-ports.md`](https://github.com/bitcoin/bitcoin/tree/master/doc/p2p-bad-ports.md). **Note**: Persistence/ wiring of the settings and creating the proper network connection thru the Proxy will be performed in a different PR, the idea is to isolate UI experience/ testing in case we need to make changes on that aspect separately and we concentrate on the functionality behind later. ACKs for top commit: johnny9: ACK fa89142f38d6a3a60bd81c54d93a425c57e41392 Tree-SHA512: f471a40696e5fcf0ba60808f379c5f89fbecc714971b7d69aa91ad38a002fe8d33accd0138ddb9b34c7a2fdd3ab30001088dbb8c74a3b6b9a91c700bcacd7455
Follow-up from bitcoin-core/gui-qml#391 (comment). Removing redundant Tor Proxy description from the top Default Proxy header label. Rewording Tor Proxy description to be consistent with the top header label.
…ion on ProxySettings - Follow-up #391 edbe749856611f82dc0c535f102562dcde58e877 qml, component: Fix labelling on ProxySettings (pablomartin4btc) Pull request description: This is a follow-up from bitcoin-core/gui-qml#391 (comment). <details> <summary>Currently/ <code>main</code> branch screenshot.</summary>  </details> <details> <summary> This PR branch screenshot.</summary>  </details> ACKs for top commit: GBKS: tACK edbe749 D33r-Gee: tACK edbe749856611f82dc0c535f102562dcde58e877 Tree-SHA512: b849bf2addafeac85e645281be162cf22d2f34da613f3da3fcef42377546a33e1b19beacb66660e06bc2e55b6b3c10bae08cf0ecdafb1e470fb8d44b040b6ff0




Adding a new improved
ValueInputcontrol to handle bothIPaddress and port values combined in the same field (as it was designed forQML, currentQTproject have them separately) with the correct visual formatting (255.255.255.255:65535).In order to add/ change the
IPaddress and port value, user needs to enable the fields (currently inmainbranch this doesn't work and this PR fixes it). Currently theIPaddress and port input fields don't allow more than 5 digits and this PR also correct it so the user can enter a completeIPaddress and port value.If an invalid
IPaddress (e.g.127.0.:9050) and/ or port (e.g.127.0.0.1:) are entered an error message will be shown as we do in other fields.Current
master/mainbranch screenshot.Current master branch in
QTrepo (just for reference).This PRs branch screenshot.
Design in Figma.
Implementation details:
In this iteration, validation for this control is implemented using both a function within the control itself focused solely on ensuring correct formatting and a simple regex validator for the valid input characters.
Future versions will see integration with network model classes, enabling parsing of IP addresses and ports
and additional checks, such as those outlined in
doc/p2p-bad-ports.md.Note:
Persistence/ wiring of the settings and creating the proper network connection thru the Proxy will be performed in a different PR, the idea is to isolate UI experience/ testing in case we need to make changes on that aspect separately and we concentrate on the functionality behind later.