IP Address input value control - move validation and persistence out from onTextChanged into onEditingFinished but needs UI change (maybe adding a new "done" button) #438

Closed
opened 2024-11-25 21:01:07 +00:00 by pablomartin4btc · 4 comments
pablomartin4btc commented 2024-11-25 21:01:07 +00:00 (Migrated from github.com)

Now, every time a user types into the ip address input value, the value is validated and persisted (if #433 gets merged), this is because of the nature of the app design, there's no where to "accept" the changes or land after editing a value. Originally the validation was triggered in the editing finished but it seemed more correct to move it into the text change due to the above reason. But when we added the persistence logic (#433), didn't feel right anymore, so @GBKS suggested to add a "done" button when we revert back to the correct event again:

image

Now, every time a user types into the ip address input value, the value is validated and persisted (if #433 gets merged), this is because of the nature of the app design, there's no where to "accept" the changes or land after editing a value. Originally the validation was triggered in the editing finished but it seemed more correct to [move](https://github.com/bitcoin-core/gui-qml/pull/391#issuecomment-2021432971) it into the text change due to the above reason. But when we added the persistence logic (#433), didn't feel right anymore, so @GBKS suggested to add a "done" button when we revert back to the correct event again: ![image](https://git.fish.foo/attachments/98dfdda0-5f5b-4e51-b285-f19c33ded8e5)
GBKS commented 2024-11-26 11:36:20 +00:00 (Migrated from github.com)

Here is a reference for this pattern, from editing your name in iOS account settings.

mobile-edit-with-done-button-241126

There are probs some details we should define, like:

  • Pressing "Back" will navigate back without saving my changes. Should we prompt the user about that This will discard your changes. Continue?
  • We will also need to inform the user that changes require an application restart. This can be just static text on the page (and not something that pops up once you start editing like we've had so far). Can we trigger an application restart programmatically? Or does the user need to do the manually?
  • Does validation only happen when pressing "Done" or also when an input field loses focus (blur event)? I'd suggest also on losing focus.

Just some thoughts. What are yours?

Here is a reference for this pattern, from editing your name in iOS account settings. ![mobile-edit-with-done-button-241126](https://git.fish.foo/attachments/6638f7f1-a4ce-4c97-ac0d-a281b9512c76) There are probs some details we should define, like: - Pressing "Back" will navigate back without saving my changes. Should we prompt the user about that `This will discard your changes. Continue?` - We will also need to inform the user that changes require an application restart. This can be just static text on the page (and not something that pops up once you start editing like we've had so far). Can we trigger an application restart programmatically? Or does the user need to do the manually? - Does validation only happen when pressing "Done" or also when an input field loses focus (blur event)? I'd suggest also on losing focus. Just some thoughts. What are yours?
pablomartin4btc commented 2024-11-26 14:16:39 +00:00 (Migrated from github.com)
* Pressing "Back" will navigate back without saving my changes. Should we prompt the user about that `This will discard your changes. Continue?`

I agree, makes sense, that could work.

* We will also need to inform the user that changes require an application restart. This can be just static text on the page (and not something that pops up once you start editing like we've had so far). 

I was thinking on that yesterday night and I was going to create a separate issue today, because other settings could need this feature as well. (edit: #419)

Can we trigger an application restart programmatically? Or does the user need to do the manually?

I need to check, perhaps we could ask the user if he want to restart and do it for him. At the moment in Qt requires manual restart from the user.

* Does validation only happen when pressing "Done" or also when an input field loses focus (blur event)? I'd suggest also on losing focus.

Yes, losing focus makes sense to validate but to persist the value only with "Done". Also in the proxy settings we have the default proxy and the tor one, this "Done" is for both? Or independent: the user needs to finish with "done" the default before modifying the tor? And then as soon the default's "done" disappears another would come back if the user starts editing the tor input?

> * Pressing "Back" will navigate back without saving my changes. Should we prompt the user about that `This will discard your changes. Continue?` I agree, makes sense, that could work. > * We will also need to inform the user that changes require an application restart. This can be just static text on the page (and not something that pops up once you start editing like we've had so far). I was thinking on that yesterday night and I was going to create a separate issue today, because other settings could need this feature as well. (**edit:** #419) > Can we trigger an application restart programmatically? Or does the user need to do the manually? I need to check, perhaps we could ask the user if he want to restart and do it for him. At the moment in Qt requires manual restart from the user. > * Does validation only happen when pressing "Done" or also when an input field loses focus (blur event)? I'd suggest also on losing focus. Yes, losing focus makes sense to validate but to persist the value only with "Done". Also in the proxy settings we have the default proxy and the tor one, this "Done" is for both? Or independent: the user needs to finish with "done" the default before modifying the tor? And then as soon the default's "done" disappears another would come back if the user starts editing the tor input?
johnny9 commented 2026-05-29 16:04:12 +00:00 (Migrated from github.com)

Whatever pattern used here should likely be replicated across settings

Whatever pattern used here should likely be replicated across settings
jarolrod commented 2026-06-01 16:58:02 +00:00 (Migrated from github.com)

I’m working on changes that address this issue in a settings/onboarding QML branch. I plan to submit the PR soon and will link it here once it’s open.

I’m working on changes that address this issue in a settings/onboarding QML branch. I plan to submit the PR soon and will link it here once it’s open.
Sign in to join this conversation.
No description provided.