Skip to content

fix(eckhart): improve haptics in scrollable menu#6551

Merged
obrusvit merged 1 commit into
mainfrom
obrusvit/eckhart/menu-btn-vibration-fix
Mar 18, 2026
Merged

fix(eckhart): improve haptics in scrollable menu#6551
obrusvit merged 1 commit into
mainfrom
obrusvit/eckhart/menu-btn-vibration-fix

Conversation

@obrusvit
Copy link
Copy Markdown
Contributor

@obrusvit obrusvit commented Mar 3, 2026

  • if the menu is scrollable (i.e. buttons don't fit on the page) the haptics is postponed to the actual click (TouchEnd) rather than placing the finger there (TouchStart)

Notes for QA

Test that longer submenu in T3W1 device menu does not produce unpleasant haptic feedback while scrolling.

@obrusvit obrusvit self-assigned this Mar 3, 2026
Copilot AI review requested due to automatic review settings March 3, 2026 17:03
@obrusvit obrusvit added the T3W1 Trezor Safe 7 label Mar 3, 2026
@trezor-bot trezor-bot Bot added this to Firmware Mar 3, 2026
@github-project-automation github-project-automation Bot moved this to 🔎 Needs review in Firmware Mar 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 3, 2026

en main(all)

model device_test click_test persistence_test
T2T1 test(all) main(all) test(all) main(all) test(all) main(all)
T3B1 test(all) main(all) test(all) main(all) test(all) main(all)
T3T1 test(all) main(all) test(all) main(all) test(all) main(all)
T3W1 test(all) main(all) test(all) main(all) test(all) main(all)

Latest CI run: 23186910242

@obrusvit obrusvit linked an issue Mar 3, 2026 that may be closed by this pull request
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts haptic feedback behavior in the Eckhart UI layout so that when a vertical menu is scrollable, haptics are triggered on the confirmed click (TouchEnd) instead of on initial touch (TouchStart), reducing vibration while scrolling.

Changes:

  • Introduces a HapticMode enum for buttons and updates button event handling to support OnPress, OnClick, and Off.
  • Adds VerticalMenu::set_haptic_mode() to apply haptic behavior across all menu buttons.
  • Switches scrollable menus to HapticMode::OnClick during VerticalMenuScreen initialization.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
core/embed/rust/src/ui/layout_eckhart/firmware/vertical_menu_screen.rs Sets click-only haptics for scrollable menus during screen initialization.
core/embed/rust/src/ui/layout_eckhart/firmware/vertical_menu.rs Adds a helper to set haptic mode for all buttons in a menu.
core/embed/rust/src/ui/layout_eckhart/component/mod.rs Re-exports HapticMode from the button module.
core/embed/rust/src/ui/layout_eckhart/component/button.rs Replaces boolean haptics with HapticMode and updates haptic triggering logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- if the menu is scrollable (i.e. buttons don't fit on the page) the
haptics is postponed to the actual click (TouchEnd) rather than placing
the finger there (TouchStart)
@obrusvit obrusvit force-pushed the obrusvit/eckhart/menu-btn-vibration-fix branch from cc47cdc to 4bdf7b2 Compare March 17, 2026 09:15
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 394a47f4-784e-4558-870c-b10b027225f5

📥 Commits

Reviewing files that changed from the base of the PR and between 575a0e3 and 4bdf7b2.

📒 Files selected for processing (4)
  • core/embed/rust/src/ui/layout_eckhart/component/button.rs
  • core/embed/rust/src/ui/layout_eckhart/component/mod.rs
  • core/embed/rust/src/ui/layout_eckhart/firmware/vertical_menu.rs
  • core/embed/rust/src/ui/layout_eckhart/firmware/vertical_menu_screen.rs

Walkthrough

This pull request refactors the haptic feedback system in the button component by replacing a boolean haptic flag with a HapticMode enum supporting three modes: OnPress, OnClick, and Off. The without_haptics() builder method is replaced with set_haptic_mode() for configuration. The new enum is re-exported from the component module. A corresponding set_haptic_mode() method is added to VerticalMenu<T> to propagate the mode to all contained buttons. The VerticalMenuScreen initializer is updated to set haptic mode to OnClick when menus are scrollable.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description explains the functional change clearly but lacks required metadata. The template requires assignment, project setup, priority, team, sprint, and QA status—none of which are addressed. Complete the required sections from the template: assign yourself, add to the Firmware project, set priority/team/sprint, specify development status, and add Notes for QA if testable.
Docstring Coverage ⚠️ Warning Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: introducing a new HapticMode enum to improve haptics behavior in scrollable menus by postponing feedback from touch start to click events.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch obrusvit/eckhart/menu-btn-vibration-fix
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use TruffleHog to scan for secrets in your code with verification capabilities.

Add a TruffleHog config file (e.g. trufflehog-config.yml, trufflehog.yml) to your project to customize detectors and scanning behavior. The tool runs only when a config file is present.

@obrusvit obrusvit requested a review from romanz March 17, 2026 09:25
Comment thread core/embed/rust/src/ui/layout_eckhart/component/button.rs
@obrusvit
Copy link
Copy Markdown
Contributor Author

Postponing changelog to this PR: #6553

@obrusvit obrusvit merged commit 0d65b4a into main Mar 18, 2026
174 of 176 checks passed
@github-project-automation github-project-automation Bot moved this from 🔎 Needs review to 🤝 Needs QA in Firmware Mar 18, 2026
@obrusvit obrusvit deleted the obrusvit/eckhart/menu-btn-vibration-fix branch March 18, 2026 09:37
@Thalarion Thalarion self-assigned this Mar 18, 2026
@Thalarion Thalarion moved this from 🤝 Needs QA to 🧪 QA In progress in Firmware Mar 18, 2026
@Thalarion
Copy link
Copy Markdown
Contributor

Tested on TS7 with 2.11.1 FW.

On a long scrollable menu such as Settings > Device (after the device is seeded) haptics only trigger after touch is released from a menu item. Scrolling is undisturbed by haptics.

Short menus and buttons behave as before.

@Thalarion Thalarion moved this from 🧪 QA In progress to ✅ Approved by QA in Firmware Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T3W1 Trezor Safe 7

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Unwanted haptic effects in device menu

4 participants