feat(pin): show a loading indicator while verifying the PIN#726
Merged
Conversation
After the 6th digit, verifyPin runs an iterated hash off-thread and, on success, the wallet is decrypted and loaded before navigation. On Android both steps can take a noticeable moment while the PIN screen stays up with no feedback. Emit a VerifyPinVerifying state before the hash check and, together with VerifyPinSuccess, swap the number pad for a centered spinner with a "Signing in…" label until the screen navigates away. The PIN dots stay filled so the screen does not look reset mid-wait.
…m regen The golden-regenerate run rewrote home_page_loaded.png with a ~5-byte sub-pixel drift unrelated to this PR, which only adds the PIN verifying screen. Restore the staging home baseline and keep only the new verify_pin_page_verifying baseline.
Because the verifying state hides the number pad, an exception thrown by the off-thread hash or secure storage would otherwise strand the user on the spinner with no way to retry. Wrap checkPin in try/catch and fall back to a plain, recoverable state so the number pad returns.
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.
Summary
After entering the 6-digit PIN, the app showed no loading feedback while it (a) ran the off-thread iterated PIN hash and (b) decrypted + loaded the wallet before navigating to the home screen. On Android this gap is noticeable and looks like a frozen screen. This PR adds a spinner with a "Signing in…" / "Anmeldung…" label that covers both phases.
Why
Reported in tester feedback: after PIN entry on Android, it takes a relatively long time until the next screen appears, with no spinner or anything indicating the app is working in the background.
How
VerifyPinVerifyingstate, emitted at the start ofcheckPin()(before theverifyPinhash) carrying the entered PIN.VerifyPinVerifying || VerifyPinSuccessas "loading": the number pad is replaced by a centeredCupertinoActivityIndicator+ label, and the PIN dots stay filled so the screen doesn't look reset.VerifyPinSuccesskeeps the spinner up through the post-success wallet load while this screen is still on top (navigation only happens onceisLoadingWalletclears).Changes
verify_pin_state.dart: addVerifyPinVerifying.verify_pin_cubit.dart: emit it before the hash check.verify_pin_page.dart: swap number pad → spinner while loading; keep dots filled (block sized to the number pad footprint to avoid layout jump).pinVerifying= "Anmeldung…" / "Signing in…".verify_pin_page_verifying(regenerated on dfx01,pumpOncefor the never-settling spinner).Test plan
Analyze & Testgreen (cubit/state at 100% scoped coverage)Visual Regressiongreen (new verifying baseline)Coverage Floor Gategreen