Repository navigation
fix: return to the key picker when a key prompt is cancelled - #103
Merged
Merged
Conversation
Cancelling or failing a key prompt ended the whole key check, so with a Default Key set there was no way to use another key (#92). When the picker has something else to offer, Cancel, a wrong NFC tag or closing the location check now returns to Choose Key. - Location is a screen inside the key sheet, like the QR scanner, so closing it goes straight back to the picker. - With an NFC default, Apple's popup comes up alone. Once it covers the screen, the picker slides in behind it as a short strip, then grows to full height when the popup closes. A wrong tag waits for Apple's error message to close first. - iOS sends nothing until the app becomes active after Apple's popup closes, so NFCService ends the scan then instead of waiting for the later delegate callback. - Scans are tracked by ID and NFC callbacks by session, so a late result from an old scan can't end or pass the current one. Fixes #92
ykisana
force-pushed
the
key-picker-fallback
branch
from
November 14, 2026 04:56
db836d2 to
4c3a633
Compare
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.
Fixes #92.
Cancelling or failing a key prompt used to end the whole check, so with a Default Key set there was no way to use a different key. Now, when the picker has something else to offer (another key type, or Block without key), the prompt returns to Choose Key instead:
This applies wherever the key check runs: Home, group cards, key-protected toggles, widgets and Shortcuts hand-offs. With only one key type and no bypass, nothing changes.
NFC default. Apple's popup comes up alone. Once it covers the screen, the picker slides in behind it as a short strip (no second dimming). When the popup closes, the strip grows to the full picker. A correct tag closes the strip behind Apple's "Key Verified" message. NFC picked from the picker keeps the full picker under Apple's popup, as before.
NFC timing. Measured on an iPhone 16e (iOS 26.5.2): iOS sends the app nothing while Apple's popup is closing. The first signal is the app becoming active, roughly 0.5–1 s after the popup is gone, and the session-ended callback comes about 0.5 s after that.
NFCServiceends the scan when the app becomes active instead of waiting for the callback. A wrong tag also waits for Apple's error message to close, so the picker doesn't grow behind it.Stale results. Scans in the flow are tracked by their own ID, and
NFCServiceignores callbacks and tag reads from a session that is no longer current, so a late result can't end or pass the scan that replaced it.Testing
KeyCheckFlowTestscover NFC cancel and wrong-tag retry, the minimized picker (shown only when there is another option, closed on success, full height for NFC chosen from the picker), QR Cancel (including the late-result race), Location shown in the key sheet and closing it, and the block flow.BlockingUITestspass on the simulator.