Skip to content

feat(gesture): add step and continuous zoom actions - #1313

Open
lorenzenv wants to merge 2 commits into
AprilNEA:masterfrom
lorenzenv:feat/gesture-zoom-upstream
Open

lorenzenv wants to merge 2 commits into
AprilNEA:masterfrom
lorenzenv:feat/gesture-zoom-upstream

Conversation

@lorenzenv

Copy link
Copy Markdown

Summary

Add gesture-button zoom with a choice between one step per swipe and repeated zoom while moving. Bind Up to Zoom In and Down to Zoom Out; the continuous variants can reverse direction during the same hold and stop when the mouse stops or the button is released.

This is application zoom in discrete steps, not native pinch emulation. Windows uses Ctrl+wheel; macOS and Linux use Cmd/Ctrl+= and Cmd/Ctrl+-. Related to #360, #764 and #1175; this offers a smaller alternative through the existing direction picker and does not implement pan, rotate, or Smart Zoom.

Changes

  • core: append four zoom actions, distinguish initial swipes from repeated travel, and preserve one-shot actions and click-on-release behavior.
  • device / agent-core: forward repeated HID++ and OS-hook movement through the existing press lifecycle; ignore repeats for ordinary actions.
  • inject: synthesize balanced Windows Ctrl+wheel input while preserving an existing Ctrl hold; map application zoom shortcuts on macOS/Linux.
  • desktop / ui: expose both modes in the action picker and add matching keys to every locale (English fallback outside German).
  • ipc / docs: bump protocol 29 → 30, pin appended action encodings, and document configuration.

Testing

Passed on Windows with RUSTFLAGS="-D warnings" (and RUSTDOCFLAGS="-D warnings" for documentation):

cargo fmt --all -- --check
cargo clippy --locked --workspace --all-targets -- -D warnings
cargo test --locked --workspace
cargo doc --locked --workspace --no-deps --document-private-items --exclude openlogi-ui --exclude openlogi-desktop --exclude openlogi-overlay --exclude openlogi-agent

Additional checks passed:

cargo clippy --locked --target aarch64-unknown-linux-musl -p openlogi-hook -p openlogi-inject -p openlogi-hid -p openlogi-hidpp -p openlogi-core -p openlogi-agent -p openlogi-agent-core -p openlogi-ipc -p openlogi-permissions --all-targets -- -D warnings
cargo xtask ci wasm

The Windows checkout of ci.yml was normalized to LF for the existing workflow-command test; its committed contents are unchanged. A separate documentation commit fixes an existing link to a permission type that is unavailable on Windows, allowing the rustdoc gate to pass.

Not run locally: macOS builds/tests, native Linux tests/full-workspace Linux lint, MSRV jobs, cargo-deny, typos, and shell lint. The Linux check above covers the cross-platform backend subset.

Hardware: continuous zoom was tested on Windows with an MX Master 3 over Bluetooth and confirmed working. The direction picker was inspected in the running app. Native hardware behavior on macOS/Linux has not been tested.

To verify: assign Up/Down to the continuous actions, hold the gesture button in a browser or document, move up, pause, then move down. Zoom should reverse without releasing and remain still during the pause. Switch to the one-step actions to verify that further movement during the same hold does not repeat.

MX Master 3 gesture zoom bindings

@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds one-step and movement-driven continuous application zoom actions across the gesture capture, action dispatch, platform injection, IPC, desktop picker, localization, and configuration-documentation layers.

  • Distinguishes initial gesture commitment from subsequent distance-based movement.
  • Allows continuous zoom to reverse direction during one held gesture while preserving one-shot behavior for existing actions.
  • Uses platform-specific application zoom input and balances Windows Ctrl state.
  • Appends stable action encodings and advances the IPC protocol from version 29 to 30.
  • Adds picker labels and configuration guidance for both zoom modes.

Confidence Score: 5/5

The PR appears safe to merge; the new zoom behavior is consistently integrated and remains bounded by the existing press, release, and cancellation lifecycle.

No actionable failures remain: repeated movement is restricted to continuous zoom actions, stale repeats are rejected, platform mappings are balanced and supported, and persisted and IPC contracts are updated append-only with pinned encodings.

Important Files Changed

Filename Overview
crates/openlogi-core/src/binding/swipe.rs Adds press-scoped first/repeat gesture classification with distance-based repetition, direction reversal, and release gating.
crates/openlogi-core/src/binding/action.rs Appends four zoom actions and explicitly limits movement repetition to the continuous variants.
crates/openlogi-agent-core/src/watchers/gesture/dispatch.rs Routes repeated HID++ movement through the active gesture press while filtering ordinary one-shot actions.
crates/openlogi-agent-core/src/runtime/hook.rs Extends OS-hook gestures to emit repeat steps through the existing press lifecycle.
crates/openlogi-device/src/session/gesture.rs Converts additional raw HID++ travel into ordered GestureRepeat events bounded by button lifecycle.
crates/openlogi-inject/src/inject/windows.rs Implements balanced Ctrl-wheel application zoom while preserving an already-held Ctrl key.
crates/openlogi-inject/src/inject/macos.rs Maps application zoom to balanced Command-plus/minus shortcuts.
crates/openlogi-inject/src/inject/linux.rs Maps application zoom to balanced Control-plus/minus shortcuts.
crates/openlogi-ipc/src/ipc.rs Advances the strict IPC protocol version for the appended action vocabulary.
crates/openlogi-ipc/tests/wire_format.rs Pins protocol version 30 and the append-only wire encodings of all four zoom actions.
docs/CONFIGURATION.md Documents gesture setup, platform input mappings, thresholds, reversal, and plain-button behavior.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Held gesture button] --> B[Raw pointer movement]
    B --> C[SwipeAccumulator]
    C -->|First threshold| D[SwipeStep::First]
    C -->|Further threshold| E[SwipeStep::Repeat]
    D --> F[Resolve directional binding]
    E --> G{Action repeats on motion?}
    G -->|Yes| F
    G -->|No| H[Ignore repeat]
    F --> I[Press-scoped action dispatcher]
    I --> J[Zoom shortcut effect]
    J --> K{Platform}
    K -->|Windows| L[Ctrl + mouse wheel]
    K -->|macOS| M[Cmd + equals/minus]
    K -->|Linux| N[Ctrl + equals/minus]
    O[Button release or cancellation] --> P[End press lifecycle]
    P --> Q[Reject later movement]
Loading

Reviews (1): Last reviewed commit: "docs(permissions): avoid platform-specif..." | Re-trigger Greptile

@davidbudnick davidbudnick added type: feature New feature request platform: all Cross-platform issue labels Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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