test(agent): cover native and browser side-button profiles - #1325
Conversation
Co-authored-by: Xuan Zhang <xuan@arcbox.dev>
|
There was a problem hiding this comment.
🟡 Changes recommended
One newly added test assertion is unnecessarily brittle by asserting diversion via a specific (cid, button) tuple instead of checking diversion at the ButtonId level.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds regression coverage around thumb (side) button capture semantics so Back/Forward remain native by default, while explicit BrowserBack / BrowserForward bindings (including per-app overrides) correctly trigger diversion into the agent dispatch pipeline. Also refreshes inline documentation/comments to clarify the distinction between native side-button events and dispatched browser-navigation actions.
Changes:
- Expanded
openlogi-agent-coretests to cover both Back and Forward across unset, explicitly-native, explicitly-browser bindings, plus per-app overrides and inheritance after clearing overrides. - Clarified
openlogi-coredefault-binding commentary to explain why native defaults must differ from dispatched browser navigation actions. - Updated stale macOS-related comments to reflect that the current browser navigation dispatch path uses platform input synthesis (not the AX helper).
File summaries
| File | Description |
|---|---|
| crates/openlogi-inject/src/inject/macos.rs | Updates browser navigation shortcut comment to reflect current dispatch behavior. |
| crates/openlogi-core/src/binding/defaults.rs | Refines rationale comment for native Back/Forward defaults vs dispatched browser actions. |
| crates/openlogi-agent-core/src/runtime.rs | Updates browser navigation debounce comment to match current dispatch mechanism. |
| crates/openlogi-agent-core/src/capture_plan.rs | Adds/expands regression tests for side-button diversion and per-app override semantics. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
Follow up on #1225 with regression coverage for both Back and Forward, native defaults, and per-app capture decisions. No runtime behavior, defaults, configuration schema, or IPC wire types change.
The native defaults introduced by #1225 preserve mouse-button events; they do not enable Safari navigation automatically. Explicit
BrowserBack/BrowserForwardbindings request dispatched navigation instead. Existing explicit browser bindings remain intact.Changes
openlogi-agent-core: cover both side buttons with unset, explicitly native, and explicitly browser-navigation bindings; assert the other side stays native.openlogi-agent-core: cover native-to-browser and browser-to-native app overrides, another foreground app, and inheritance after clearing an override. Check both the capture target and the resolved dispatch action.openlogi-core: explain why native defaults must differ from dispatched browser actions without claiming the OS hook could never handle the old defaults.openlogi-agent-core/openlogi-inject: remove stale comments claiming Safari already passes through the AX navigation helper. The current dispatch path uses platform input synthesis; Safari AX targeting and focus timing remain separate work in fix(macos): bind Safari navigation to press-time process #1082.Testing
All commands ran on Linux. The full gate used
RUSTFLAGS="-D warnings".BrowserForwarddefault madecargo test -p openlogi-agent-core thumb_button_capture_distinguishes_native_and_browser_actions --lockedfail withBrowserForward != MouseForward. The mutation was removed before the full gate.Hardware verification for the behavior established by #1225:
MouseBack/MouseForward: OpenLogi should leave their native events intact, without promising navigation in applications that do not support those events.BrowserBack/BrowserForward, then check that the agent captures and dispatches the corresponding action once per press. Verify browser behavior separately in Safari and a Chromium-based browser.Related: #1082, #736, #1118, #23, #354. No additional issue closures are claimed by this follow-up.