Skip to content

feat(agent,gui): add per-device horizontal scroll inversion and thumbwheel scrolling controls - #2725

Open
devTarik wants to merge 8 commits into
AprilNEA:masterfrom
devTarik:feat/thumbwheel-scrolling
Open

devTarik wants to merge 8 commits into
AprilNEA:masterfrom
devTarik:feat/thumbwheel-scrolling

Conversation

@devTarik

@devTarik devTarik commented Dec 2, 2026

Copy link
Copy Markdown

Summary

Add per-device horizontal scroll inversion for Logitech thumb wheels and consolidate thumb-wheel scrolling controls into the Scrolling card on the Pointer tab, gated on capabilities.thumbwheel.

  • Clarifies the existing scroll-inversion label as vertical scroll (keeping the existing pointer.invert_scroll_direction i18n key intact).
  • Adds a dedicated per-device invert_thumbwheel toggle (default false, omitted from config.toml when off):
    • On 0x2150 Thumbwheel devices with native reporting (default sensitivity and default bindings), writes the inversion bit directly to hardware via 0x2150 (setThumbwheelReporting), and preserves that configured native direction when tearing down a diverted session.
    • When the thumb wheel is diverted (custom sensitivity, custom bindings, or 0x6501 Gestures2 gesture-46 devices), inverts only horizontal scroll actions (HorizontalScrollLeft <-> HorizontalScrollRight) in software dispatch without affecting non-scroll bindings (e.g. Volume, Tabs).
  • Moves per-device Thumb wheel sensitivity out of SmartShiftPanel into the new ScrollingPanel alongside Invert horizontal scroll, gated on capabilities.thumbwheel so mice without a thumb wheel do not see it and offline / non-SmartShift thumb-wheel mice still can configure it.
  • Shows override status and a Use General setting reset button on the device slider, plus the overriding-device count under Settings → General.

Relates to #1592, #1570.

Changes

  • openlogi-core: Added Capabilities::thumbwheel_inversion (0x2150), DeviceConfig::invert_thumbwheel, per-device helpers (invert_thumbwheel, set_invert_thumbwheel, has_device_thumbwheel_sensitivity, thumbwheel_sensitivity_override_count), legacy identity merge support, and round-trip / TOML-omission tests.
  • openlogi-ipc: Documented thumbwheel_inversion under unreleased protocol v46 and updated the wire_format golden test.
  • openlogi-device / openlogi-hid: Added set_thumbwheel_inversion / set_thumbwheel_inversion_on (0x2150 write helpers with scripted-channel unit tests), added CaptureSpec::thumbwheel_native_direction so teardown restores the configured native polarity, and bumped probe cache SCHEMA_VERSION to 21.
  • openlogi-agent-core: Wired native 0x2150 writes (on connect/reconnect and config reload), diverted-session native direction restoration, gesture-46 diversion when inverted, and horizontal-scroll-only inversion in WheelConfiguration::for_plan with unit tests.
  • openlogi-ui: Updated pointer.invert_scroll_direction wording (en, uk, ru) to specify vertical scroll and added the 7 new thumb-wheel keys in lockstep across all 24 locale files.
  • openlogi-desktop: Extracted ScrollingPanel (features/pointer/scrolling.rs), moved per-device thumb-wheel sensitivity out of SmartShiftPanel, gated the thumb-wheel section on capabilities.thumbwheel, added state/commit helpers (state/scroll.rs, state/settings.rs), and displayed the per-device override count in Settings → General.

Screenshots

image2 image

Testing

Ran locally on Fedora 44 Linux (x86_64, rustc 1.100.1):

  • cargo fmt --all -- --check — passed
  • cargo clippy -p openlogi-core -p openlogi-device -p openlogi-hid -p openlogi-ipc -p openlogi-agent-core -p openlogi-ui -p openlogi-desktop --all-targets -- -D warnings — passed
  • cargo check -p openlogi-agent -p openlogi-cli — passed
  • cargo test -p openlogi-core — 524 passed
  • cargo test -p openlogi-ipc --test wire_format — 38 passed
  • cargo test -p openlogi-device — 847 passed
  • cargo test -p openlogi-agent-core — 935 passed
  • cargo test -p openlogi-ui locale — 1 passed
  • cargo test -p openlogi-desktop state::scroll — 3 passed
  • cargo test -p openlogi-desktop features::pointer::scrolling — 6 passed

Not run locally:

  • cargo xtask ci ast-grep (skipped: ast-grep is not installed outside devenv)
  • macOS / Windows builds (to be verified by GitHub Actions CI)

Hardware verification:

  • Runtime-tested on Linux (GNOME Wayland) with a Logitech MX Master 4 (0x2150 Thumbwheel) under OPENLOGI_PROFILE=dev.

Add Capabilities::thumbwheel_inversion (0x2150) and per-device DeviceConfig::invert_thumbwheel. Apply native hardware inversion via HID++ 0x2150 when the wheel is native, preserve the configured native direction when tearing down a diverted session, and invert only horizontal scroll actions in software dispatch when the thumb wheel is diverted.
Extract ScrollingPanel on the Pointer tab, clarify the existing scroll-inversion label as vertical scroll, move per-device thumbwheel sensitivity out of SmartShiftPanel into ScrollingPanel alongside the new horizontal scroll inversion toggle (gated on capabilities.thumbwheel), add override status/reset controls, and show the override count in Settings -> General.
@greptile-apps

greptile-apps Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no new actionable issue remains.

Summary

Adds per-device horizontal scroll inversion and moves thumb-wheel controls into the Scrolling card.

  • Thumb-wheel inversion follows each device through native and captured scrolling.
  • The Pointer tab’s Scrolling card groups vertical and thumb-wheel controls.

Reviews (3) · Last reviewed commit: "fix(agent): return WriteSuperseded for s..." · Reviewed by Greptile

@davidbudnick davidbudnick added area: config Configuration files, persistence, and settings area: gui Graphical user interface area: hidpp HID++ protocol and device feature support platform: all Cross-platform issue type: feature New feature request labels Dec 3, 2026
@devTarik

devTarik commented Dec 3, 2026

Copy link
Copy Markdown
Author

Addressed all Greptile review comments in the latest commits:

  • Serialized thumbwheel direction writes via ThumbwheelCoordinator (WriteOrder) and added a capture barrier so in-flight native write-through calls drain before divert().
  • Switched Thumbwheel::set_reporting to write-through with per-step timeouts within WRITE_TIMEOUT, added 0x0003 unit ID verification before writing, and logged confirmed read-back writes at info.
  • Reconciled native thumbwheel direction after capture teardown and replaced the CaptureSpec thumbwheel booleans with ThumbwheelCapture.
  • Subscribed SettingsView to DeviceConfigChanged, added scrolling/settings UI interaction tests, and documented invert_thumbwheel in the config docs and README.

Ready for another pass whenever CI runs are approved.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: config Configuration files, persistence, and settings area: gui Graphical user interface area: hidpp HID++ protocol and device feature support platform: all Cross-platform issue type: feature New feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants