refactor(core): rename "skip" flag for non-idempotent menu items
What changed, and why it matters
This commit is a simple code cleanup: it renames an internal debug-only flag from 'is_cancel' to 'skip_test_visit' in two hardware wallet UI layouts and in the Python test helper. The behavior is unchanged. There is no security fix or vulnerability here.
No security action required. This is a non-functional refactor; review can be limited to naming/comment clarity.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch renames the is_cancel boolean field (gated by #[cfg(feature = "ui_debug")]) to skip_test_visit in the Delizia and Eckhart button components, and updates the matching key in the debuglink trace output. The Python DebugUI test helper now reads skip_test_visit instead of is_cancel, with an updated comment explaining the purpose: skip non-idempotent menu items during automated UI traversal. No logic changes.
Changed components
core/embed/rust/src/ui/layout_delizia/component/button.rscore/embed/rust/src/ui/layout_eckhart/component/button.rspython/src/trezorlib/debuglink.pyInspect captured patch +10 / −10
diff --git a/core/embed/rust/src/ui/layout_delizia/component/button.rs b/core/embed/rust/src/ui/layout_delizia/component/button.rs
index f1c9ddcc..f594d0f8 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/button.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/button.rs
@@ -34,7 +34,7 @@ pub struct Button {
long_timer: Timer,
haptic: bool,
#[cfg(feature = "ui_debug")]
- is_cancel: bool, // used by debuglink
+ skip_test_visit: bool, // used by debuglink
}
impl Button {
@@ -56,7 +56,7 @@ impl Button {
long_timer: Timer::new(),
haptic: true,
#[cfg(feature = "ui_debug")]
- is_cancel: false,
+ skip_test_visit: false,
}
}
@@ -109,7 +109,7 @@ impl Button {
#[cfg(feature = "ui_debug")]
pub fn set_is_cancel(mut self) -> Self {
- self.is_cancel = true;
+ self.skip_test_visit = true;
self
}
@@ -376,7 +376,7 @@ impl Component for Button {
impl crate::trace::Trace for Button {
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
t.component("Button");
- t.bool("is_cancel", self.is_cancel);
+ t.bool("skip_test_visit", self.skip_test_visit);
match &self.content {
ButtonContent::Empty => {}
ButtonContent::Text(text) => t.string("text", *text),
diff --git a/core/embed/rust/src/ui/layout_eckhart/component/button.rs b/core/embed/rust/src/ui/layout_eckhart/component/button.rs
index 69ced096..f92bc7e5 100644
--- a/core/embed/rust/src/ui/layout_eckhart/component/button.rs
+++ b/core/embed/rust/src/ui/layout_eckhart/component/button.rs
@@ -47,7 +47,7 @@ pub struct Button {
haptic: bool,
subtext_marquee: Option<Marquee>,
#[cfg(feature = "ui_debug")]
- is_cancel: bool, // used by debuglink
+ skip_test_visit: bool, // used by debuglink
}
impl Button {
@@ -90,7 +90,7 @@ impl Button {
haptic: true,
subtext_marquee,
#[cfg(feature = "ui_debug")]
- is_cancel: false,
+ skip_test_visit: false,
}
}
@@ -280,7 +280,7 @@ impl Button {
#[cfg(feature = "ui_debug")]
pub fn set_is_cancel(mut self) -> Self {
- self.is_cancel = true;
+ self.skip_test_visit = true;
self
}
@@ -808,7 +808,7 @@ impl Component for Button {
impl crate::trace::Trace for Button {
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
t.component("Button");
- t.bool("is_cancel", self.is_cancel);
+ t.bool("skip_test_visit", self.skip_test_visit);
match &self.content {
ButtonContent::Empty => {}
ButtonContent::Text { text, .. } => t.string("text", *text),
diff --git a/python/src/trezorlib/debuglink.py b/python/src/trezorlib/debuglink.py
index 6c1e38e8..07f1f823 100644
--- a/python/src/trezorlib/debuglink.py
+++ b/python/src/trezorlib/debuglink.py
@@ -1032,8 +1032,8 @@ class DebugUI:
key="buttons", default=None, only_type=list
)
for menu_button, item_button in zip(menu_buttons, item_buttons):
- if menu_button.get("is_cancel"):
- continue # don't click cancel
+ if menu_button.get("skip_test_visit"):
+ continue # visit only idempotent entries (e.g. for showing more information)
self.debuglink.click(item_button)
self.debuglink.click(close_button)
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.