refactor(core): slide the eye hint and hidden characters in together
What changed, and why it matters
This commit is a cosmetic UI animation cleanup. It removes a 65-millisecond delay so that an eye icon and hidden password characters slide onto the screen at the same time, instead of starting at slightly different times. There is no security-relevant change.
No security action needed. This is a routine UI refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch refactors the EyeHintAnimation in the Trezor firmware UI. It removes the CONTENT_DELAY, CONTENT_START, CONTENT_SCALE, and content_progress() logic, so the hidden passphrase characters (dots/dashes) now use the same progress() value as the eye icon. Call sites in the Delizia and Eckhart layouts are updated to pass eye_progress directly to EyeHintAnimation::offset() rather than first transforming it through content_progress(). This is purely a timing/animation simplification.
Changed components
core/embed/rust/src/ui/component/eye_hint.rscore/embed/rust/src/ui/layout_delizia/component/keyboard/passphrase.rscore/embed/rust/src/ui/layout_eckhart/firmware/keyboard/passphrase.rsInspect captured patch +5 / −23
### core/embed/rust/src/ui/component/eye_hint.rs
@@ -32,14 +32,8 @@ impl EyeHintAnimation {
const START_DELAY: Duration = Duration::from_millis(200);
/// Duration of the slide-in.
const DURATION: Duration = Duration::from_millis(205);
- /// Delay before the hidden characters start moving, from the slide-in
- /// start.
- const CONTENT_DELAY: Duration = Duration::from_millis(65);
const INV_DURATION_MS: f32 = 1.0 / Self::DURATION.to_millis() as f32;
- /// Slide-in progress at which the hidden characters start moving.
- const CONTENT_START: f32 = Self::CONTENT_DELAY.to_millis() as f32 * Self::INV_DURATION_MS;
- const CONTENT_SCALE: f32 = 1.0 / (1.0 - Self::CONTENT_START);
/// Start the slide-in when the icon becomes visible, reset it when the
/// icon is hidden.
@@ -80,8 +74,8 @@ impl EyeHintAnimation {
self.visible
}
- /// Progress of the slide-in, from 0.0 (eye icon off its place) to 1.0 (in
- /// place).
+ /// Progress of the slide-in, from 0.0 (eye icon and hidden characters off
+ /// their place) to 1.0 (in place).
pub fn progress(&self) -> f32 {
if !self.visible || self.delay_timer.is_running() {
return 0.0;
@@ -93,12 +87,6 @@ impl EyeHintAnimation {
(elapsed_ms * Self::INV_DURATION_MS).min(1.0)
}
- /// Progress of the hidden characters for a given slide-in `progress`. They
- /// start moving after `CONTENT_DELAY` and arrive together with the icon.
- pub fn content_progress(progress: f32) -> f32 {
- ((progress - Self::CONTENT_START) * Self::CONTENT_SCALE).clamp(0.0, 1.0)
- }
-
/// Offset of an element sliding `distance` pixels into place.
pub fn offset(progress: f32, distance: i16) -> i16 {
-(f32::from(distance) * (1.0 - progress)) as i16
### core/embed/rust/src/ui/layout_delizia/component/keyboard/passphrase.rs
@@ -613,11 +613,8 @@ impl Input {
let style = theme::label_keyboard();
let eye_progress = self.eye_hint.progress();
- let dots_offset = Self::DOTS_OFFSET
- + EyeHintAnimation::offset(
- EyeHintAnimation::content_progress(eye_progress),
- Self::DOTS_SLIDE,
- );
+ let dots_offset =
+ Self::DOTS_OFFSET + EyeHintAnimation::offset(eye_progress, Self::DOTS_SLIDE);
let mut cursor = self.area.left_center().ofs(Offset::x(dots_offset));
let pp_len = self.textbox.count();
### core/embed/rust/src/ui/layout_eckhart/firmware/keyboard/passphrase.rs
@@ -143,10 +143,7 @@ impl PassphraseInput {
let dashes_offset = theme::ICON_EYE.toif.width()
+ Self::EYE_ICON_SPACE
- + EyeHintAnimation::offset(
- EyeHintAnimation::content_progress(eye_progress),
- Self::DASHES_SLIDE,
- );
+ + EyeHintAnimation::offset(eye_progress, Self::DASHES_SLIDE);
let mut cursor = hidden_area.left_center().ofs(Offset::x(dashes_offset));
// Number of visible icons + charactersWhy this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.