From eb395000dc14d6fbe48bb8cd938aed6afdea5f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ioan=20Biz=C4=83u?= Date: Thu, 15 May 2025 16:13:14 +0200 Subject: [PATCH] fix(delizia): use "tap" instruction on warnings [no changelog] --- core/embed/rust/librust_qstr.h | 1 + .../src/translations/generated/translated_string.rs | 3 +++ .../rust/src/ui/layout_delizia/component/frame.rs | 8 ++++++++ .../rust/src/ui/layout_delizia/flow/show_danger.rs | 2 +- core/embed/rust/src/ui/layout_delizia/ui_firmware.rs | 12 +++++------- core/mocks/trezortranslate_keys.pyi | 1 + core/translations/cs.json | 1 + core/translations/de.json | 1 + core/translations/en.json | 1 + core/translations/es.json | 1 + core/translations/fr.json | 1 + core/translations/it.json | 1 + core/translations/order.json | 3 ++- core/translations/pt.json | 1 + core/translations/signatures.json | 6 +++--- 15 files changed, 31 insertions(+), 12 deletions(-) diff --git a/core/embed/rust/librust_qstr.h b/core/embed/rust/librust_qstr.h index 851e2fb3fe..d8a0a322bc 100644 --- a/core/embed/rust/librust_qstr.h +++ b/core/embed/rust/librust_qstr.h @@ -317,6 +317,7 @@ static void _librust_qstrs(void) { MP_QSTR_instructions__shares_start_with_1; MP_QSTR_instructions__swipe_down; MP_QSTR_instructions__swipe_horizontally; + MP_QSTR_instructions__tap; MP_QSTR_instructions__tap_to_confirm; MP_QSTR_instructions__tap_to_continue; MP_QSTR_instructions__tap_to_start; diff --git a/core/embed/rust/src/translations/generated/translated_string.rs b/core/embed/rust/src/translations/generated/translated_string.rs index 62fc49f432..6f4fb55543 100644 --- a/core/embed/rust/src/translations/generated/translated_string.rs +++ b/core/embed/rust/src/translations/generated/translated_string.rs @@ -1415,6 +1415,7 @@ pub enum TranslatedString { ethereum__approve_revoke_from = 1011, // "Revoke from" words__chain = 1012, // "Chain" words__token = 1013, // "Token" + instructions__tap = 1014, // "Tap" } impl TranslatedString { @@ -2823,6 +2824,7 @@ impl TranslatedString { (Self::ethereum__approve_revoke_from, "Revoke from"), (Self::words__chain, "Chain"), (Self::words__token, "Token"), + (Self::instructions__tap, "Tap"), ]; #[cfg(feature = "micropython")] @@ -3453,6 +3455,7 @@ impl TranslatedString { (Qstr::MP_QSTR_instructions__shares_start_with_1, Self::instructions__shares_start_with_1), (Qstr::MP_QSTR_instructions__swipe_down, Self::instructions__swipe_down), (Qstr::MP_QSTR_instructions__swipe_horizontally, Self::instructions__swipe_horizontally), + (Qstr::MP_QSTR_instructions__tap, Self::instructions__tap), (Qstr::MP_QSTR_instructions__tap_to_confirm, Self::instructions__tap_to_confirm), (Qstr::MP_QSTR_instructions__tap_to_continue, Self::instructions__tap_to_continue), (Qstr::MP_QSTR_instructions__tap_to_start, Self::instructions__tap_to_start), diff --git a/core/embed/rust/src/ui/layout_delizia/component/frame.rs b/core/embed/rust/src/ui/layout_delizia/component/frame.rs index 0eee6ad6b5..ba01517ead 100644 --- a/core/embed/rust/src/ui/layout_delizia/component/frame.rs +++ b/core/embed/rust/src/ui/layout_delizia/component/frame.rs @@ -198,6 +198,14 @@ where self } + #[cfg(feature = "translations")] + pub fn with_tap_footer(self, description: Option>) -> Self { + use crate::translations::TR; + + self.with_footer(TR::instructions__tap.into(), description) + .with_swipe(Direction::Up, SwipeSettings::default()) + } + #[cfg(feature = "translations")] pub fn with_swipeup_footer(self, description: Option>) -> Self { use crate::translations::TR; diff --git a/core/embed/rust/src/ui/layout_delizia/flow/show_danger.rs b/core/embed/rust/src/ui/layout_delizia/flow/show_danger.rs index af5d313cf0..2c2e7d8f17 100644 --- a/core/embed/rust/src/ui/layout_delizia/flow/show_danger.rs +++ b/core/embed/rust/src/ui/layout_delizia/flow/show_danger.rs @@ -75,7 +75,7 @@ pub fn new_show_danger( .into_paragraphs(); let content_message = Frame::left_aligned(title, SwipeContent::new(paragraphs)) .with_menu_button() - .with_swipeup_footer(Some(verb_cancel)) + .with_tap_footer(Some(verb_cancel)) .with_danger() .with_swipe(Direction::Left, SwipeSettings::default()) .map_to_button_msg(); diff --git a/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs b/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs index d91ef9c4bd..0061439e46 100644 --- a/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs +++ b/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs @@ -1097,16 +1097,14 @@ impl FirmwareUI for UIDelizia { ]) .into_paragraphs(); - let frame = - Frame::left_aligned(title, SwipeContent::new(content)).with_swipeup_footer(action); - - let frame_with_icon = if danger { - frame.with_danger_icon() + let frame = Frame::left_aligned(title, SwipeContent::new(content)); + let frame = if danger { + frame.with_danger_icon().with_tap_footer(action) } else { - frame.with_warning_low_icon() + frame.with_warning_low_icon().with_swipeup_footer(action) }; - let layout = LayoutObj::new(SwipeUpScreen::new(frame_with_icon))?; + let layout = LayoutObj::new(SwipeUpScreen::new(frame))?; Ok(layout) } diff --git a/core/mocks/trezortranslate_keys.pyi b/core/mocks/trezortranslate_keys.pyi index f39900c44f..271f50e12c 100644 --- a/core/mocks/trezortranslate_keys.pyi +++ b/core/mocks/trezortranslate_keys.pyi @@ -400,6 +400,7 @@ class TR: instructions__shares_start_with_1: str = "Start with share #1" instructions__swipe_down: str = "Swipe down" instructions__swipe_horizontally: str = "Swipe horizontally" + instructions__tap: str = "Tap" instructions__tap_to_confirm: str = "Tap to confirm" instructions__tap_to_continue: str = "Tap to continue" instructions__tap_to_start: str = "Tap to start" diff --git a/core/translations/cs.json b/core/translations/cs.json index e6ba0c73ab..977e39a459 100644 --- a/core/translations/cs.json +++ b/core/translations/cs.json @@ -430,6 +430,7 @@ "instructions__shares_start_with_1": "Začněte částí č. 1", "instructions__swipe_down": "Přejeďte prstem dolů", "instructions__swipe_horizontally": "Přejeďte prstem vodorovně", + "instructions__tap": "Klepněte", "instructions__tap_to_confirm": "Klepnutím potvrďte", "instructions__tap_to_continue": "Klepnutím pokračujte", "instructions__tap_to_start": "Začněte klepnutím", diff --git a/core/translations/de.json b/core/translations/de.json index adf9207d65..a74e269c34 100644 --- a/core/translations/de.json +++ b/core/translations/de.json @@ -430,6 +430,7 @@ "instructions__shares_start_with_1": "Mit Share #1 beginnen", "instructions__swipe_down": "Nach unten wischen", "instructions__swipe_horizontally": "Zur Seite wischen", + "instructions__tap": "Tippen", "instructions__tap_to_confirm": "Zum Bestätigen tippen", "instructions__tap_to_continue": "Zum Fortfahren tippen", "instructions__tap_to_start": "Zum Beginnen tippen", diff --git a/core/translations/en.json b/core/translations/en.json index 5f289e04c0..d79e74201f 100644 --- a/core/translations/en.json +++ b/core/translations/en.json @@ -402,6 +402,7 @@ "instructions__shares_start_with_1": "Start with share #1", "instructions__swipe_down": "Swipe down", "instructions__swipe_horizontally": "Swipe horizontally", + "instructions__tap": "Tap", "instructions__tap_to_confirm": "Tap to confirm", "instructions__tap_to_continue": "Tap to continue", "instructions__tap_to_start": "Tap to start", diff --git a/core/translations/es.json b/core/translations/es.json index 437492cd13..f69c0d3905 100644 --- a/core/translations/es.json +++ b/core/translations/es.json @@ -430,6 +430,7 @@ "instructions__shares_start_with_1": "Empezar con el rec. n.º 1", "instructions__swipe_down": "Deslizar hacia abajo", "instructions__swipe_horizontally": "Deslizar en horizontal", + "instructions__tap": "Toca", "instructions__tap_to_confirm": "Toca para confirmar", "instructions__tap_to_continue": "Toca para continuar", "instructions__tap_to_start": "Toca para empezar", diff --git a/core/translations/fr.json b/core/translations/fr.json index 8cb3dae1b4..76258e00e0 100644 --- a/core/translations/fr.json +++ b/core/translations/fr.json @@ -430,6 +430,7 @@ "instructions__shares_start_with_1": "Commencez avec le fragment #1", "instructions__swipe_down": "Glisser vers le bas", "instructions__swipe_horizontally": "Glisser horizontalement", + "instructions__tap": "Appuyez", "instructions__tap_to_confirm": "Appuyez pour confirmer", "instructions__tap_to_continue": "Appuyez pour continuer", "instructions__tap_to_start": "Appuyez pour démarrer", diff --git a/core/translations/it.json b/core/translations/it.json index 0b8219e77f..103088560a 100644 --- a/core/translations/it.json +++ b/core/translations/it.json @@ -430,6 +430,7 @@ "instructions__shares_start_with_1": "Inizia con azione n. 1", "instructions__swipe_down": "Scorri in basso", "instructions__swipe_horizontally": "Scorri in orizzontale", + "instructions__tap": "Tocca", "instructions__tap_to_confirm": "Tocca e conferma", "instructions__tap_to_continue": "Tocca e continua", "instructions__tap_to_start": "Tocca e inizia", diff --git a/core/translations/order.json b/core/translations/order.json index 1ebd729235..141192d347 100644 --- a/core/translations/order.json +++ b/core/translations/order.json @@ -1012,5 +1012,6 @@ "1010": "ethereum__approve_revoke", "1011": "ethereum__approve_revoke_from", "1012": "words__chain", - "1013": "words__token" + "1013": "words__token", + "1014": "instructions__tap" } diff --git a/core/translations/pt.json b/core/translations/pt.json index 135a79b6a8..99c78fcf7b 100644 --- a/core/translations/pt.json +++ b/core/translations/pt.json @@ -430,6 +430,7 @@ "instructions__shares_start_with_1": "Começar com cota nº1", "instructions__swipe_down": "Deslizar para baixo", "instructions__swipe_horizontally": "Deslizar horizontalmente", + "instructions__tap": "Toque", "instructions__tap_to_confirm": "Toque para confirmar", "instructions__tap_to_continue": "Toque para continuar", "instructions__tap_to_start": "Toque para iniciar", diff --git a/core/translations/signatures.json b/core/translations/signatures.json index 59e0050f0c..614134176e 100644 --- a/core/translations/signatures.json +++ b/core/translations/signatures.json @@ -1,8 +1,8 @@ { "current": { - "merkle_root": "b0b4e9158f15d387ed0091716fca17b9523500faff4157b54084991c8db7a868", - "datetime": "2025-05-20T12:48:17.683102", - "commit": "51edc03279e8bef1ad676e2f998309ee4e190fcb" + "merkle_root": "79fb1a2c2306a6acfe7a3261825ff3c8027b2820182ac5092a2974735ebb7657", + "datetime": "2025-05-21T07:22:44.247257", + "commit": "be096b28adbe7c354dd502167c52e09be81140e2" }, "history": [ {