Skip to content

refactor: drive key checks from a testable KeyCheckFlow model - #96

Merged
ykisana merged 1 commit into
mainfrom
key-check-flow
Nov 13, 2026
Merged

ykisana merged 1 commit into
mainfrom
key-check-flow

Conversation

@ykisana

@ykisana ykisana commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

The key check kept a dozen flags and per-step guards inside KeySelectModifier, which could only be tested through UI tests.

KeyCheckFlow now 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.

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.
@ykisana
ykisana merged commit 629be40 into main Nov 13, 2026
2 checks passed
@ykisana
ykisana deleted the key-check-flow branch November 13, 2026 05:21
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.

1 participant