-
-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(core): show the last passphrase character for a while #4385
base: main
Are you sure you want to change the base?
Conversation
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested the functionality yet.
I have some code-related comments.
@@ -26,6 +27,14 @@ pub enum PassphraseKeyboardMsg { | |||
Cancelled, | |||
} | |||
|
|||
#[derive(PartialEq, Debug, Copy, Clone)] | |||
#[cfg_attr(feature = "ui_debug", derive(ufmt::derive::uDebug))] | |||
enum DisplayStyle { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same enum with the same derive
s also in keyboard/pin.rs
.
Perhaps, we can put it to some common space at least per model? Or maybe even common for all models and keyboards?
The naming could be more generic so that it captures both "chars" and "digits" and all models. Something like Hidden
/Shown
/LastOnly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea, I am just wondering, where to place it.
For the per-model scenario, there is already a common keyboard module, but it will still be repeated multiple times.
For the global (best) one, I don't see the proper location right away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.last_char_timer.stop(); | ||
} | ||
|
||
fn render_chars<'s>(&self, area: Rect, target: &mut impl Renderer<'s>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I look correctly, it seems that majority of the code in render_chars
and render_dots
is the same except the final rendering and the naming of variables (chars
vs all_chars
, text_baseline
vs cursor
).
Do you think we can somehow simplify these two functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR solves #3959 :
mercury
] Introduces a feature, that shows the last typed PIN number for short period of time (1 second) before changing it to back to a bullet icontt
] Introduces a feature, that shows the last typed PIN number for short period of time (1 second) before changing it to back to a*
character with faded colortr
] Changes the feature, where the last PIN digit is shown until non-timer (button) event to use aforementioned timeout.Changes include:
tt
,mercury
Timer
and 3-state enum objects to the Input struct and utilizing them to change the passphrase rendering style (stars, last character, all characters)label_keyboard_mono
font...
to twitching when passphrase overflowsTouchStart
andTouchStop
events to show/hide entire passphrase and maximizing the touch areaapply_display_style
function to render the passphrase according to required rendering styletr
Timer
to the PassphraseEntry struct and utilizing it to change the passphrase rendering style (stars, last character, all characters)...
, and keep only twitching when passphrase overflows