feat(onboarding): make passphrase tip non-skippable with inline opt-in toggle#235
Merged
Merged
Conversation
…-derives Enabling/disabling BIP-39 passphrase protection from Device Settings left every wallet address — including 'view on device' — showing the previous (standard) wallet until a physical reconnect. Root cause is in firmware: storage_setPassphraseProtected() only flips the passphrase_protection flag and does NOT invalidate session.seedCached. The seed derived earlier in the session (empty passphrase) stays cached, so storage_getRootNode() keeps returning it even after the user enters a new passphrase. A USB unplug power-cycles the device and clears the cache, which is why reconnecting 'fixed' it. Fix without requiring a reconnect: engine.applySettings() now sends ClearSession after toggling usePassphrase, dropping the cached seed + passphrase + PIN so the device re-prompts and re-derives from the correct seed. The device routes back through needs_pin -> needs_passphrase, which also resets the in-memory account managers and remounts the dashboard, so stale addresses/balances in the UI clear too. Skipped on the emulator. DeviceSettingsDrawer: both enable and disable now re-auth, so neither path calls getFeatures inline (would race promptPin's getPublicKeys); the drawer re-fetches features when it next opens.
…n toggle
The post-setup 'Hidden Wallets' tutorial card is now mandatory and carries the
real passphrase toggle, so every new user makes a deliberate choice instead of
skipping past the explanation.
- TutorialCards: cards can be marked interactive:'passphrase' + nonSkippable.
The passphrase card renders an on/off toggle and a 'change anytime in
Settings' hint, and hides its Skip button. Next shows a spinner while the
choice is applied.
- OobSetupWizard: the toggle choice is held locally (default OFF) and applied
via applySettings({usePassphrase:true}) only when the user clicks Continue,
then the wizard advances to 'complete' (the device's PIN/passphrase re-prompt
overlays follow naturally). Skipping an earlier tip now lands on the
passphrase card so it cannot be bypassed.
- en/setup.json: toggleLabel + settingsHint strings (defaultValue fallbacks
keep other locales working until translated).
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.
What
During OOB setup, the post-setup "Hidden Wallets" tutorial card is now mandatory and carries the actual passphrase toggle — so every new user makes a deliberate on/off choice instead of skipping past the explanation. A hint tells them it can be changed later in Settings.
applySettings({ usePassphrase: true })only when the user clicks Continue (not the instant they flip the switch), so the device's PIN/passphrase re-prompt appears as the wizard moves tocompleterather than popping over the tutorial mid-read. The Continue button shows a spinner while applying.How
TutorialCards.tsx:TutorialCardgainsinteractive?: 'passphrase'andnonSkippable?.TutorialPagerenders the toggle + settings hint for the interactive card, hides Skip on non-skippable cards, and supports anextPendingspinner state. NewCardToggleswitch.OobSetupWizard.tsx:tipPassphraseEnabled(default false) + apply-on-Continue logic in thesecurity-tipsstep;onSkiproutes to the passphrase card. Synchronous re-entrancy guard mirrors the existingapplyingLabelRefpattern.en/setup.json:toggleLabel+settingsHint. Thet()calls usedefaultValuefallbacks so untranslated locales render correctly until the i18n gapfill runs.Dependency / ordering
Stacked on #234 (
fix/passphrase-toggle-stale-seed) and includes its commit. #234'sclearSessionis what makes enabling passphrase mid-session actually re-derive the correct seed — without it, opting in here would show the standard wallet's addresses until a reconnect. Merge #234 first (or together); this PR's diff narrows to the onboarding commit once #234 lands.Test plan (requires an uninitialized device → OOB flow)