Skip to content

Feat/mouse wheel acceleration 2672546306030338090 - #1012

Closed
willearning1 wants to merge 4 commits into
AprilNEA:masterfrom
willearning1:feat/mouse-wheel-acceleration-2672546306030338090
Closed

Feat/mouse wheel acceleration 2672546306030338090#1012
willearning1 wants to merge 4 commits into
AprilNEA:masterfrom
willearning1:feat/mouse-wheel-acceleration-2672546306030338090

Conversation

@willearning1

Copy link
Copy Markdown

Added UI elements for scroll adjustment

Implement bounded, velocity-based mouse-wheel acceleration for OpenLogi.
Calculates normalized physical wheel velocity in ticks/second and applies a
smooth monotonic gain curve bounded by max_gain. Axis state is tracked
independently for vertical and horizontal axes, resetting immediately on
direction reversal or after a 250ms idle interval.
Implement bounded, velocity-based mouse-wheel acceleration for OpenLogi.
Calculates normalized physical wheel velocity in ticks/second and applies a
smooth monotonic gain curve bounded by max_gain. Axis state is tracked
independently for vertical and horizontal axes, resetting immediately on
direction reversal or after a 250ms idle interval.
Also adds UI controls in Settings -> General for toggling scroll acceleration.
@willearning1
willearning1 requested a review from AprilNEA as a code owner August 25, 2026 22:56
@greptile-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds configurable vertical and horizontal mouse-wheel acceleration, publishes the new settings to the agent, and exposes controls in the desktop Settings window.

  • Adds per-axis acceleration curves and runtime state.
  • Moves sensitivity and acceleration scaling into the scroll worker.
  • Adds persisted acceleration settings, sliders, toggles, reset controls, and tests.

Confidence Score: 2/5

The PR is not yet safe to merge because thumb-wheel scaling, cross-source acceleration state, and non-finite gain handling remain broken.

The current worker still applies main-wheel preferences to HID++ thumb-wheel input, shares one acceleration history across independent producers, and permits a NaN maximum gain to reach a panicking clamp operation.

Files Needing Attention: crates/openlogi-agent-core/src/runtime/scroll/worker.rs, crates/openlogi-agent-core/src/runtime/scroll/acceleration.rs, crates/openlogi-core/src/config/settings.rs, crates/openlogi-core/src/scroll.rs

Important Files Changed

Filename Overview
crates/openlogi-agent-core/src/runtime/scroll/worker.rs Centralizes sensitivity and acceleration in one worker, while the previously reported source-scaling and state-isolation defects remain.
crates/openlogi-agent-core/src/runtime/scroll/acceleration.rs Adds stateful per-axis rate tracking, but the state remains worker-wide and maximum-gain finiteness is not enforced.
crates/openlogi-core/src/config/settings.rs Adds persisted acceleration preferences without validating non-finite floating-point bounds.
crates/openlogi-core/src/scroll.rs Adds the acceleration curve, whose clamp still receives an unvalidated maximum bound.
crates/openlogi-desktop/src/windows/settings.rs Adds slider state and handlers for the new acceleration controls.
crates/openlogi-desktop/src/windows/settings/general.rs Adds the user-facing acceleration switches, sliders, reset controls, and explanatory graph.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    UI[Desktop acceleration controls] --> Config[Persisted AppSettings]
    Config --> Orchestrator[Agent config reload]
    Orchestrator --> Preferences[Shared scroll preferences]
    Hook[OS wheel input] --> Worker[Scroll worker]
    HIDPP[HID++ thumb-wheel input] --> Worker
    Preferences --> Worker
    Worker --> Acceleration[Acceleration engine]
    Acceleration --> Injection[Smooth or direct scroll injection]
Loading

Reviews (3): Last reviewed commit: "feat: implement mouse-wheel acceleration..." | Re-trigger Greptile

Comment on lines +428 to +430
let scaled_impulse = WheelDelta {
x: input.impulse.x * gain_x,
y: input.impulse.y * prefs.vertical_sensitivity.scroll_multiplier() * gain_y,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Thumb wheel receives main-wheel scaling

When a diverted HID++ thumb wheel emits vertical scrolling with smoothing enabled, the shared worker applies the traditional-wheel sensitivity and acceleration to its already thumb-wheel-scaled impulse, causing incorrect scroll distance and acceleration.

Knowledge Base Used: Core domain and configuration

Fix in Codex Fix in Claude Code

Comment on lines 372 to +373
let mut engine = ScrollEngine::default();
let mut accel_engine = super::ScrollAccelerationEngine::default();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Acceleration state crosses input sources

If two devices or hook threads submit same-axis events within the acceleration timeout, both update this single engine, so a fast scroll from one producer accelerates or resets a deliberate scroll from another producer.

Knowledge Base Used: Background agent service

Fix in Codex Fix in Claude Code

Comment on lines +213 to +224
/// Maximum upper bound for vertical acceleration gain.
#[serde(default = "default_vertical_max_gain")]
pub vertical_max_gain: f64,
/// Whether horizontal mouse-wheel acceleration is enabled.
#[serde(default)]
pub horizontal_acceleration_enabled: bool,
/// Horizontal acceleration strength multiplier.
#[serde(default = "default_acceleration_factor")]
pub horizontal_acceleration: f64,
/// Maximum upper bound for horizontal acceleration gain.
#[serde(default = "default_horizontal_max_gain")]
pub horizontal_max_gain: f64,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Invalid gain can kill worker

When a user-edited config supplies nan for either maximum gain, the unvalidated value reaches f64::clamp as its upper bound and panics the scroll worker, leaving configured smoothing and acceleration unavailable until restart.

Knowledge Base Used: Core domain and configuration

Fix in Codex Fix in Claude Code

Implement bounded velocity-based scroll acceleration and settings UI.
Calculates physical wheel rate in ticks/second using a shared pure gain curve
function. Adds independent vertical and horizontal acceleration controls, GPUI
curve graph visualization, state setters/resets, and unit tests.
Implement bounded velocity-based scroll acceleration and settings UI.
Calculates physical wheel rate in ticks/second using a shared pure gain curve
function. Adds independent vertical and horizontal acceleration controls, GPUI
curve graph visualization, state setters/resets, and unit tests.
@davidbudnick davidbudnick added type: feature New feature request platform: all Cross-platform issue labels Aug 26, 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