Skip to content

test(agent): cover native and browser side-button profiles - #1325

Merged
AprilNEA merged 2 commits into
masterfrom
test/back-forward-capture-coverage
Sep 15, 2026
Merged

AprilNEA merged 2 commits into
masterfrom
test/back-forward-capture-coverage

Conversation

@AprilNEA

@AprilNEA AprilNEA commented Sep 9, 2026

Copy link
Copy Markdown
Owner

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 / BrowserForward bindings 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".

cargo test -p openlogi-agent-core thumb_button_capture --locked
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps \
  --document-private-items --exclude openlogi-ui --exclude openlogi-desktop \
  --exclude openlogi-overlay --exclude openlogi-agent --locked
cargo xtask ci wasm
  • Full workspace tests: 1,426 passed, 0 failed, 2 existing ignored doctests.
  • Mutation check: temporarily restoring only Forward's old BrowserForward default made cargo test -p openlogi-agent-core thumb_button_capture_distinguishes_native_and_browser_actions --locked fail with BrowserForward != MouseForward. The mutation was removed before the full gate.
  • macOS source changes are comments only and were manually checked against the base. macOS and Windows builds/runtime tests were not run locally; neither were the other CI jobs outside the commands listed above.
  • Not runtime-tested on hardware. This PR tests capture-plan semantics, not successful navigation in Safari or other applications.

Hardware verification for the behavior established by #1225:

  1. Check both Back and Forward with no explicit binding and with MouseBack / MouseForward: OpenLogi should leave their native events intact, without promising navigation in applications that do not support those events.
  2. Bind each side to 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.
  3. Exercise per-app profiles in both directions: native globally with browser navigation in one app, then browser navigation globally with native actions in that app. Switch apps and clear the override to verify inheritance.

Related: #1082, #736, #1118, #23, #354. No additional issue closures are claimed by this follow-up.

Co-authored-by: Xuan Zhang <xuan@arcbox.dev>
Copilot AI lite review requested due to automatic review settings September 9, 2026 14:40
@greptile-apps

greptile-apps Bot commented Sep 9, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with only the non-blocking existing test-coverage concern still outstanding.

Summary

  • Tests unset, explicit-native, and explicit-browser bindings for Back and Forward.
  • Tests per-application overrides, unrelated foreground applications, and inheritance after clearing an override.
  • Updates comments describing native defaults, browser dispatch, and macOS shortcut handling.

Reviews (2) · Last reviewed commit: "test(agent): assert side-button diversio..."

Comment thread crates/openlogi-agent-core/src/capture_plan.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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-core tests to cover both Back and Forward across unset, explicitly-native, explicitly-browser bindings, plus per-app overrides and inheritance after clearing overrides.
  • Clarified openlogi-core default-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.

Comment thread crates/openlogi-agent-core/src/capture_plan.rs
@davidbudnick davidbudnick added type: bug Something is broken or behaves incorrectly platform: all Cross-platform issue labels Sep 9, 2026
@AprilNEA
AprilNEA merged commit 8486e44 into master Sep 15, 2026
21 checks passed
@AprilNEA
AprilNEA deleted the test/back-forward-capture-coverage branch September 15, 2026 05:04
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: bug Something is broken or behaves incorrectly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants