Files
mantra-kmp/composeApp
Kgothatso Ngako c7b2dd25d9 feat: give the profile's key entry a recovery screen instead of a dead end
"Profile Keys" was an ImplementationPendingRoute: a key icon that led
nowhere. It is now "Key Recovery", and it opens the recovery hub the
Machankura app already has -- recovery phrase, cloud backup, emergency
kit, and YOLO -- because a mantra profile *is* its seed. The npub that
signs and the wallet that holds coins both come off one seed that never
leaves the device, so a phone lost before a backup takes the account
with it, and there is no server to ask for it back.

The recovery phrase screen is the part that does the work: it decrypts
the seed file through the existing loadAndDecryptSeed expect/actual,
matches the active wallet's id against it, and shows that wallet's 12
words numbered in two columns behind an explicit reveal. The two backup
confirmations are stored in that wallet's InternalPrefs, so they survive
a re-install on the same seed, and the not-backed-up warning they clear
is also what the hub reads for its status line.

Cloud backup and the emergency kit route to the app's "coming soon"
screen; they are placeholders in Machankura too.

The read runs on Dispatchers.IO -- it is keystore-backed and blocks --
and the state it writes is a MutableStateFlow rather than a
mutableStateOf, because a ViewModel built during composition silently
loses an off-main-thread write made inside that first composition.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-08 09:16:54 +02:00
..