theQRL / qrl-wallet

QRL Wallet
https://wallet.theqrl.org
MIT License
48 stars 27 forks source link

Specify input validation errors #474

Open noel-jasper opened 3 years ago

noel-jasper commented 3 years ago

qrl-wallet v1.7 win10 ledger nano s

Hey, I'd appreciate some specific error messages for unexpected user input in the "Recipient" and "Amount" field on the "Send & Receive" page. Right now there is this general message on a new view: "Transaction Generation Failed Error: Custom validation failed".

I tried to send 10.1 Quanta but typed "10,1" and it would have been helpful to see: "Invalid amount" or "amount input is not a valid number".

Of course, input validation onClick of the "Confirm" button would be even more helpful :) right now the validation seems to happen after the click and the next page with the general error message has no navigation buttons. Therefore, I am forced to click on the left navbar and then have to confirm that I want to cancel the transaction. But that will reset the input fields so I have to start all over.

Error messages under the red-bordered input fields would be the most helpful way to figure out where the wrong input happened. Like this: grafik

Keep up the good work 👍

jplomas commented 3 years ago

Thanks for opening this issue.

We could make the input number (it is text at the moment) which would stop the user entering a comma, but the risk here is that pasting 1,21 actually gets interpreted as 121 (at least in Chrome where this behaviour has been noted) -- which is a definite no-go.

As it happens, we had most of the validation code in the wallet, and I've just looked at how straight-forward it would be to finish the implementation...

QRL_Wallet

The actual nuts-and-bolts of inline validation is complete on my local branch, will fix the UI (location of the amounts error message) then update the web wallet either at the weekend or next week, and this will be included in the next desktop wallet release (date TBC).

Again, thanks for the issue!

jplomas commented 3 years ago

(the QRL address in screenshot above is invalid as the checksum is invalid!)

noel-jasper commented 3 years ago

that was fast, thanks a lot!