feat(core/eckhart): automatic hint counter for textscreen
What changed, and why it matters
This commit adds an automatic page counter hint to a text screen UI component in the Trezor firmware. It is a user-interface feature change, not a security fix or vulnerability. There is no indication it addresses any security issue.
No security action required. Treat as a normal UI feature commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change introduces a pagination_hint boolean to TextScreen in the Eckhart layout. When enabled and the content spans multiple pages and no other hint is present, the code dynamically creates a Hint::new_page_counter() and adjusts the content area layout. The only consumer updated is the receive address flow (receive.rs), which now calls .with_pagination_hint() on the address screen. The commit is purely a UI/UX enhancement.
Changed components
core/embed/rust/src/ui/layout_eckhart/firmware/text_screen.rscore/embed/rust/src/ui/layout_eckhart/flow/receive.rsInspect captured patch +29 / −8
diff --git a/core/embed/rust/src/ui/layout_eckhart/firmware/text_screen.rs b/core/embed/rust/src/ui/layout_eckhart/firmware/text_screen.rs
index 8c2879af..ac34abd9 100644
--- a/core/embed/rust/src/ui/layout_eckhart/firmware/text_screen.rs
+++ b/core/embed/rust/src/ui/layout_eckhart/firmware/text_screen.rs
@@ -11,7 +11,7 @@ use crate::{
Component, Event, EventCtx, FormattedText, Label, Paginate, TextLayout,
},
flow::Swipable,
- geometry::{Offset, Rect},
+ geometry::{Insets, Offset, Rect},
shape::Renderer,
util::Pager,
},
@@ -38,6 +38,7 @@ pub struct TextScreen<T> {
action_bar: Option<ActionBar>,
page_limit: Option<u16>,
background: Option<ScreenBackground>,
+ pagination_hint: bool,
// TODO: swipe handling
// TODO: animations
}
@@ -65,6 +66,7 @@ where
action_bar: Some(ActionBar::new_paginate_only()),
page_limit: None,
background: None,
+ pagination_hint: false,
}
}
@@ -85,6 +87,11 @@ where
self
}
+ pub fn with_pagination_hint(mut self) -> Self {
+ self.pagination_hint = true;
+ self
+ }
+
pub fn with_action_bar(mut self, action_bar: ActionBar) -> Self {
self.action_bar = Some(action_bar);
self
@@ -167,7 +174,7 @@ where
rest
};
- let mut content_area = if let Some(hint) = &mut self.hint {
+ let rest = if let Some(hint) = &mut self.hint {
let (rest, hint_area) = rest.split_bottom(hint.height());
hint.place(hint_area);
rest
@@ -175,16 +182,29 @@ where
rest
};
- // Introduce side insets + top padding if the header is not present
- content_area = if self.header.is_none() {
- content_area.inset(CONTENT_INSETS_NO_HEADER)
- } else {
- content_area.inset(SIDE_INSETS)
+ let compute_content_area = |area: Rect, has_header: bool| {
+ let mut area = area.inset(SIDE_INSETS);
+ if !has_header {
+ area = area.inset(Insets::top(CONTENT_INSETS_NO_HEADER.top));
+ }
+ area
};
+ // Introduce side insets + top padding if the header is not present
+ let content_area = compute_content_area(rest, self.header.is_some());
self.content.place(content_area);
-
self.update_page(0);
+
+ if self.pagination_hint && self.hint.is_none() && self.content.pager().total() > 1 {
+ let mut hint = Hint::new_page_counter();
+ let (rest, hint_area) = rest.split_bottom(hint.height());
+ hint.place(hint_area);
+ self.hint = Some(hint);
+ let content_area = compute_content_area(rest, self.header.is_some());
+ self.content.place(content_area);
+ self.update_page(0);
+ }
+
bounds
}
diff --git a/core/embed/rust/src/ui/layout_eckhart/flow/receive.rs b/core/embed/rust/src/ui/layout_eckhart/flow/receive.rs
index 4204fcf1..93da62fd 100644
--- a/core/embed/rust/src/ui/layout_eckhart/flow/receive.rs
+++ b/core/embed/rust/src/ui/layout_eckhart/flow/receive.rs
@@ -129,6 +129,7 @@ pub fn new_receive(
)
.with_header(Header::new(title).with_menu_button())
.with_subtitle(subtitle.unwrap_or(TString::empty()))
+ .with_pagination_hint()
.with_action_bar(ActionBar::new_single(button));
if let Some(hint) = hint {
address_screen = address_screen.with_hint(Hint::new_warning_caution(hint));
Why 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.