Mirror numbers to both machines from either screen #21

Merged
erik merged 1 commit from feat/task-0318d385-number-mirroring into main 2026-09-23 21:59:21 -05:00
Owner

Summary

Mirror unmodified top-row numbers to both machines while either screen has control, using the existing toggle. No pointer movement or ownership change is needed.

Task

task-0318d385 — Mirror numbers to both machines from either screen

Changes

  • Add a constrained protocol-v2 mirrored-number message for Mac-control input; ordinary keyboard/pointer messages still require Linux control.
  • Gate new mirrored presses on sharing, receiver readiness, and the toggle; preserve repeat/release balance across toggle changes and clean up held state on handoff, disable, lock, and disconnect.
  • Release locally mirrored keys to their original Mac application when Linux control ends, and suppress stale held repeats across repeated handoffs.
  • Validate allowed usages/actions, enforce receiver control and lock state, and keep stale ordinary input separate from fresh Mac-control mirroring.
  • Update both codecs, shared fixtures, tests, protocol documentation, platform upgrade notes, and manual smoke-test instructions.

Compatibility

Both Mac and Linux must be upgraded together: protocol version 2 explicitly rejects version 1. The GNOME extension protocol is unchanged. Package/release publication and deployment are not part of this PR; installed applications and services have not been changed for this task. The separate macOS cursor-activation error is out of scope.

Testing

  • Unit tests added/updated: Rust codec/receiver tests and Swift codec/routing tests cover both directions, exclusions, malformed messages, lock/disconnect, toggle changes, and repeated handoffs.
  • ./scripts/pre-pr.sh passed: Rust formatting/clippy/tests, Swift formatting/macOS app build/tests, and release tooling checks.
  • git diff --check passed.
  • Manual two-machine smoke test not performed; requires deploying matching new builds. Instructions are in README.md.

Checklist

  • ./scripts/pre-pr.sh passes
  • Documentation updated
  • No unrelated changes included

Human merge approval required; do not auto-merge.

## Summary Mirror unmodified top-row numbers to both machines while either screen has control, using the existing toggle. No pointer movement or ownership change is needed. ## Task `task-0318d385` — Mirror numbers to both machines from either screen ## Changes - Add a constrained protocol-v2 mirrored-number message for Mac-control input; ordinary keyboard/pointer messages still require Linux control. - Gate new mirrored presses on sharing, receiver readiness, and the toggle; preserve repeat/release balance across toggle changes and clean up held state on handoff, disable, lock, and disconnect. - Release locally mirrored keys to their original Mac application when Linux control ends, and suppress stale held repeats across repeated handoffs. - Validate allowed usages/actions, enforce receiver control and lock state, and keep stale ordinary input separate from fresh Mac-control mirroring. - Update both codecs, shared fixtures, tests, protocol documentation, platform upgrade notes, and manual smoke-test instructions. ## Compatibility Both Mac and Linux must be upgraded together: protocol version 2 explicitly rejects version 1. The GNOME extension protocol is unchanged. Package/release publication and deployment are not part of this PR; installed applications and services have not been changed for this task. The separate macOS cursor-activation error is out of scope. ## Testing - [x] Unit tests added/updated: Rust codec/receiver tests and Swift codec/routing tests cover both directions, exclusions, malformed messages, lock/disconnect, toggle changes, and repeated handoffs. - [x] `./scripts/pre-pr.sh` passed: Rust formatting/clippy/tests, Swift formatting/macOS app build/tests, and release tooling checks. - [x] `git diff --check` passed. - [ ] Manual two-machine smoke test not performed; requires deploying matching new builds. Instructions are in README.md. ## Checklist - [x] `./scripts/pre-pr.sh` passes - [x] Documentation updated - [x] No unrelated changes included Human merge approval required; do not auto-merge.
feat: mirror numbers without transferring input control
All checks were successful
CI / Rust build, lint, and test (pull_request) Successful in 1m12s
CI / Swift build, lint, and test (pull_request) Successful in 2m21s
e63948a41c
Add a constrained protocol-v2 message so top-row numbers can reach Linux while Mac retains control, with balanced releases across session boundaries.

Task: #task-0318d385
Author
Owner

Review update

  • PR: #21 (open)
  • Task: task-0318d385
  • Reviewed commit: e63948a41cee7d5f60ccf4308901e21c53b2b0b4
  • Result: approved by automated code review; human merge approval remains required.

Summary

The implementation adds a narrowly constrained background mirrored-number message rather than relaxing ordinary input ownership checks. Both codecs explicitly require protocol version 2. Mac routing preserves local delivery and tracks mirrored gestures; receiver validation and lifecycle cleanup preserve control/lock boundaries. Changes are scoped to routing, protocol/receiver support, tests, and documentation.

Acceptance criteria

  • Met — Mac control: handleKey emits one mirrored-number message and leaves the original local event unsuppressed; all ten top-row usages and press/repeat/release actions are tested.
  • Met — Linux control: existing ordinary-key forwarding/local mirroring remains intact, with existing routing tests and new cleanup regressions.
  • Met — Toggle disabled: new presses retain ordinary routing; already-mirrored gestures complete their balanced release, as documented and tested.
  • Met — Exclusions: modified initial presses, other keys, numpad keys, and consumer usages do not enter the background mirroring path; ordinary input remains subject to control ownership.
  • Met — Ownership/pointer unchanged: mirroring decisions contain no handoff or motion; receiver injection does not change ownership. Routing and receiver tests assert this behavior.
  • Met — Lifecycle safety: tests cover toggle changes, repeat/release balance, handoffs including repeated crossings, disable, disconnect, initial/pending GNOME lock, and fresh presses after readiness returns. Locally mirrored key-up events are delivered to the original Mac application before cursor restoration.
  • Met — Automated checks: local ./scripts/pre-pr.sh passed, including macOS app compilation; CI run 73 passed both Rust (1m12s) and Swift (2m21s) jobs for the reviewed commit.
  • Met — Documentation: README smoke tests, platform guides, specification, and wire-protocol documentation explain behavior and the coordinated upgrade requirement.

Findings

  • Blocking issues: 0.
  • Warnings: 0.
  • Criteria: 8 total, 8 met, 0 missing, based on code and automated-test evidence.

Verification boundary

No live two-machine smoke test or deployment was performed. Both machines need matching new builds before release validation; protocol-v1 installations cannot connect to protocol-v2 builds. The separate macOS cursor-activation issue remains outside this task.

Final verdict

Approved. Follow-up: wait for explicit human merge approval. Do not merge or close the task automatically.

### Review update - PR: https://forge.caradoc.com/erik/kvshare/pulls/21 (open) - Task: `task-0318d385` - Reviewed commit: `e63948a41cee7d5f60ccf4308901e21c53b2b0b4` - Result: **approved** by automated code review; human merge approval remains required. ### Summary The implementation adds a narrowly constrained background mirrored-number message rather than relaxing ordinary input ownership checks. Both codecs explicitly require protocol version 2. Mac routing preserves local delivery and tracks mirrored gestures; receiver validation and lifecycle cleanup preserve control/lock boundaries. Changes are scoped to routing, protocol/receiver support, tests, and documentation. ### Acceptance criteria - [x] **Met — Mac control:** `handleKey` emits one mirrored-number message and leaves the original local event unsuppressed; all ten top-row usages and press/repeat/release actions are tested. - [x] **Met — Linux control:** existing ordinary-key forwarding/local mirroring remains intact, with existing routing tests and new cleanup regressions. - [x] **Met — Toggle disabled:** new presses retain ordinary routing; already-mirrored gestures complete their balanced release, as documented and tested. - [x] **Met — Exclusions:** modified initial presses, other keys, numpad keys, and consumer usages do not enter the background mirroring path; ordinary input remains subject to control ownership. - [x] **Met — Ownership/pointer unchanged:** mirroring decisions contain no handoff or motion; receiver injection does not change ownership. Routing and receiver tests assert this behavior. - [x] **Met — Lifecycle safety:** tests cover toggle changes, repeat/release balance, handoffs including repeated crossings, disable, disconnect, initial/pending GNOME lock, and fresh presses after readiness returns. Locally mirrored key-up events are delivered to the original Mac application before cursor restoration. - [x] **Met — Automated checks:** local `./scripts/pre-pr.sh` passed, including macOS app compilation; CI run 73 passed both Rust (1m12s) and Swift (2m21s) jobs for the reviewed commit. - [x] **Met — Documentation:** README smoke tests, platform guides, specification, and wire-protocol documentation explain behavior and the coordinated upgrade requirement. ### Findings - Blocking issues: **0**. - Warnings: **0**. - Criteria: **8 total, 8 met, 0 missing**, based on code and automated-test evidence. ### Verification boundary No live two-machine smoke test or deployment was performed. Both machines need matching new builds before release validation; protocol-v1 installations cannot connect to protocol-v2 builds. The separate macOS cursor-activation issue remains outside this task. ### Final verdict **Approved.** Follow-up: wait for explicit human merge approval. Do not merge or close the task automatically.
erik merged commit 7965bbda47 into main 2026-09-23 21:59:21 -05:00
erik deleted branch feat/task-0318d385-number-mirroring 2026-09-23 21:59:21 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/kvshare!21
No description provided.