refactor(core/ui): standard page for Caesar mismatch
What changed, and why it matters
This commit is a user-interface code cleanup. It replaces a hand-built screen layout with a standard helper used by other screens in the same product line. The visible text and button behavior (a 'Quit' button on an address-mismatch warning) stay the same. There is no security-relevant change in the diff.
No security action needed; treat as a normal UI refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change refactors show_mismatch in core/embed/rust/src/ui/layout_caesar/ui_firmware.rs to use content_in_button_page instead of a manually constructed single-page Flow. The displayed paragraphs (addr_mismatch__contact_support_at and addr_mismatch__support_url) and the quit button are unchanged. The test update only changes the synchronization marker from ‘Flow’ to ‘Paragraphs’ to match the new implementation component.
Changed components
core/embed/rust/src/ui/layout_caesar/ui_firmware.rstests/input_flows.pyInspect captured patch +14 / −19
### core/embed/rust/src/ui/layout_caesar/ui_firmware.rs
@@ -1032,25 +1032,20 @@ impl FirmwareUI for UICaesar {
}
fn show_mismatch(title: TString<'static>) -> Result<impl LayoutMaybeTrace, Error> {
- let get_page = move |page_index| {
- assert!(page_index == 0);
-
- let btn_layout = ButtonLayout::arrow_none_text(TR::buttons__quit.into());
- let btn_actions = ButtonActions::cancel_none_confirm();
- let mut ops = OpTextLayout::new(theme::TEXT_NORMAL);
- ops.add_text_with_font(title, fonts::FONT_BOLD_UPPER)
- .add_newline()
- .add_newline_half()
- .add_text_with_font(TR::addr_mismatch__contact_support_at, fonts::FONT_NORMAL)
- .add_newline()
- .add_text_with_font(TR::addr_mismatch__support_url, fonts::FONT_BOLD);
- let formatted = FormattedText::new(ops);
- Page::new(btn_layout, btn_actions, formatted)
- };
- let pages = FlowPages::new(get_page, 1);
+ let paragraphs = Paragraphs::new([
+ Paragraph::new(&theme::TEXT_NORMAL, TR::addr_mismatch__contact_support_at),
+ Paragraph::new(&theme::TEXT_BOLD, TR::addr_mismatch__support_url),
+ ]);
- let obj = RootComponent::new(Flow::new(pages));
- Ok(obj)
+ content_in_button_page(
+ title,
+ paragraphs,
+ TR::buttons__quit.into(),
+ Some("<".into()),
+ false,
+ None,
+ false,
+ )
}
fn show_progress(
### tests/input_flows.py
@@ -509,7 +509,7 @@ def input_flow_caesar(self) -> BRGeneratorType:
self.debug.press_left()
self.debug.button_actions.navigate_to_menu_item(1)
# address mismatch? - "Quit" button aborts the flow
- self.debug.synchronize_at("Flow")
+ self.debug.synchronize_at("Paragraphs")
self.debug.press_right()
yield
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.