-
Notifications
You must be signed in to change notification settings - Fork 10.5k
ui: adjust scrolling behavior and interaction state logic #36874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This PR corrects scrolling behavior where gestures were frequently misinterpreted as presses, causing accidental activations. The previous MIN_DRAG_PIXELS threshold (12px) caused small scrolls to register as clicks, while loose state validation allowed unintentional presses during momentum scrolling. Wobbrock et al. (2008) found that 5–7px thresholds optimize the distinction between taps and scrolls. Reducing this to 6px improves recognition accuracy for small movements. is_touch_valid now rejects inputs during AUTO_SCROLL. This aligns with findings by Matero & Colley (2013) and patent US9898180B2 (2018), which demonstrate that suppressing selection actions during high-velocity states prevents accidental clicks. References Matero, J., & Colley, A. (2013). Identifying unintentional touches... (MobileHCI ’13). https://www.researchgate.net/publication/254462131_Identifying_unintentional_touches_on_handheld_touch_screen_devices Microsoft Technology Licensing, LLC. (2018). U.S. Patent No. 9,898,180. https://patents.google.com/patent/US9898180B2/en Wobbrock, J. O., et al. (2008). The performance of handheld touchscreens... (CHI ’08). https://doi.org/10.1145/1357054.1357091
mici raylib UI Preview✅ Videos are identical! View Diff Report |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:
- Convert your PR to a draft unless it's ready to review
- Read the contributing docs
- Before marking as "ready for review", ensure:
- the goal is clearly stated in the description
- all the tests are passing
- the change is something we merge
- include a route or your device' dongle ID if relevant
system/ui/lib/scroll_panel2.py
Outdated
| from collections import deque | ||
|
|
||
| MIN_VELOCITY = 10 # px/s, changes from auto scroll to steady state | ||
| MIN_VELOCITY_FOR_CLICKING = 2 * 60 # px/s, accepts clicks while auto scrolling below this velocity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adjust this, not is_touch_valid. you want to be able to tap when moving very slowly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, given the direction and guidance of the three sources I provided in the description, this PR achieved the state where a tap stops the scrolling (does not click the button). But you want this to also account for where for example, when onroad and there is many induced vibrations to the vehicle and comma, a tap while scrolling very slowly successfully clicks the button.
In that sense, then my next commit will revert is_touch_valid. min_velocity_for_clicking is current 120 px/s. my average velocity while scrolling normally (not flicking my finger but a controlled scroll) was 112 px/s measured using self._velocity. I propose lowering this minimum velocity to 2*45 = 90 px/s



























Good morning openpilot research team,
As an introduction to myself, I would like to note, as a APA data scientist, I prefer to provide evidence based research to all of my PRs regardless of line diff. The following analysis is meant to supplant my claim.
This PR aims to correct scrolling behavior where swiping gestures were frequently misinterpreted as button presses, causing accidental activations of various UI elements. The previous MIN_DRAG_PIXELS threshold (12px) caused small scrolls to register as clicks, while loose state validation behavior allowed unintentional presses during momentum scrolling. Wobbrock et al. (2008) found that 5–7px thresholds optimize the distinction between taps and scrolls. Reducing this to 6px helps to improve recognition accuracy for small movements, which, on the comma four, was demonstrated to result in more fluid scroll behavior. The is_touch_valid method now rejects inputs during auto scroll and manual scroll. This aligns with findings by Matero & Colley (2012) and patent US9898180B2 (2018), which demonstrate that suppressing selection actions during high-velocity states prevents accidental clicks. The result of this rejection leads to more natural scrolling behavior that doesn’t introduce accidental button presses when a user is navigating the offroad menus on the comma four.
References
Matero, Juha & Colley, Ashley. (2012). Identifying unintentional touches on handheld touch screen devices. Proceedings of the Designing Interactive Systems Conference, DOI:10.1145/2317956.2318031.
https://www.researchgate.net/publication/254462131_Identifying_unintentional_touches_on_handheld_touch_screen_devices
Microsoft Technology Licensing, LLC. (2018). U.S. Patent No. 9,898,180. https://patents.google.com/patent/US9898180B2/en
Wobbrock, J. O., Myers, B. A., & Aung, H. H. (2008). The performance of handheld touchscreens in mobile environments. Proceedings of the SIGCHI Conference on Human Factors in Computing Systems (CHI ’08), 1633–1642. Association for Computing Machinery. Retrieved from https://dl.acm.org/doi/10.1145/1357054