qrl-wallet icon indicating copy to clipboard operation
qrl-wallet copied to clipboard

Specify input validation errors

Open noel-jasper opened this issue 3 years ago • 3 comments

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 👍

noel-jasper avatar Mar 12 '21 19:03 noel-jasper

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 avatar Mar 12 '21 20:03 jplomas

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

jplomas avatar Mar 12 '21 20:03 jplomas

that was fast, thanks a lot!

noel-jasper avatar Mar 12 '21 20:03 noel-jasper