Skip to content

feat(forwarding): let the PC own hold timing for scanning profiles - #173

Merged
enaboapps merged 4 commits into
mainfrom
codex/pc-owned-scanning-holds-172
Sep 14, 2026
Merged

enaboapps merged 4 commits into
mainfrom
codex/pc-owned-scanning-holds-172

Conversation

@enaboapps

@enaboapps enaboapps commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Closes #172

Summary

Scanning profiles leave hold timing to the PC. Remote's hold-to-stop and 60-second idle stop now apply to keyboard forwarding only, so a long hold on a scanning profile still delivers its release and the PC can offer hold actions past five seconds. A cancelled press is withdrawn with a switch.sync that omits it, so the PC drops the gesture without selecting and the session continues. A replacement press is withdrawn with a switch.sync that omits the switch and then sent as a fresh press, never as a release the PC could act on; keyboard forwarding keeps its synthesized release. Nothing in the controller ends a scanning session on the user's behalf any more; disconnects, explicit Stop and PC refusals still do.

The Forwarding hold to stop setting describes its narrower scope, and the protocol and smoke-test docs describe the new behaviour. The PC side in switchifyapp/switchify-pc applies assignments to a live session and no longer rejects a stale profile revision.

Companion PC PR: switchifyapp/switchify-pc#763

Validation

  • npm run validate on Node 24: lint, TypeScript, 594 tests across 66 suites, 21 of 21 Expo Doctor checks
  • Android development build
  • iOS development build
  • No real input or Bluetooth hardware used by automated tests

Updated tests cover cancelled, held and replaced presses keeping the session active with the expected edges and syncs, and the idle stop not being armed for scanning profiles. An independent review of the first head found the synthesized release on replacement could select on the PC; fixed in the second commit. Physical Android to PC validation of a hold longer than five seconds remains outstanding.

OwenMcGirr and others added 2 commits September 13, 2026 21:03
Hold-to-stop and the idle stop now apply to keyboard forwarding only, so
a long hold on a scanning profile still delivers its release and the PC
can offer hold actions past five seconds. Cancelled presses are withdrawn
with a sync instead of ending the session; replacements send release
then press.

Closes #172

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ing it

A synthesized release would reach the PC as an up edge and could select.
For scanning profiles the old press is withdrawn with a sync that omits
the switch, then the new press is sent.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@enaboapps
enaboapps marked this pull request as ready for review September 14, 2026 18:41
@enaboapps
enaboapps merged commit 35cd429 into main Sep 14, 2026
3 checks passed
enaboapps added a commit that referenced this pull request Sep 15, 2026
* fix(forwarding): restore hold-to-stop for scanning profiles

Removing it in #173 left switch users no way to end a session from a
switch. A release at or past the Forwarding hold-to-stop stops
forwarding without an actionable release again; shorter holds still
deliver their release so the PC can run hold actions. The idle stop
stays off for scanning, and cancelled or replaced presses keep their
sync-based handling.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* test(forwarding): pin safety stop ordering after a hold-to-stop

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Owen McGirr <o.a.mcgirr@gmail.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let the PC own hold timing for scanning profiles

2 participants