Repository navigation
refactor: drive key checks from a testable KeyCheckFlow model - #96
Merged
Merged
Conversation
The key check kept a dozen @State flags and per-step identity guards inside KeySelectModifier, so its rules were spread out and only testable through UI tests. KeyCheckFlow now holds one request (keys, available key types, bypass, default key) and one stage. Every step checks it belongs to the current request, and only the current request's action can run: - a stale scan result, bypass tap, location result or sheet dismissal is ignored; - a repeated selection can't start a second scan. KeySelectModifier just renders the stage. KeyManager is gone. The widget responder keeps one active-request value instead of four loose ones. A link that arrives while its duration sheet is open is held and replayed when the sheet closes, instead of being dropped. Adds unit tests for the flow and a UI test for the picker → location → duration path.
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.
The key check kept a dozen flags and per-step guards inside
KeySelectModifier, which could only be tested through UI tests.KeyCheckFlownow holds one request and one stage, and only the current request's action can run, so stale scans, bypass taps, location results and dismissals are ignored by design. Widget links that arrive while a duration sheet is open are held and replayed instead of dropped.