feat(macos): configure native horizontal scrolling - #731
Conversation
Greptile SummaryAdds configurable native horizontal-scroll speed and inversion for directly connected macOS devices while preserving the original CGEvent stream.
Confidence Score: 4/5The identical-direct-device attribution mismatch should be fixed before merging because the UI can confirm settings that the runtime silently discards. Two same-model direct mice are presented as independently supported, but differing per-device settings collapse to no runtime adjustment when the agent groups them by VID/PID. Files Needing Attention: crates/openlogi-desktop/src/state/scroll.rs, crates/openlogi-desktop/src/app/detail.rs, crates/openlogi-agent-core/src/orchestrator.rs
|
| Filename | Overview |
|---|---|
| crates/openlogi-agent-core/src/orchestrator.rs | Builds VID/PID adjustment maps and intentionally drops conflicting policies for indistinguishable direct devices. |
| crates/openlogi-agent-core/src/hook_runtime.rs | Selects eligible native horizontal events and returns the macOS adjustment disposition without blocking the event tap. |
| crates/openlogi-hook/src/macos.rs | Adds scroll-wheel capture and scales all horizontal CGEvent delta representations in place. |
| crates/openlogi-core/src/config/settings.rs | Defines the validated 20–100 horizontal sensitivity domain and its 100–500 percent mapping. |
| crates/openlogi-desktop/src/state/scroll.rs | Persists the new controls but incorrectly reports every persistent direct device as independently supported. |
| crates/openlogi-desktop/src/app/detail.rs | Renders enabled macOS horizontal-scroll controls without communicating same-VID/PID ambiguity. |
Sequence Diagram
sequenceDiagram
participant User
participant UI as Desktop UI
participant Config
participant Agent as Agent Orchestrator
participant Hook as macOS Event Tap
participant App as Target Application
User->>UI: Select speed / inversion
UI->>Config: Persist per-device setting
UI->>Agent: Reload configuration
Agent->>Agent: Group direct devices by VID/PID
Agent->>Hook: Publish signed scale map
Hook->>Hook: Attribute horizontal CGEvent
Hook->>Hook: Scale Axis 2 line/fixed/point fields
Hook->>App: Pass through mutated original event
Reviews (1): Last reviewed commit: "feat(macos): configure native horizontal..." | Re-trigger Greptile
| pub fn current_horizontal_scroll_supported(&self) -> bool { | ||
| cfg!(target_os = "macos") | ||
| && self.current_record().is_some_and(|record| { | ||
| record.persistent_config_key().is_some() | ||
| && matches!(record.route, Some(DeviceRoute::Direct { .. })) | ||
| }) |
There was a problem hiding this comment.
Duplicate devices report false support
When two directly connected mice share a VID/PID and have different horizontal-scroll settings, this predicate reports both as independently supported, but the agent removes their conflicting shared map entry. The UI therefore displays the selected speed or inversion as active while both mice continue using native horizontal scrolling.
Knowledge Base Used:
|
@cromulus I approved you job running can you please fix the comments from greptile-apps and the pipeline? |
Summary
CGEventdeltas in place so applications retain the original scroll phases, momentum metadata, and event source.Changes
horizontal_scroll_sensitivityandinvert_horizontal_scrolldevice settings. The 20–100 sensitivity range maps to 1×–5× native movement.Related work
0x005band0x005d.Testing
asdf exec cargo fmt --all -- --checkasdf exec cargo clippy --workspace --all-targets -- -D warningsASDF_RUST_VERSION=1.98.0 asdf exec cargo test --workspaceRUSTDOCFLAGS="-D warnings" ASDF_RUST_VERSION=1.98.0 asdf exec cargo doc --workspace --no-deps --document-private-items --exclude openlogi-ui --exclude openlogi-desktop --exclude openlogi-overlay --exclude openlogi-agentRelated to #100, #357, and #359.