Promote: staging -> develop#728
Merged
Merged
Conversation
…llet fix(kyc): open BitBox connect sheet when linking shareholder wallet
…siness relationship" (#721) ## Summary The account action in **Settings** opens a logout flow but was labelled **"Terminate business relationship"** (DE: *"Geschäftsbeziehung beenden"*), implying account closure rather than signing out. Relabel it to **"Logout" / "Abmelden"**, consistent with the wording already used throughout the confirm sheet (`realunitWalletLogout`, `logout`). ## Why The settings entry triggers `SettingsConfirmLogoutWalletSheet` → `DeleteCurrentWalletEvent`: a local logout that removes the wallet from the device (hence the recovery-phrase-backup acknowledgement the sheet forces before the action). It does **not** terminate the DFX business relationship, so the previous label was misleading and caused tester confusion. Only the user-facing string changes. The i18n key (`settingsDeleteWallet`) and all logic are intentionally untouched to keep the change focused. ## Changes - **App string** — `assets/languages/strings_{de,en}.arb`: `"Geschäftsbeziehung beenden"` → `"Abmelden"`, `"Terminate business relationship"` → `"Logout"`. - **Visual regression** — settings page Goldens regenerated on the dfx01 runner (`settings_page_default.png`, `settings_page_bitbox.png`); an unrelated ~5 B sub-pixel drift on the home baseline from the regen run was reverted to keep the diff scoped. - **Handbook** — `docs/handbook/de/index.html`: synced the three references to the renamed entry (settings list, screenshot alt text, confirm-sheet description). - **E2E** — `.maestro/handbook/24-settings-delete-wallet.yaml`: retargeted the tap selector from `.*Geschäftsbeziehung beenden.*` to `.*Abmelden.*` so the tier-3 handbook flow keeps finding the entry (still gated on the confirm sheet not yet being visible). ## Test plan - [ ] `Analyze & Test` green - [ ] `Visual Regression` green (settings page baselines reflect the new label) - [ ] `Coverage Floor Gate` green - [ ] `Handbook Build Check` green - [ ] Manual: Settings → entry reads "Abmelden"/"Logout" → opens the logout confirm sheet → logout works --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## 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 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Problem Connecting a **brand-new BitBox that has no wallet set up** (no seed) left the user stuck. Pairing succeeds, but the device has no seed to derive an ETH address from, so `getETHAddress` comes back empty. That empty read failed as a generic error → `BitboxNotConnected` → a SnackBar "something went wrong" → and because the re-scan timer is re-armed, the device is immediately found again and the user is walked through the pairing code → fail → SnackBar **loop**, with no hint that the real problem is simply an un-set-up device. (The earlier fix #710 stopped the empty address from being *persisted* — no more grey screen — but did not distinguish "no seed" from a transient empty read.) ## What changed After channel-hash verify, read the device's firmware status via the new `bitbox_flutter` `getDeviceStatus()` (cached read, no device round-trip). When it reports `uninitialized`, emit a dedicated **`BitboxNotInitialized`** state that explains the user must set up / restore a wallet on the device first. - The state offers a **retry** (`recheckDeviceStatus`) that re-reads the status — if the user has since set up a wallet, the connection continues without re-pairing. - It deliberately **does not arm the re-scan timer**, so the silent re-pair loop is gone. - Only `uninitialized` is treated as "no wallet". Other non-ready statuses (e.g. firmware-upgrade-required) intentionally keep the existing failure path rather than being mislabelled. The address-derivation/observe/sign tail of `confirmPairing` was extracted into `_acquireWalletAndConnect()` so the initial flow and the retry share one path. ## Dependency Requires `bitbox_flutter` `getDeviceStatus()` from **[DFXswiss/bitbox_flutter#29](DFXswiss/bitbox_flutter#29. This PR temporarily pins the plugin to that fix branch; it will be moved to the **`v0.0.9`** tag once #29 is merged and tagged. **Kept as Draft until then.** ## Test plan - [x] `flutter analyze` — clean (only the pre-existing generated-`i18n.dart` warning) - [x] `flutter test` — bitbox cubit / service / view suites all green - [x] Cubit: unseeded → `BitboxNotInitialized`, no wallet created, no re-scan loop (state stays stable); retry continues once seeded; retry stays while still unseeded; no-op off-state - [x] Service: `getDeviceStatus` pass-through via the simulator - [x] Widget: `BitboxNotInitialized` renders retry + cancel; retry calls `recheckDeviceStatus` - [x] i18n: new keys in both `de`/`en` ARBs (case-sensitive ASCII order), regenerated - [ ] On-device: pair an un-set-up BitBox → lands on the explanatory screen; set up a wallet + retry → continues to the dashboard
2 tasks
## Summary - Adds one missing test for the `catch` block in `recheckDeviceStatus()` (lines 242–245 in `connect_bitbox_cubit.dart`) - The scenario: device was `uninitialized` on first pair → `BitboxNotInitialized`; user sets up wallet; `recheckDeviceStatus` is called but `createBitboxWallet` throws → cubit must fall back to `BitboxNotConnected` - Fixes Coverage Floor Gate failing at 99.9% (4924/4928 lines) in PR #728 ## Test plan - [ ] `flutter test test/screens/hardware_connect_bitbox/bloc/connect_bitbox_cubit_test.dart` passes - [ ] Coverage Floor Gate reaches 100%
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.
Automatic Staging PR
This PR was automatically created after changes were pushed to staging.
Commits: 1 new commit(s)
Checklist