Skip to content

fix(gui): choose the receiver before pairing a device - #1614

Open
hornej wants to merge 7 commits into
AprilNEA:masterfrom
hornej:fix/pairing-receiver-selection
Open

hornej wants to merge 7 commits into
AprilNEA:masterfrom
hornej:fix/pairing-receiver-selection

Conversation

@hornej

@hornej hornej commented Sep 28, 2026 •

Copy link
Copy Markdown

Summary

With both Unifying and Bolt connected, Add Device used the first enumerated receiver, so a Bolt mouse could never appear when Unifying came first. Add Device now asks which receiver to use and retains that exact choice through retries and window recreation.

Changes

  • openlogi-desktop: show identified receivers from live inventory, distinguish matching names with an ID suffix, and retain the selection when the window reopens. Cancel and Change receiver wait for cleanup acknowledgement; stale observations cannot reopen the previous flow.
  • openlogi-agent: acknowledge cancellation after receiver restoration and session-lease release, including cancellation with no active session.
  • openlogi-device, openlogi-agent-core: match the selected product/hardware ID without fallback. Share inventory identity evidence with pairing so a selected receiver's open failure retains its diagnostic, while unrelated open failures cannot hide a missing selection. Successful opens verify the live UID before writes; confirmed disconnects discard cached identity evidence. Preserve route-based unpair error reporting and bounded UID repair.
  • openlogi-core, openlogi-ipc: append the explicit receiver selector without changing existing selector encodings; advance IPC from upstream 35 to 36, retaining upstream pointer-scaling operation encodings.
  • openlogi-ui, docs: add the six chooser/cancellation strings to all 24 catalogs, including the new Czech catalog, with English fallback pending translations; document selection and recovery.

Refreshed against master e5837541 (v0.8.13). This incorporates upstream's Rust 1.99 compatibility fixes from #1638, which address the October 10 CI failures. The merge retains the upstream titlebar and pairing-icon fixes, with all four upstream icon/passkey tests preserved alongside the receiver-selection tests.

This PR remains independent of #939. Refresh the IPC version when combining or landing independent wire changes, and keep GUI/agent/overlay/CLI binaries from one source tree together.

Testing

Windows x86_64, Rust 1.99.0, with RUSTFLAGS=-D warnings and RUSTDOCFLAGS=-D warnings, on the final merged tree:

  • cargo fmt --all -- --check
  • cargo clippy --locked --workspace --all-targets -- -D warnings
  • cargo test --locked --workspace — 1,969 passed; two existing doctests ignored.
  • cargo doc --locked --workspace --no-deps --document-private-items --exclude openlogi-ui --exclude openlogi-desktop --exclude openlogi-overlay --exclude openlogi-agent
  • cargo xtask ci wasm ast-grep typos — three passed, none skipped.
  • git diff --cached --check

The workspace test run includes 17 fixed-byte IPC tests, 11 receiver-selection regressions, 12 inventory replay tests, 12 pairing-window tests (including the four upstream icon/passkey tests), locale catalog parity, and desktop localization tests. Receiver coverage includes mixed families, two Bolt receivers, retained targets on retry/reopen, acknowledged cancellation, stale observations, UID recovery, selected/unrelated open failures, and disconnect identity eviction.

The inherited Rust 1.99 fixes pass without PR-specific changes to the toolchain, dependency lockfile, or CI workflow. The remaining CI matrix runs on GitHub; Linux/macOS, MSRV, dependency policy, shell, and installer jobs were not rerun locally.

GitHub reports head 8bde7a50 as mergeable. Its CI run and Build run currently require upstream maintainer approval before they can execute.

This PR head is not runtime-tested on hardware. macOS/Linux checks and fresh native-window screenshots were not run locally. The screenshot below comes from the earlier Windows preview with synthetic inventory, not this refreshed head.

Hardware verification: connect Unifying and Bolt, choose Bolt, and complete MX Master 4 authentication. Close/reopen Add Device during a session and retry after failure. Change receiver and confirm the chooser waits for cleanup. Unplug the selected receiver and ensure retry does not pair on another receiver. Repeat with two receivers of the same family, including an open failure on the remaining receiver; reconnect guidance must stay visible. Check that a transient UID failure recovers without reconnecting.

Native receiver chooser with synthetic inventory

@hornej
hornej requested a review from AprilNEA as a code owner September 28, 2026 16:55
@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issue was established.

Summary

Add Device now lets the user choose a receiver before pairing and keeps that choice for retry and window reopening.

  • Add Device lets people choose and keep a receiver.
  • Pairing stays on the receiver the user selected.
  • Changing receivers waits until pairing cleanup finishes.

Diagram

sequenceDiagram
  participant User
  participant Desktop
  participant Agent
  participant Receiver
  User->>Desktop: Choose receiver
  Desktop->>Agent: Start with product ID and UID
  Agent->>Receiver: Open and check live UID
  Receiver-->>Agent: Matching identity
  Agent-->>Desktop: Pairing progress
  User->>Desktop: Cancel or change receiver
  Desktop->>Agent: Cancel pairing
  Agent->>Receiver: Cancel and restore notifications
  Agent->>Agent: Release session lease
  Agent-->>Desktop: Cancellation acknowledged
  Desktop-->>User: Show receiver chooser
Loading

Reviews (5) · Last reviewed commit: "fix(gui): refresh receiver selection for..." · Reviewed by Greptile

Comment thread crates/openlogi-desktop/src/windows/add_device.rs
Comment thread crates/openlogi-desktop/src/windows/add_device.rs Outdated
Comment thread crates/openlogi-device/src/pairing.rs Outdated
Comment thread crates/openlogi-desktop/src/windows/add_device.rs
Comment thread crates/openlogi-device/src/pairing.rs Outdated
Comment thread crates/openlogi-device/src/pairing.rs Outdated
@davidbudnick davidbudnick added area: gui Graphical user interface platform: all Cross-platform issue type: bug Something is broken or behaves incorrectly labels Oct 9, 2026
@hornej
hornej requested a review from davidbudnick as a code owner October 10, 2026 21:26

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: gui Graphical user interface 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.

2 participants