fix(agent): apply per-app gesture button clicks - #430
Open
devsaddle wants to merge 1 commit into
Open
Conversation
devsaddle
marked this pull request as ready for review
July 20, 2026 09:55
Greptile SummaryThis PR fixes per-app gesture button click actions not being applied to HID++ gesture sources (e.g. the dedicated gesture button, MX Master 4 haptic panel). Capture plans were already rebuilt per foreground app for ordinary bindings, but
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| crates/openlogi-core/src/bindings.rs | Adds app_bundle parameter to hidpp_gesture_maps_for; overlays a per-app Binding::Single onto the Click arm while preserving the global gesture shape and swipe directions. Logic is sound — the effective binding is computed once outside the iterator and only applied when the effective result is a Single, which is unreachable when the global binding is already Single (filtered out earlier by the Binding::Single(_) => None arm). Minor closure variable shadowing noted. |
| crates/openlogi-agent-core/src/capture_plan.rs | Threads app through hidpp_gesture_maps_for in plan_for_device — the one-line fix that was missing. All other plan-building paths already passed app, so this brings gesture bindings into line with the rest of the per-app effective dispatch. |
| crates/openlogi-agent-core/src/orchestrator/tests.rs | Extends app_switch_republishes_capture_plans with a gesture-button per-app binding and two new assertions that verify the Click override is absent before app selection and applied after. Adds the published_gesture_click helper to extract the gesture click from the published plan. |
| crates/openlogi-desktop/src/state/bindings.rs | Passes explicit None for app_bundle so the GUI's global editing view remains unaffected by per-app overrides, which matches the documented intent ("global view — no per-app overlay here"). |
Sequence Diagram
sequenceDiagram
participant Orch as Orchestrator
participant CP as plan_for_device
participant BM as hidpp_gesture_maps_for
participant Cfg as Config
Orch->>CP: plan_for_device(config, key, route, app, gen)
CP->>BM: hidpp_gesture_maps_for(config, Some(key), app)
BM->>Cfg: bindings_for(key) — global stored shape
BM->>Cfg: effective_bindings(key, Some(app)) — per-app overlay
Note over BM: For each HID++ gesture source in gesture mode seed full 5-direction map from global shape then overlay Single binding onto Click arm only
BM-->>CP: gesture direction map per source button
CP-->>Orch: DeviceCapturePlan with gesture_bindings
Note over Orch: Published to SharedCapturePlans watcher dispatches Click with per-app action
Reviews (5): Last reviewed commit: "fix(agent): apply per-app gesture button..." | Re-trigger Greptile
devsaddle
force-pushed
the
codex/fix-per-app-gesture-button
branch
from
July 20, 2026 10:00
1058b38 to
c16ed37
Compare
davidbudnick
force-pushed
the
codex/fix-per-app-gesture-button
branch
from
August 2, 2026 00:51
c16ed37 to
3fe7181
Compare
devsaddle
force-pushed
the
codex/fix-per-app-gesture-button
branch
from
August 16, 2026 16:12
3fe7181 to
c0c6511
Compare
devsaddle
force-pushed
the
codex/fix-per-app-gesture-button
branch
from
August 19, 2026 16:43
c0c6511 to
95a509d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Apply per-app single-action overrides to the Click arm of dedicated HID++ gesture sources while keeping their global swipe directions and gesture mode intact.
This revision rebases the original fix onto the current multi-source, per-button gesture architecture. It supports both the dedicated gesture button and other HID++ gesture sources such as the MX Master 4 haptic panel.
Root cause
Capture plans already rebuild their ordinary bindings for the foreground app, but
hidpp_gesture_maps_forstill projected only the global gesture maps. A dedicated HID++ gesture press therefore kept dispatching its global Click action after the foreground app changed.Changes
hidpp_gesture_maps_forBinding::Singleonto onlyGestureDirection::ClickTesting
cargo fmt --allcargo test -p openlogi-core -p openlogi-agent-core --locked(191 core tests, 91 agent-core tests)cargo clippy -p openlogi-core -p openlogi-agent-core --all-targets --locked -- -D warningscargo check -p openlogi-gui --lockedreached GPUI's macOS shader build; the local Xcode installation lacks the optional Metal Toolchain, so the full GUI build is left to CIPreviously hardware-validated with an MX Master 2S using Safari and Chrome per-app navigation actions.