What changed, and why it matters
This commit adjusts how a progress screen on the Trezor device lays out its title text. It makes the title area taller when translations wrap to multiple lines, and re-centers the loading spinner so it does not sit too close to a wrapped title. There is no security-relevant change visible in the code.
No security action needed. Treat as a normal UI/layout fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is purely UI layout logic in the Caesar layout’s Progress component. It replaces a fixed title height based on max_size().y with a dynamic height computed from text_height(AREA.width()), and computes the loader’s vertical offset conditionally: fixed offset for single-line titles, centered between title and description for multi-line titles, and fixed offset when there is no title. The diff also updates UI test fixtures, which is consistent with a visual-only change.
Changed components
core/embed/rust/src/ui/layout_caesar/component/progress.rsInspect captured patch +309 / −291
### core/embed/rust/src/ui/layout_caesar/component/progress.rs
@@ -77,21 +77,39 @@ impl Component for Progress {
.content()
.map(|t| t.chars().filter(|c| *c == '\n').count() as i16);
- let no_title_case = (Rect::zero(), Self::AREA, LOADER_Y_OFFSET_NO_TITLE);
- let (title, rest, loader_y_offset) = if let Some(self_title) = &self.title {
+ let no_title_case = (Rect::zero(), Self::AREA);
+ let (title, rest, single_line_title) = if let Some(self_title) = &self.title {
if !self_title.inner().text().is_empty() {
- let (title, rest) = Self::AREA.split_top(self_title.inner().max_size().y);
- (title, rest, LOADER_Y_OFFSET_TITLE)
+ // Give the title as much height as it needs when wrapped to
+ // the screen width, so that longer translations do not
+ // overflow the (otherwise single-line) title area.
+ let title_height = self_title.inner().text_height(Self::AREA.width());
+ let (title, rest) = Self::AREA.split_top(title_height);
+ let single_line = title_height <= self_title.inner().max_size().y;
+ (title, rest, single_line)
} else {
- no_title_case
+ let (title, rest) = no_title_case;
+ (title, rest, false)
}
} else {
- no_title_case
+ let (title, rest) = no_title_case;
+ (title, rest, false)
};
- let (_loader, description) = rest.split_bottom(
+ let (loader, description) = rest.split_bottom(
BOTTOM_DESCRIPTION_MARGIN + fonts::FONT_NORMAL.line_height() * description_lines,
);
+ let loader_y_offset = if single_line_title {
+ LOADER_Y_OFFSET_TITLE
+ } else if !title.is_empty() {
+ // The title wraps to multiple lines, so the tuned fixed offset
+ // would place the loader too close to the title. Center the
+ // loader in the space between the title and the description
+ // instead.
+ loader.center().y - Self::AREA.center().y
+ } else {
+ LOADER_Y_OFFSET_NO_TITLE
+ };
self.title.place(title);
self.loader_y_offset = loader_y_offset;
self.description.place(description);
### tests/ui_tests/fixtures.json
[binary or diff unavailable]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.