Skip to content

feat(pin): show a loading indicator while verifying the PIN#726

Merged
TaprootFreak merged 4 commits into
stagingfrom
fix/pin-login-loading-indicator
Jun 9, 2026
Merged

feat(pin): show a loading indicator while verifying the PIN#726
TaprootFreak merged 4 commits into
stagingfrom
fix/pin-login-loading-indicator

Conversation

@TaprootFreak

Copy link
Copy Markdown
Contributor

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

  • New VerifyPinVerifying state, emitted at the start of checkPin() (before the verifyPin hash) carrying the entered PIN.
  • The view treats VerifyPinVerifying || VerifyPinSuccess as "loading": the number pad is replaced by a centered CupertinoActivityIndicator + label, and the PIN dots stay filled so the screen doesn't look reset. VerifyPinSuccess keeps the spinner up through the post-success wallet load while this screen is still on top (navigation only happens once isLoadingWallet clears).

Changes

  • verify_pin_state.dart: add VerifyPinVerifying.
  • 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).
  • i18n: pinVerifying = "Anmeldung…" / "Signing in…".
  • Tests: cubit sequence (Verifying → Success), state equality, two widget tests; new golden verify_pin_page_verifying (regenerated on dfx01, pumpOnce for the never-settling spinner).

Test plan

  • Analyze & Test green (cubit/state at 100% scoped coverage)
  • Visual Regression green (new verifying baseline)
  • Coverage Floor Gate green
  • Manual (Android): enter PIN → spinner + "Anmeldung…" appears immediately and stays until the dashboard loads

TaprootFreak and others added 4 commits June 9, 2026 20:45
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.
@TaprootFreak TaprootFreak marked this pull request as ready for review June 9, 2026 18:53
@TaprootFreak TaprootFreak merged commit 5fffb74 into staging Jun 9, 2026
12 checks passed
@TaprootFreak TaprootFreak deleted the fix/pin-login-loading-indicator branch June 9, 2026 21:54
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