Repository navigation
Arm scanning automatically whenever the switches allow it - #732
Merged
Merged
Conversation
Scanning no longer has an enable button. The runtime arms itself when the saved switches cover the current mode and the environment allows, and the tick loop re-arms after anything that stopped it: a switch or settings save, key learning, Escape, an Android session, or a failed key reservation, which backs off two seconds between attempts. Saving switches and starting a capture pause scanning instead of being refused while it runs, so the Switches tab is never locked. Escape resets the scan and the keys are re-reserved on the next tick; nothing waits for window focus. Exit halts the reconciler before shutting the broker. The configure command drops its enabled flag; the view keeps its shape and the Scanning tab shows the backend's message as its status line. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Greptile SummaryThe PR replaces the manual point-scan toggle with automatic scanning lifecycle reconciliation. It arms scanning when switch assignments and environment checks permit it, pauses safely during configuration and input-handling transitions, and re-arms when scanning becomes eligible again. Confidence Score: 5/5Safe to merge. The previously reported retry-delay issue is resolved: environmental readiness failures return before retry timing is considered, while the retry delay remains limited to arm failures. enaboapps manually resolved the earlier thread without explanation. Reviews (2): Last reviewed commit: "Re-check the environment every tick inst..." | Re-trigger Greptile |
An Android connection or missing input access failed inside arm() and started the two-second retry timer, so scanning stayed off for up to two seconds after the condition cleared. The adapter now exposes a pure ready() check that the reconciler polls each tick; only a failed key reservation or overlay start backs off. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scanning no longer has an enable button. It is armed whenever the saved switches cover the current mode and the environment allows it, and it stays that way while Switchify runs.
Behaviour
IPC
configure_point_scandrops itsenabledargument.get_point_scan, thepoint-scan-changedevent andpoint-scan.jsonkeep their shapes.save_switchesandbegin_switch_captureno longer fail when scanning is on.Validation
tsc, 131 frontend tests plus 5 Node tests, cargo fmt, Clippy all targets with warnings denied, 304 Rust unit tests and 7 integration tests passed on Windows. Tests use fake input and do not send desktop input.
Live check against the dev build with a real saved Space switch: scanning was armed at launch; saving a probe switch re-armed it; changing line speed while armed re-armed it; saving an empty switch list disarmed it with "Scanning starts once a switch has the Select action"; restoring the switch re-armed it. No key events were sent by the agent.
Manual checks remaining: Escape followed by re-arm on a physical switch, learning a key while scanning is armed, an Android connection ending, and a key held by another application while Switchify starts.
Builds on #731.