refactor(core/caesar): rm unused ButtonPage builders
What changed, and why it matters
This is a routine code cleanup. The developer removed two unused configuration options (back button and next button) from a screen-page component in the Trezor firmware's user interface. The buttons are now created directly where needed, with the same up-arrow and down-arrow icons as before. There is no functional change and no security relevance.
No security action needed. Treat as a normal refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors core/embed/rust/src/ui/layout_caesar/component/page.rs. It deletes the back_btn_details and next_btn_details fields from the ButtonPage builder struct, removes their builder methods (with_back_btn, with_next_btn), and inlines the previously default values (ButtonDetails::up_arrow_icon() and ButtonDetails::down_arrow_icon_wide()) at the two call sites. The behavior is identical; this is dead-code elimination after a navigation redesign.
Changed components
core/embed/rust/src/ui/layout_caesar/component/page.rsInspect captured patch +2 / −16
### core/embed/rust/src/ui/layout_caesar/component/page.rs
@@ -38,8 +38,6 @@ where
confirm_btn_details: Option<ButtonDetails>,
/// Middle button, confirming (without menu navigation only).
middle_btn_details: Option<ButtonDetails>,
- back_btn_details: Option<ButtonDetails>,
- next_btn_details: Option<ButtonDetails>,
/// Menu navigation, replacing the cancel/back/next buttons.
menu_nav: Option<MenuNav>,
/// Whether "Shift" + right button on the first page goes back to the
@@ -61,8 +59,6 @@ where
cancel_btn_details: Some(ButtonDetails::cancel_icon()),
confirm_btn_details: Some(ButtonDetails::text(TR::buttons__confirm.into())),
middle_btn_details: None,
- back_btn_details: Some(ButtonDetails::up_arrow_icon()),
- next_btn_details: Some(ButtonDetails::down_arrow_icon_wide()),
menu_nav: None,
back_on_first_page: false,
shift_active: false,
@@ -112,16 +108,6 @@ where
self
}
- pub fn with_back_btn(mut self, btn_details: Option<ButtonDetails>) -> Self {
- self.back_btn_details = btn_details;
- self
- }
-
- pub fn with_next_btn(mut self, btn_details: Option<ButtonDetails>) -> Self {
- self.next_btn_details = btn_details;
- self
- }
-
/// Whether `PageMsg::Cancelled` means going back to the previous screen
/// (see `with_back_on_first_page`) rather than cancelling.
pub fn cancelled_is_back(&self) -> bool {
@@ -170,10 +156,10 @@ where
let btn_left = if !has_prev {
self.cancel_btn_details.clone()
} else {
- self.back_btn_details.clone()
+ Some(ButtonDetails::up_arrow_icon())
};
let btn_right = if has_next {
- self.next_btn_details.clone()
+ Some(ButtonDetails::down_arrow_icon_wide())
} else {
self.confirm_btn_details.clone()
};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.