wizardsardine / liana

The missing safety net for your coins
https://wizardsardine.com/liana
BSD 3-Clause "New" or "Revised" License
295 stars 49 forks source link

Improve UX of mnemonic import #513

Open pythcoiner opened 1 year ago

pythcoiner commented 1 year ago

I think it can be few little improvement when importing a mnemonic:

darosior commented 1 year ago

add shortcut (tab?) to go to the next input field

Yeah, i think it could even have its own issue as it happens everywhere there is multiple inputs. Having to grab your mouse to click on the next input puts a lot of friction.

darosior commented 1 year ago

If anyone wants to tackle this, feel free to address any one of the point separately.

jp1ac4 commented 1 year ago

add shortcut (tab?) to go to the next input field

Hi there, I don't think this is currently possible if I understand this issue correctly: https://github.com/iced-rs/iced/issues/489.

disable the next button if the checksum is wrong

Related to this, I noticed that if the checksum is wrong and an error appears when clicking Next, the Next button remains blocked even after the words are corrected. The change below seems to fix this, but it might not be required if other changes to the logic are made on this page so I'll wait and see what's decided first.

diff --git a/gui/src/installer/step/mnemonic.rs b/gui/src/installer/step/mnemonic.rs
index 7198b83..0bebd5d 100644
--- a/gui/src/installer/step/mnemonic.rs
+++ b/gui/src/installer/step/mnemonic.rs
@@ -94,6 +94,7 @@ impl Step for RecoverMnemonic {
                         let suggestions = self.language.words_by_prefix(&value);
                         if suggestions.contains(&value.as_ref()) {
                             *valid = true;
+                            self.error = None;
                             self.suggestions = Vec::new();
                         } else {
                             self.suggestions = suggestions.iter().map(|s| s.to_string()).collect();
pythcoiner commented 1 year ago

Hi there, I don't think this is currently possible if I understand this issue correctly: iced-rs/iced#489.

Hi, i'm not used with iced (nor rust), but if i understand well @semtexzv, TextInput are focusable by default, but maybe we need to set the view itself to be focusable?

jp1ac4 commented 1 year ago

I'm not sure if it's currently possible as I thought that comment was regarding a way to add this functionality to iced.

pythcoiner commented 1 year ago

the comment is not really clear... is there an event handler in iced, from which we can get the keyboard event? how can we get on which widget the focus is on?

pythcoiner commented 5 months ago

just found this crate maybe can help us doing stuff w/ focusses

pythcoiner commented 3 months ago

i'm digging iced doc, i think we can use iced::widget::text_input::move_cursor_to() in order to move focus between TextInput

pythcoiner commented 3 months ago

https://github.com/iced-rs/iced/blob/8ce16aba6204cb5c02a709cdf79c309f7b7e0196/examples/todos/src/main.rs#L145-L151

pythcoiner commented 3 months ago

add shortcut (tab?) to go to the next input field

Yeah, i think it could even have its own issue as it happens everywhere there is multiple inputs. Having to grab your mouse to click on the next input puts a lot of friction.

this is addressed by #1019