feat(core): allow blanking `select_word()` items
What changed, and why it matters
This commit is a small UI layout change for the Trezor hardware wallet. It lets a screen that normally shows three word choices display only two choices by leaving one slot blank and hiding the separator line next to it. There is no indication this fixes a security bug; it appears to be a feature tweak for a future user interface.
No security action needed. Treat as a normal UI feature commit. If this is being backported or cherry-picked, verify it is paired with the companion commit that actually introduces the two-option `select_word()` usage, since this commit only prepares the rendering support.
Security signals we found
No security-relevant keywords in commit title or message
No changelog entry requested ([no changelog])
Change is purely presentational UI logic
No input validation, memory safety, or cryptographic changes
No vendor or researcher attribution for a security issue
Evidence from the diff
The change modifies select_word_screen.rs in the Eckhart UI layout. Buttons are now created with .initially_enabled(!word.is_empty()), so an empty word string produces a disabled button. The separator rendering loop was rewritten to iterate over adjacent button pairs and only draw a separator if both buttons in the pair are enabled and neither is pressed. This supports a planned two-option variant of the select_word() flow by suppressing the separator after a blank/disabled item.
Changed components
core/embed/rust/src/ui/layout_eckhart/firmware/select_word_screen.rsInspect captured patch +7 / −4
diff --git a/core/embed/rust/src/ui/layout_eckhart/firmware/select_word_screen.rs b/core/embed/rust/src/ui/layout_eckhart/firmware/select_word_screen.rs
index 3e4cbd11..6d80e1ce 100644
--- a/core/embed/rust/src/ui/layout_eckhart/firmware/select_word_screen.rs
+++ b/core/embed/rust/src/ui/layout_eckhart/firmware/select_word_screen.rs
@@ -102,6 +102,7 @@ impl SelectWordButtons {
for word in share_words_vec {
unwrap!(buttons.push(
Button::with_text(word)
+ .initially_enabled(!word.is_empty())
.styled(theme::button_select_word())
.with_radius(12)
.with_text_align(Alignment::Center),
@@ -111,11 +112,13 @@ impl SelectWordButtons {
}
fn render_separators<'s>(&'s self, target: &mut impl Renderer<'s>) {
- for i in 1..self.buttons.len() {
- let button = &self.buttons[i];
- let button_prev = &self.buttons[i - 1];
+ for pair in self.buttons.windows(2) {
+ let should_render = pair
+ .iter()
+ .all(|button| button.is_enabled() && !button.is_pressed());
- if !button.is_pressed() && !button_prev.is_pressed() {
+ if should_render {
+ let button = &pair[1];
let separator = Rect::from_top_left_and_size(
button
.area()
Why this scored 18/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.