1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-17 21:22:10 +00:00

chore(core): change some UI text and TR's screens to match the Figma designs

[no changelog]
This commit is contained in:
grdddj 2023-08-07 13:07:36 +02:00 committed by Jiří Musil
parent 59ba113b07
commit 8d78dd8872
13 changed files with 51 additions and 55 deletions

View File

@ -496,7 +496,7 @@ extern "C" fn new_confirm_value(n_args: usize, args: *const Obj, kwargs: *mut Ma
title,
paragraphs,
verb.unwrap_or_else(|| "CONFIRM".into()),
None,
Some("".into()),
hold,
)
};
@ -519,7 +519,7 @@ extern "C" fn new_confirm_joint_total(n_args: usize, args: *const Obj, kwargs: *
"JOINT TRANSACTION".into(),
paragraphs,
"HOLD TO CONFIRM".into(),
None,
Some("".into()),
true,
)
};
@ -552,7 +552,7 @@ extern "C" fn new_confirm_modify_output(n_args: usize, args: *const Obj, kwargs:
"MODIFY AMOUNT".into(),
paragraphs,
"CONFIRM".into(),
None,
Some("".into()),
false,
)
};

View File

@ -263,8 +263,8 @@ async def confirm_unverified_external_input() -> None:
await layouts.show_warning(
"unverified_external_input",
"The transaction contains unverified external inputs.",
"Proceed anyway?",
button="Proceed",
"Continue anyway?",
button="Continue",
br_code=ButtonRequestType.SignTx,
)
@ -276,16 +276,16 @@ async def confirm_nondefault_locktime(lock_time: int, lock_time_disabled: bool)
await layouts.show_warning(
"nondefault_locktime",
"Locktime is set but will have no effect.",
"Proceed anyway?",
button="Proceed",
"Continue anyway?",
button="Continue",
br_code=ButtonRequestType.SignTx,
)
else:
if lock_time < _LOCKTIME_TIMESTAMP_MIN_VALUE:
text = "Locktime for this transaction is set to blockheight:"
text = "Locktime set to blockheight:"
value = str(lock_time)
else:
text = "Locktime for this transaction is set to:"
text = "Locktime set to:"
value = format_timestamp(lock_time)
await layouts.confirm_value(
"Confirm locktime",

View File

@ -16,8 +16,8 @@ async def get_next_u2f_counter(msg: GetNextU2FCounter) -> NextU2FCounter:
await confirm_action(
"get_u2f_counter",
"Get next U2F counter",
description="Do you really want to increase and retrieve the U2F counter?",
"Get U2F counter",
description="Increase and retrieve the U2F counter?",
br_code=ButtonRequestType.ProtectCall,
)

View File

@ -61,8 +61,9 @@ async def recovery_device(msg: RecoveryDevice) -> Success:
await confirm_action(
"confirm_seedcheck",
"Backup check",
description="Do you really want to check the recovery seed?",
description="Check your backup?",
br_code=ButtonRequestType.ProtectCall,
verb="Check",
)
# END _continue_dialog
# --------------------------------------------------------

View File

@ -20,16 +20,18 @@ async def _confirm_abort(dry_run: bool = False) -> None:
if dry_run:
await confirm_action(
"abort_recovery",
"Abort backup check",
description="Do you really want to abort the backup check?",
"Cancel backup check",
description="Are you sure you want to cancel the backup check?",
verb="CANCEL",
br_code=ButtonRequestType.ProtectCall,
)
else:
await confirm_action(
"abort_recovery",
"Abort recovery",
"Cancel recovery",
"All progress will be lost.",
"Do you really want to abort the recovery process?",
"Are you sure you want to cancel the recovery process?",
verb="CANCEL",
reverse=True,
br_code=ButtonRequestType.ProtectCall,
)

View File

@ -19,8 +19,9 @@ async def set_u2f_counter(msg: SetU2FCounter) -> Success:
await confirm_action(
"set_u2f_counter",
"Set U2F counter",
description="Do you really want to set the U2F counter to {}?",
description="Set the U2F counter to {}?",
description_param=str(msg.u2f_counter),
verb="SET",
br_code=ButtonRequestType.ProtectCall,
)

View File

@ -15,7 +15,8 @@ async def list_resident_credentials(
await confirm_action(
"credentials_list",
"List credentials",
description="Do you want to export information about the resident credentials stored on this device?",
description="Export information about the credentials stored on this device?",
verb="EXPORT",
)
creds = [
WebAuthnCredential(

View File

@ -634,7 +634,7 @@ def show_success(
# Special case for Shamir backup - to show everything just on one page
# in regular font.
if "Continue with" in content:
content = f"{subheader}\n{content}"
content = f"{subheader}\n\n{content}"
subheader = None
title = ""
@ -760,6 +760,7 @@ async def confirm_blob(
description=description,
data=data,
extra=None,
verb_cancel="", # to show the cancel icon
hold=hold,
)
)
@ -956,10 +957,10 @@ async def confirm_replacement(description: str, txid: str) -> None:
await confirm_value(
description.upper(),
txid,
"Confirm transaction ID:",
"Transaction ID:",
"confirm_replacement",
ButtonRequestType.SignTx,
verb="CONFIRM",
verb="CONTINUE",
)
@ -1161,6 +1162,7 @@ async def confirm_reenter_pin(
title,
description=f"Please re-enter {description} to confirm.",
verb="CONTINUE",
verb_cancel=None,
br_code=BR_TYPE_OTHER,
)

View File

@ -31,7 +31,7 @@ async def show_share_words(
title = f"SHARE #{share_index + 1}"
check_title = f"CHECK SHARE #{share_index + 1}"
else:
title = f"G{group_index + 1} - SHARE {share_index + 1}"
title = f"GROUP {group_index + 1} - SHARE {share_index + 1}"
check_title = f"GROUP {group_index + 1} - SHARE {share_index + 1}"
# We want the option to go back from words to the previous screen
@ -166,7 +166,7 @@ async def slip39_prompt_threshold(
await confirm_action(
"slip39_prompt_threshold",
"Threshold",
description="= minimum number of unique words used for recovery.",
description="= minimum number of unique word lists used for recovery.",
verb="CONTINUE",
verb_cancel=None,
)
@ -276,8 +276,8 @@ async def show_reset_warning(
) -> None:
await show_warning(
br_type,
button.upper(),
subheader or "",
content,
button.upper(),
br_code=br_code,
)

View File

@ -241,10 +241,7 @@ def test_autolock_interrupts_passphrase(device_handler: "BackgroundDeviceHandler
def unlock_dry_run(debug: "DebugLink") -> "LayoutContent":
assert (
"Do you really want to check the recovery seed?"
in debug.wait_layout().text_content()
)
assert "Check your backup?" in debug.wait_layout().text_content()
layout = go_next(debug, wait=True)
assert "PinKeyboard" in layout.all_components()

View File

@ -624,21 +624,18 @@ class InputFlowLockTimeBlockHeight(InputFlowBase):
super().__init__(client)
self.block_height = block_height
def input_flow_tt(self) -> BRGeneratorType:
def assert_func(debug: DebugLink) -> None:
layout_text = debug.wait_layout().text_content()
assert "blockheight" in layout_text
assert self.block_height in layout_text
def assert_func(self, debug: DebugLink) -> None:
layout_text = debug.wait_layout().text_content()
assert "blockheight" in layout_text
assert self.block_height in layout_text
yield from lock_time_input_flow_tt(self.debug, assert_func, double_confirm=True)
def input_flow_tt(self) -> BRGeneratorType:
yield from lock_time_input_flow_tt(
self.debug, self.assert_func, double_confirm=True
)
def input_flow_tr(self) -> BRGeneratorType:
def assert_func(debug: DebugLink) -> None:
assert "blockheight" in debug.wait_layout().text_content()
debug.press_right()
assert self.block_height in debug.wait_layout().text_content()
yield from lock_time_input_flow_tr(self.debug, assert_func)
yield from lock_time_input_flow_tr(self.debug, self.assert_func)
class InputFlowLockTimeDatetime(InputFlowBase):
@ -646,21 +643,16 @@ class InputFlowLockTimeDatetime(InputFlowBase):
super().__init__(client)
self.lock_time_str = lock_time_str
def input_flow_tt(self) -> BRGeneratorType:
def assert_func(debug: DebugLink):
layout_text = debug.wait_layout().text_content()
assert "Locktime" in layout_text
assert self.lock_time_str in layout_text
def assert_func(self, debug: DebugLink):
layout_text = debug.wait_layout().text_content()
assert "Locktime" in layout_text
assert self.lock_time_str in layout_text
yield from lock_time_input_flow_tt(self.debug, assert_func)
def input_flow_tt(self) -> BRGeneratorType:
yield from lock_time_input_flow_tt(self.debug, self.assert_func)
def input_flow_tr(self) -> BRGeneratorType:
def assert_func(debug: DebugLink):
assert "Locktime" in debug.wait_layout().text_content()
debug.press_right()
assert self.lock_time_str in debug.wait_layout().text_content()
yield from lock_time_input_flow_tr(self.debug, assert_func)
yield from lock_time_input_flow_tr(self.debug, self.assert_func)
class InputFlowEIP712ShowMore(InputFlowBase):

View File

@ -56,7 +56,7 @@ class RecoveryFlow:
def confirm_dry_run(self) -> BRGeneratorType:
yield
assert "check the recovery seed" in self.debug.wait_layout().text_content()
assert "Check your backup" in self.debug.wait_layout().text_content()
self.debug.press_yes()
def setup_slip39_recovery(self, num_words: int) -> BRGeneratorType:
@ -109,7 +109,7 @@ class RecoveryFlow:
self.debug.press_no()
yield
assert "abort the recovery" in self.debug.wait_layout().text_content()
assert "cancel the recovery" in self.debug.wait_layout().text_content()
if self.debug.model == "R":
self.debug.press_right()
if confirm:

View File

@ -61,7 +61,7 @@ def test_abort(core_emulator: Emulator):
assert "Enter your backup" in debug.read_layout().text_content()
layout = debug.click(buttons.CANCEL, wait=True)
assert layout.title() == "ABORT RECOVERY"
assert layout.title() in ("ABORT RECOVERY", "CANCEL RECOVERY")
layout = debug.click(buttons.OK, wait=True)
assert layout.main_component() == "Homescreen"