Skip to content

Streamlined onboarding: skip phrase screen, backup nudge, blur-first reveal#518

Merged
n13 merged 6 commits into
mainfrom
onboarding-phrase-fix
Jun 11, 2026
Merged

Streamlined onboarding: skip phrase screen, backup nudge, blur-first reveal#518
n13 merged 6 commits into
mainfrom
onboarding-phrase-fix

Conversation

@n13

@n13 n13 commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Onboarding: "Create New Wallet" now creates the wallet directly from the welcome screen — the recovery phrase screen and the caution screen are removed from the create flow (both deleted). Import field obscures pasted words with an eye toggle.
  • Backup nudge: home screen shows a "Back up your recovery phrase" banner once the wallet holds > 0.0001 QUAN and the phrase has never been exposed. Tapping it opens the existing Settings flow (caution → biometric auth → phrase). The per-wallet flag is set only when the user actually reveals or copies the phrase; importing a wallet sets it immediately. Debug override in AppConstants.debugAlwaysShowBackupNudge.
  • Blur-first phrase display: the single recovery phrase component now always starts blurred with tap-to-reveal/tap-to-hide, and hidden words render a fixed placeholder so word lengths can't be guessed.
  • Misc: success screen fetches the address checksum on demand (no longer blocks wallet creation), its back button is removed, pull-to-refresh awaits the balance query so balance-driven UI is consistent when the spinner ends, caution-screen checkbox removed (kept for wallet reset), and [TIMING] instrumentation added for rpc/indexer queries behind debugQueryTiming.

Test plan

  • Create wallet from welcome → lands on "Wallet Created" without seeing the phrase; no back button
  • Fund wallet > 0.0001 QUAN → nudge appears (after refresh); faucet button gone
  • Nudge → caution → auth → phrase starts blurred; Done without reveal keeps nudge; reveal or copy dismisses it permanently
  • Import wallet (paste obscured, eye toggle) → never shows nudge
  • Settings → recovery phrase still works; wallet reset still requires checkbox

@n13

n13 commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

I've reviewed the full diff for PR #518. Here's my assessment.

Overall

Clean, well-structured change. The dead screens and their localization keys are fully removed with no dangling references, the caution-scaffold checkbox was made properly optional (DRY, reused for both recovery-phrase and wallet-reset), and the blur-first reveal logic is sound. No analyzer/lint errors on the touched files. Two things should be fixed before merge.

Blocking / important

1. debugQueryTiming is committed as truequantus_sdk/lib/src/constants/app_constants.dart

  // Debug the timing of subsquid and rpc queries
  static const bool debugQueryTiming = true;

This ships verbose [TIMING] ... logs for every RPC/indexer call to production. The PR description says timing is "behind debugQueryTiming," which implies it should default to false. This looks like a leftover from local debugging — flip it back to false.

2. Imported wallets will incorrectly show the backup nudge

The PR summary states "importing a wallet sets it immediately" and the test plan says "Import wallet → never shows nudge" (currently unchecked). But setRecoveryPhraseViewed is only ever called from recovery_phrase_screen.dart — the import flow never sets it:

  Future<void> _import() async {
    ...
      await _settingsService.setMnemonic(mnemonic, widget.walletIndex);
      ...
      _settingsService.setReferralCheckCompleted();
      _settingsService.setExistingUserSeenPromoVideo();
      ...

So an imported wallet at walletIndex 0, once funded above the 0.0001 QUAN threshold, will surface the "Back up your recovery phrase" nudge — even though the user just entered that phrase. Fix is one line in _import():

_settingsService.setRecoveryPhraseViewed(widget.walletIndex);

(Place it alongside the other _settingsService.set* calls so it persists immediately.)

Minor

  • home_screen.dart refresh swallows errors silently in prod. The new catch (e) { quantusDebugPrint('home refresh error: $e'); } only logs in debug builds. Per the repo's "fail early / no silent failures" rule, and to match the existing pattern in _discoverAccounts (which also calls TelemetryService().sendError), consider routing this to telemetry too.
      try {
        await Future.wait([ref.read(balanceProviderFamily(active.account.accountId).future), historyRefresh]);
      } catch (e) {
        quantusDebugPrint('home refresh error: $e');
      }
  • Raw print in the SDK (timing.dart, substrate_service.dart) ships to production stdout when the flag is on. It's consistent with the prior printTiming it replaced, so not new, but worth noting given issue Rust Bindings #1.

Nits

  • 'blurred' hard-coded as the masked-word placeholder in mnemonic_grid.dart — fine since it sits behind a blur and is intentionally not length-revealing, but it's an untranslated literal.
  • checksumNameProvider / backupReminderWalletIndexProvider are non-autoDispose families; negligible, just caches per address forever.

Verified good

  • _goHome still used (PopScope + Done button) after the back-button removal; V2AppBar.showBackButton exists.
  • Threshold math is correct: 10^(decimals-4) = 10^8 raw = 0.0001 QUAN.
  • Reveal/copy correctly fires onPhraseExposed exactly once; tapping "Done" without revealing keeps the nudge.
  • No leftover references to WalletReadyScreenV2, NewWalletRecoveryPhraseScreen, or checksumPhrase.
  • WelcomeScreen doesn't duplicate WalletCreationService responsibilities (invalidate + FCM are caller concerns).

Want me to apply the two fixes (set debugQueryTiming = false and call setRecoveryPhraseViewed on import)?

@n13

n13 commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

Re-review — 1010b120 (against main)

Re-reviewed the full diff after the latest push. The three issues from my first pass are all resolved:

  • debugQueryTiming back to false[TIMING] / RPC logs no longer ship enabled. ✅
  • Imported wallets no longer nudged_import() now calls setRecoveryPhraseViewed(widget.walletIndex) and invalidates recoveryPhraseViewedProvider, matching the stated intent. ✅
  • Home refresh failure surfacedcatch now logs and calls TelemetryService().sendError('Home refresh failed', …) instead of silently swallowing. ✅

Verified good

  • Dead screens (WalletReadyScreenV2, NewWalletRecoveryPhraseScreen) and their l10n keys removed with no dangling references; checksumPhrase param fully gone.
  • Caution scaffold checkbox made optional cleanly (reused for recovery-phrase vs wallet-reset); reset still requires the checkbox.
  • Nudge threshold math correct: 10^(decimals-4) = 10^8 raw = 0.0001 QUAN.
  • Blur-first reveal fires onPhraseExposed exactly once on reveal/copy; tapping Done without revealing keeps the nudge.
  • On-demand checksum (checksumNameProvider) no longer blocks wallet creation; _goHome still wired via PopScope + Done button.
  • No analyzer/lint errors on the touched files.

Minor (non-blocking, optional)

  • mnemonic_grid.dart uses the hard-coded literal 'blurred' as the masked placeholder — fine behind the blur, just untranslated.
  • checksumNameProvider / backupReminderWalletIndexProvider are non-autoDispose families (negligible per-address caching).
  • Raw print in timing.dart / substrate_service.dart is consistent with the prior printTiming, and now gated off by default.

LGTM. 👍

@n13

n13 commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

AI reviews are happy

textAlign: TextAlign.center,
style: text.smallParagraph?.copyWith(
color: colors.checksum,
fontWeight: FontWeight.w400,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why set font weight to 400, AFAIK, smallParagraph already 400

@dewabisma dewabisma left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@n13 n13 merged commit 9a64bd0 into main Jun 11, 2026
1 check passed
@dewabisma dewabisma deleted the onboarding-phrase-fix branch June 22, 2026 03:42
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.

2 participants