feat(core/caesar): make more nav consistent
What changed, and why it matters
This commit is a user-interface cleanup for the Trezor hardware wallet's 'Caesar' layout. It removes unused button styles, unifies how on-screen menus and pagination work, and moves some confirmation screens from Rust into Python so they behave consistently with other models. There is no indication of a security bug or fix.
No security action required. Treat as a normal UI consistency refactor and review through standard QA.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch refactors UI layout code in the Caesar (Trezor Safe 3 / similar monochrome-screen) firmware. Key changes: (1) deletes several unused ButtonLayout/ButtonActions helpers in Rust; (2) replaces the boolean external_menu parameter with an Option<MenuNav> to distinguish a normal menu from a choice menu; (3) reimplements confirm_coinjoin, confirm_modify_fee, and confirm_more flows in Python using shared confirm_properties/confirm_value helpers instead of bespoke Rust layouts; (4) updates pagination logic so long content is reviewed on a single screen with a menu option to skip review; (5) adjusts device-test input flows to match the new navigation model. No cryptographic, authorization, or memory-safety changes are present.
Changed components
core/embed/rust/src/ui/layout_caesar/component/button.rscore/embed/rust/src/ui/layout_caesar/theme/mod.rscore/embed/rust/src/ui/layout_caesar/ui_firmware.rscore/src/trezor/ui/layouts/caesar/__init__.pytests/input_flows.pyInspect captured patch +193 / −329
### core/embed/rust/src/ui/layout_caesar/component/button.rs
@@ -579,15 +579,6 @@ impl ButtonLayout {
)
}
- /// Left text and WIDE right arrow.
- pub fn text_none_arrow_wide(text: TString<'static>) -> Self {
- Self::new(
- Some(ButtonDetails::from_text_possible_icon(text)),
- None,
- Some(ButtonDetails::down_arrow_icon_wide()),
- )
- }
-
/// Only right text.
pub fn none_none_text(text: TString<'static>) -> Self {
Self::new(
@@ -615,15 +606,6 @@ impl ButtonLayout {
)
}
- /// Up arrow left and right text.
- pub fn up_arrow_none_text(text: TString<'static>) -> Self {
- Self::new(
- Some(ButtonDetails::up_arrow_icon()),
- None,
- Some(ButtonDetails::from_text_possible_icon(text)),
- )
- }
-
/// Cancel cross on left and right arrow.
pub fn cancel_none_arrow() -> Self {
Self::new(
@@ -633,24 +615,6 @@ impl ButtonLayout {
)
}
- /// Cancel cross on left and right arrow facing down.
- pub fn cancel_none_arrow_wide() -> Self {
- Self::new(
- Some(ButtonDetails::cancel_icon()),
- None,
- Some(ButtonDetails::down_arrow_icon_wide()),
- )
- }
-
- /// Up arrow on left and right arrow facing down.
- pub fn up_arrow_none_arrow_wide() -> Self {
- Self::new(
- Some(ButtonDetails::up_arrow_icon()),
- None,
- Some(ButtonDetails::down_arrow_icon_wide()),
- )
- }
-
/// Cancel cross on left and right arrow facing down.
pub fn cancel_none_arrow_down() -> Self {
Self::new(
@@ -761,15 +725,6 @@ impl ButtonActions {
)
}
- /// Previous with left, confirming with right
- pub fn prev_none_confirm() -> Self {
- Self::new(
- Some(ButtonAction::PrevPage),
- None,
- Some(ButtonAction::Confirm),
- )
- }
-
/// Previous with left, confirming with middle
pub fn prev_confirm_none() -> Self {
Self::new(
@@ -813,15 +768,6 @@ impl ButtonActions {
)
}
- /// Cancelling with left, going to the next page with right
- pub fn cancel_none_next() -> Self {
- Self::new(
- Some(ButtonAction::Cancel),
- None,
- Some(ButtonAction::NextPage),
- )
- }
-
/// Only going to the next page with right
pub fn none_none_next() -> Self {
Self::new(None, None, Some(ButtonAction::NextPage))
@@ -832,11 +778,6 @@ impl ButtonActions {
Self::new(None, Some(ButtonAction::NextPage), None)
}
- /// Only going to the prev page with left
- pub fn prev_none_none() -> Self {
- Self::new(Some(ButtonAction::PrevPage), None, None)
- }
-
/// Cancelling with left, confirming with right
pub fn cancel_none_confirm() -> Self {
Self::new(
@@ -855,15 +796,6 @@ impl ButtonActions {
)
}
- /// Cancelling with left and confirming with middle
- pub fn cancel_confirm_none() -> Self {
- Self::new(
- Some(ButtonAction::Cancel),
- Some(ButtonAction::Confirm),
- None,
- )
- }
-
/// Going to the beginning with left, confirming with right
pub fn beginning_none_confirm() -> Self {
Self::new(
### core/embed/rust/src/ui/layout_caesar/theme/mod.rs
@@ -45,15 +45,9 @@ pub const TEXT_MONO: TextStyle = TextStyle::new(fonts::FONT_MONO, FG, BG, FG, FG
.with_page_breaking(PageBreaking::CutAndInsertEllipsisBoth)
.with_ellipsis_icon(ICON_NEXT_PAGE, ELLIPSIS_ICON_MARGIN)
.with_prev_page_icon(ICON_PREV_PAGE, PREV_PAGE_ICON_MARGIN);
-pub const TEXT_MONO_WITH_CLASSIC_ELLIPSIS: TextStyle =
- TextStyle::new(fonts::FONT_MONO, FG, BG, FG, FG)
- .with_page_breaking(PageBreaking::CutAndInsertEllipsisBoth)
- .with_prev_page_icon(ICON_PREV_PAGE, PREV_PAGE_ICON_MARGIN);
/// Mono data text does not have hyphens
pub const TEXT_MONO_DATA: TextStyle =
TEXT_MONO.with_line_breaking(LineBreaking::BreakWordsNoHyphen);
-pub const TEXT_MONO_DATA_WITH_CLASSIC_ELLIPSIS: TextStyle =
- TEXT_MONO_WITH_CLASSIC_ELLIPSIS.with_line_breaking(LineBreaking::BreakWordsNoHyphen);
pub const TEXT_MONO_ADDRESS_CHUNKS: TextStyle = TEXT_MONO_DATA
.with_chunks(MONO_CHUNKS)
.with_line_spacing(2)
### core/embed/rust/src/ui/layout_caesar/ui_firmware.rs
@@ -75,7 +75,7 @@ impl FirmwareUI for UICaesar {
verb.unwrap_or(TString::empty()),
verb_cancel,
hold,
- external_menu,
+ external_menu.then_some(MenuNav::Menu),
false,
)
}
@@ -147,7 +147,7 @@ impl FirmwareUI for UICaesar {
_subtitle: Option<TString<'static>>,
verb: Option<TString<'static>>,
verb_cancel: Option<TString<'static>>,
- _info: bool,
+ info: bool,
hold: bool,
chunkify: bool,
_page_counter: bool,
@@ -180,7 +180,14 @@ impl FirmwareUI for UICaesar {
verb.unwrap_or(TR::buttons__confirm.into()),
verb_cancel,
hold,
- external_menu,
+ // `info` is a menu with choices how to continue the flow
+ if external_menu {
+ Some(MenuNav::Menu)
+ } else if info {
+ Some(MenuNav::ChoiceMenu)
+ } else {
+ None
+ },
back_button,
)
}
@@ -207,32 +214,12 @@ impl FirmwareUI for UICaesar {
}
fn confirm_coinjoin(
- max_rounds: TString<'static>,
- max_feerate: TString<'static>,
- max_coordinator_fee_pct: TString<'static>,
+ _max_rounds: TString<'static>,
+ _max_feerate: TString<'static>,
+ _max_coordinator_fee_pct: TString<'static>,
) -> Result<impl LayoutMaybeTrace, Error> {
- let paragraphs = Paragraphs::new([
- // Decreasing bottom padding between paragraphs to fit one screen:
- Paragraph::new(&theme::TEXT_BOLD, TR::coinjoin__max_rounds).with_bottom_padding(2),
- Paragraph::new(&theme::TEXT_MONO, max_rounds),
- Paragraph::new(&theme::TEXT_BOLD, TR::coinjoin__max_mining_fee)
- .with_bottom_padding(2)
- .no_break(),
- Paragraph::new(&theme::TEXT_MONO, max_feerate).with_bottom_padding(2),
- // Shown in a separate screen:
- Paragraph::new(&theme::TEXT_BOLD, TR::coinjoin__max_coordinator_fee_pct),
- Paragraph::new(&theme::TEXT_MONO, max_coordinator_fee_pct),
- ]);
-
- content_in_button_page(
- TR::coinjoin__title.into(),
- paragraphs,
- TR::buttons__hold_to_confirm.into(),
- None,
- true,
- false,
- false,
- )
+ // Composed in Python from `confirm_properties`.
+ Err::<RootComponent<Empty, ModelUI>, Error>(Error::NotImplementedError)
}
fn confirm_emphasized(
@@ -321,39 +308,13 @@ impl FirmwareUI for UICaesar {
fn confirm_modify_fee(
_title: TString<'static>,
- sign: i32,
- user_fee_change: TString<'static>,
- total_fee_new: TString<'static>,
- fee_rate_amount: Option<TString<'static>>,
+ _sign: i32,
+ _user_fee_change: TString<'static>,
+ _total_fee_new: TString<'static>,
+ _fee_rate_amount: Option<TString<'static>>,
) -> Result<impl LayoutMaybeTrace, Error> {
- let (description, change) = match sign {
- s if s < 0 => (TR::modify_fee__decrease_fee, user_fee_change),
- s if s > 0 => (TR::modify_fee__increase_fee, user_fee_change),
- _ => (TR::modify_fee__no_change, "".into()),
- };
-
- let mut paragraphs_vec = ParagraphVecShort::new();
- paragraphs_vec
- .add(Paragraph::new(&theme::TEXT_BOLD, description))
- .add(Paragraph::new(&theme::TEXT_MONO, change))
- .add(Paragraph::new(&theme::TEXT_BOLD, TR::modify_fee__transaction_fee).no_break())
- .add(Paragraph::new(&theme::TEXT_MONO, total_fee_new));
-
- if let Some(fee_rate_amount) = fee_rate_amount {
- paragraphs_vec
- .add(Paragraph::new(&theme::TEXT_BOLD, TR::modify_fee__fee_rate).no_break())
- .add(Paragraph::new(&theme::TEXT_MONO, fee_rate_amount));
- }
-
- content_in_button_page(
- TR::modify_fee__title.into(),
- paragraphs_vec.into_paragraphs(),
- TR::buttons__confirm.into(),
- Some("".into()),
- false,
- false,
- false,
- )
+ // Composed in Python from `confirm_properties`.
+ Err::<RootComponent<Empty, ModelUI>, Error>(Error::NotImplementedError)
}
fn confirm_modify_output(
@@ -378,43 +339,23 @@ impl FirmwareUI for UICaesar {
TR::modify_amount__title.into(),
paragraphs,
TR::buttons__confirm.into(),
- Some("".into()),
- false,
- false,
+ None,
false,
+ Some(MenuNav::Menu),
+ // "Shift" + right button goes back to the address
+ true,
)
}
fn confirm_more(
- title: TString<'static>,
- button: TString<'static>,
+ _title: TString<'static>,
+ _button: TString<'static>,
_button_style_confirm: bool,
_hold: bool,
- items: Obj,
+ _items: Obj,
) -> Result<impl LayoutMaybeTrace, Error> {
- let mut paragraphs = ParagraphVecLong::new();
-
- for para in IterBuf::new().try_iterate(items)? {
- let [text, is_data]: [Obj; 2] = util::iter_into_array(para)?;
- let is_data = is_data.try_into()?;
- let style: &TextStyle = if is_data {
- &theme::TEXT_MONO_DATA
- } else {
- &theme::TEXT_NORMAL
- };
- let text: TString = text.try_into()?;
- paragraphs.add(Paragraph::new(style, text));
- }
-
- content_in_button_page(
- title,
- paragraphs.into_paragraphs(),
- button,
- Some("<".into()),
- false,
- false,
- false,
- )
+ // Long content is paginated in a single screen on this model.
+ Err::<RootComponent<Empty, ModelUI>, Error>(Error::NotImplementedError)
}
fn confirm_properties(
@@ -439,7 +380,7 @@ impl FirmwareUI for UICaesar {
button_text,
Some("".into()),
hold,
- external_menu,
+ external_menu.then_some(MenuNav::Menu),
false,
)
}
@@ -470,7 +411,7 @@ impl FirmwareUI for UICaesar {
button,
Some("".into()),
false,
- false,
+ None,
false,
)
}
@@ -625,7 +566,7 @@ impl FirmwareUI for UICaesar {
button,
Some("".into()),
false,
- false,
+ None,
false,
)?;
LayoutObj::new_root(layout)
@@ -672,52 +613,16 @@ impl FirmwareUI for UICaesar {
verb: TString<'static>,
items: Gc<List>,
) -> Result<impl LayoutMaybeTrace, Error> {
- // Cache the page count so that we can move `items` into the closure.
- let page_count = items.len();
-
- // Closure to lazy-load the information on given page index.
- // Done like this to allow arbitrarily many pages without
- // the need of any allocation here in Rust.
- let get_page = move |page_index| {
- let item_obj = unwrap!(items.get(page_index));
- let text = unwrap!(TString::try_from(item_obj));
-
- let (btn_layout, btn_actions) = if page_count == 1 {
- // There is only one page
- (
- ButtonLayout::cancel_none_text(verb),
- ButtonActions::cancel_none_confirm(),
- )
- } else if page_index == 0 {
- // First page
- (
- ButtonLayout::cancel_none_arrow_wide(),
- ButtonActions::cancel_none_next(),
- )
- } else if page_index == page_count - 1 {
- // Last page
- (
- ButtonLayout::up_arrow_none_text(verb),
- ButtonActions::prev_none_confirm(),
- )
- } else {
- // Page in the middle
- (
- ButtonLayout::up_arrow_none_arrow_wide(),
- ButtonActions::prev_none_next(),
- )
- };
-
- let mut ops = OpTextLayout::new(theme::TEXT_NORMAL);
- ops.add_text_with_font(text, fonts::FONT_NORMAL);
- let formatted = FormattedText::new(ops).vertically_centered();
-
- Page::new(btn_layout, btn_actions, formatted)
- };
-
- let pages = FlowPages::new(get_page, page_count);
- let layout = RootComponent::new(Flow::new(pages).with_common_title(title));
- Ok(layout)
+ // Each item on its own page.
+ let mut ops = OpTextLayout::new(theme::TEXT_NORMAL);
+ for (i, item) in IterBuf::new().try_iterate(items.into())?.enumerate() {
+ if i > 0 {
+ ops.add_next_page();
+ }
+ ops.add_text_with_font(TString::try_from(item)?, fonts::FONT_NORMAL);
+ }
+ let formatted = FormattedText::new(ops).vertically_centered();
+ content_in_button_page(title, formatted, verb, Some("".into()), false, None, false)
}
fn prompt_backup() -> Result<impl LayoutMaybeTrace, Error> {
@@ -1017,7 +922,7 @@ impl FirmwareUI for UICaesar {
TR::buttons__continue.into(),
None,
false,
- false,
+ None,
false,
)
}
@@ -1397,17 +1302,17 @@ const DOWN_ARROW: &str = "V";
/// Has optional title (supply empty `TString` for that) and hold-to-confirm
/// functionality.
///
-/// With `external_menu`, the left button opens the context menu, and with
-/// `back_button` also "Shift" + right button on the first page goes back to the
-/// previous screen. Otherwise, an empty `verb_cancel` puts a cross cancelling
-/// the flow on the left.
+/// With `menu`, the left button opens the context menu, and with `back_button`
+/// also "Shift" + right button on the first page goes back to the previous
+/// screen. Otherwise, an empty `verb_cancel` puts a cross cancelling the flow
+/// on the left.
fn content_in_button_page<T: Component + Paginate + MaybeTrace + 'static>(
title: TString<'static>,
content: T,
verb: TString<'static>,
verb_cancel: Option<TString<'static>>,
hold: bool,
- external_menu: bool,
+ menu: Option<MenuNav>,
back_button: bool,
) -> Result<impl LayoutMaybeTrace, Error> {
// Right button - down arrow, text or nothing.
@@ -1424,8 +1329,8 @@ fn content_in_button_page<T: Component + Paginate + MaybeTrace + 'static>(
}
let mut content = ButtonPage::new(content, theme::BG).with_confirm_btn(confirm_btn);
- if external_menu {
- content = content.with_menu_nav(MenuNav::Menu);
+ if let Some(menu) = menu {
+ content = content.with_menu_nav(menu);
if back_button {
content = content.with_back_on_first_page();
}
### core/src/trezor/ui/layouts/caesar/__init__.py
@@ -606,24 +606,20 @@ async def _task() -> None:
refund_account_items,
)
)
- if menu_items:
- with trezorui_api.confirm_with_info(
- title=title,
- items=[(TR.words__provider, True), (recipient_name, False)],
- verb=TR.buttons__continue,
- external_menu=True,
- ) as main_layout:
+ with trezorui_api.confirm_properties(
+ title=title,
+ items=with_colon([(TR.words__provider, recipient_name, True)]),
+ verb=TR.buttons__continue,
+ external_menu=bool(menu_items),
+ ) as main_layout:
+ if menu_items:
await confirm_with_menu(
main_layout,
_menu_with_cancel(menu_items, TR.buttons__cancel_sign),
"confirm_payment_request",
)
- else:
- await confirm_properties(
- "confirm_payment_request",
- title,
- [(TR.words__provider, recipient_name, True)],
- )
+ else:
+ await raise_if_not_confirmed(main_layout, "confirm_payment_request")
# Allow GC to free the objects allocated above.
await _task()
@@ -815,64 +811,76 @@ async def confirm_blob(
hold=hold,
chunkify=chunkify,
) as layout:
- if ask_pagination and layout.page_count() > 1:
- assert not hold
- return await _confirm_ask_pagination(
- br_name,
- title,
- data,
- description or "",
- br_code,
- extra_confirmation_if_not_read,
- )
- else:
+ if not ask_pagination or layout.page_count() <= 1:
return await raise_if_not_confirmed(layout, br_name, br_code)
+ await _confirm_ask_pagination(
+ br_name,
+ title,
+ data,
+ description,
+ verb=verb,
+ hold=hold,
+ br_code=br_code,
+ chunkify=chunkify,
+ # a text (not an icon) labels the cancel menu item
+ cancel=verb_cancel if verb_cancel and len(verb_cancel) > 1 else None,
+ extra_confirmation_if_not_read=extra_confirmation_if_not_read,
+ )
+
async def _confirm_ask_pagination(
br_name: str,
title: str,
data: StrOrBytes,
- description: str,
+ description: str | None,
+ *,
+ verb: str | None,
+ hold: bool,
br_code: ButtonRequestType,
- extra_confirmation_if_not_read: bool = False,
+ chunkify: bool,
+ cancel: str | None,
+ extra_confirmation_if_not_read: bool,
) -> None:
- data = utils.hexlify_if_bytes(data)
+ """Long content paginated on a single screen. Confirming it without reading
+ all the pages is in the menu."""
+ from trezor.ui.layouts.menu import MenuLeaf, MenuResult, interact_with_menu
- with trezorui_api.confirm_more(
+ async def skip_review() -> bool:
+ return True
+
+ menu = _menu_with_cancel(
+ [MenuLeaf(TR.sign_message__confirm_without_review, skip_review)], cancel
+ )
+ with trezorui_api.confirm_value(
title=title,
- button=TR.buttons__confirm,
- items=[(description, False), (data, True)],
- ) as confirm_more_layout:
+ description=description,
+ value=data,
+ verb=verb or TR.buttons__confirm,
+ hold=hold,
+ chunkify=chunkify,
+ info=True, # menu with the choice to skip the review
+ ) as layout:
while True:
- if not await should_show_more(
- title,
- para=[(description, False), (data, True)],
- br_name=br_name,
- br_code=br_code,
- ):
- if extra_confirmation_if_not_read:
- try:
- await confirm_value(
- title,
- TR.sign_message__confirm_without_review,
- None,
- br_name=br_name,
- br_code=br_code,
- verb=TR.buttons__confirm,
- verb_cancel="^",
- hold=True,
- is_data=False,
- )
- except ActionCancelled:
- continue
+ result = await interact_with_menu(layout, menu, br_name, br_code)
+ if not isinstance(result, MenuResult) or not extra_confirmation_if_not_read:
+ return
+ # "Shift" + right button goes back to the content
+ with trezorui_api.confirm_value(
+ title=title,
+ value=TR.sign_message__confirm_without_review,
+ description=None,
+ verb=TR.buttons__confirm,
+ hold=True,
+ is_data=False,
+ external_menu=True,
+ back_button=True,
+ ) as skip_layout:
+ result = await interact_with_menu(
+ skip_layout, _menu_with_cancel([], cancel), br_name, br_code
+ )
+ if result is trezorui_api.CONFIRMED:
return
-
- result = await interact(confirm_more_layout, br_name, br_code, None)
- if result is trezorui_api.CANCELLED:
- continue
- else:
- break
def confirm_address(
@@ -2280,38 +2288,35 @@ async def confirm_modify_output(
amount_change: str,
amount_new: str,
) -> None:
+ from trezor.ui.layouts.menu import interact_with_menu
+
+ from ..common import confirm_linear_flow
+
+ menu = _menu_with_cancel([], TR.buttons__cancel_sign)
+
address_ctx = trezorui_api.confirm_value(
title=TR.modify_amount__title,
value=address,
verb=TR.buttons__continue,
description=with_colon(TR.words__address),
+ external_menu=True,
)
-
+ # "Shift" + right button goes back to the address
modify_ctx = trezorui_api.confirm_modify_output(
sign=sign,
amount_change=amount_change,
amount_new=amount_new,
)
with address_ctx as address_layout, modify_ctx as modify_layout:
- send_button_request = True
- while True:
- await raise_if_not_confirmed(
- address_layout,
- "modify_output" if send_button_request else None,
- ButtonRequestType.ConfirmOutput,
- )
- try:
- await raise_if_not_confirmed(
- modify_layout,
- "modify_output" if send_button_request else None,
- ButtonRequestType.ConfirmOutput,
- )
- except ActionCancelled:
- send_button_request = False
- continue
- else:
- break
+ await confirm_linear_flow(
+ lambda: interact_with_menu(
+ address_layout, menu, "modify_output", ButtonRequestType.ConfirmOutput
+ ),
+ lambda: interact_with_menu(
+ modify_layout, menu, "modify_output", ButtonRequestType.ConfirmOutput
+ ),
+ )
async def confirm_modify_fee(
@@ -2321,27 +2326,57 @@ async def confirm_modify_fee(
total_fee_new: str,
fee_rate_amount: str | None = None,
) -> None:
- with trezorui_api.confirm_modify_fee(
- title=title,
- sign=sign,
- user_fee_change=user_fee_change,
- total_fee_new=total_fee_new,
- fee_rate_amount=fee_rate_amount,
- ) as layout:
- return await raise_if_not_confirmed(
- layout, "modify_fee", ButtonRequestType.SignTx
+ from trezor.ui.layouts.menu import confirm_with_menu
+
+ if sign < 0:
+ description = TR.modify_fee__decrease_fee
+ elif sign > 0:
+ description = TR.modify_fee__increase_fee
+ else:
+ description, user_fee_change = TR.modify_fee__no_change, ""
+ items: list[PropertyType] = [
+ (description, user_fee_change or None, True),
+ (TR.modify_fee__transaction_fee, total_fee_new, True),
+ ]
+ menu_items = []
+ if fee_rate_amount:
+ menu_items.append(
+ create_info_menu_leaf(
+ TR.confirm_total__title_fee,
+ [(TR.modify_fee__fee_rate, fee_rate_amount, True)],
+ )
)
+ with trezorui_api.confirm_properties(
+ title=TR.modify_fee__title,
+ items=items,
+ external_menu=bool(menu_items),
+ ) as layout:
+ if menu_items:
+ await confirm_with_menu(
+ layout,
+ _menu_with_cancel(menu_items, TR.buttons__cancel_sign),
+ "modify_fee",
+ ButtonRequestType.SignTx,
+ )
+ else:
+ await raise_if_not_confirmed(layout, "modify_fee", ButtonRequestType.SignTx)
+
async def confirm_coinjoin(
max_rounds: int, max_fee_per_vbyte: str, max_coordinator_fee_pct: str
) -> None:
- with trezorui_api.confirm_coinjoin(
- max_rounds=str(max_rounds),
- max_feerate=max_fee_per_vbyte,
- max_coordinator_fee_pct=max_coordinator_fee_pct,
- ) as layout:
- return await raise_if_not_confirmed(layout, "coinjoin_final", BR_CODE_OTHER)
+ await confirm_properties(
+ "coinjoin_final",
+ TR.coinjoin__title,
+ [
+ (TR.coinjoin__max_rounds, str(max_rounds), True),
+ (TR.coinjoin__max_mining_fee, max_fee_per_vbyte, True),
+ (TR.coinjoin__max_coordinator_fee_pct, max_coordinator_fee_pct, True),
+ ],
+ hold=True,
+ br_code=BR_CODE_OTHER,
+ )
# TODO cleanup @ redesign
@@ -2430,6 +2465,7 @@ async def confirm_signverify(
TR.sign_message__confirm_message,
message,
br_code=BR_CODE_OTHER,
+ hold=not verify,
ask_pagination=True,
# signing without reading the whole message is held to confirm
extra_confirmation_if_not_read=not verify,
### tests/input_flows.py
@@ -404,23 +404,21 @@ def input_flow_caesar(self) -> BRGeneratorType:
yield
self.debug.press_yes()
+ # paginate through the whole message and confirm it
br = yield
- # "Show all" from the menu
- self.debug.press_left()
- self.debug.button_actions.navigate_to_menu_item(0)
-
- # paginate through the whole message
- br = yield
- # TODO: try load the message_read the same way as in UI bolt (T)
- if br.pages is not None:
- for i in range(br.pages):
- if i < br.pages - 1:
- self.debug.swipe_up()
+ layouts: list[LayoutContent] = []
+ assert br.pages is not None
+ for i in range(br.pages):
+ layouts.append(self.debug.read_layout())
+ if i < br.pages - 1:
+ self.debug.swipe_up()
+ self.message_read = multipage_content(layouts)
self.debug.press_yes()
- # confirm message
- yield
- self.debug.press_yes()
+ if self.verify:
+ # "The signature is valid!" screen
+ br = yield
+ self.debug.press_yes()
def input_flow_delizia(self) -> BRGeneratorType:
# collect screen contents into `message_read`.
@@ -1626,9 +1624,8 @@ def input_flow_caesar(self) -> BRGeneratorType:
yield # modify amount - amount
self.debug.press_right()
yield # modify fee
- self.debug.press_right()
- self.debug.press_right()
- self.debug.press_right()
+ for _ in range(self.debug.read_layout().page_count()):
+ self.debug.press_right()
def input_flow_delizia(self) -> BRGeneratorType:
yield # confirm txidWhy 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.