Add deliberate confirmation for destructive wallet reset#280
Merged
Conversation
…al accessible and scrollable, and resolve the Metro/Expo dependency issues blocking the app from running.
Contributor
|
This PR cannot be merged automatically because it has merge conflicts. Please update the branch with the latest base branch and resolve the conflicts. After the conflicts are resolved and checks pass, the automation can review it again. |
5 tasks
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.
Summary
Adds deliberate, typed confirmation to the destructive wallet reset flow, so wallet data can no longer be cleared by a single accidental tap.
Related Issue
Closes #220
Screenrecord
Screen_Recording_20260723_120700_Expo.Go.mp4
Acceptance Criteria
Reset requires deliberate confirmation
Reset is gated behind
WalletResetConfirmModal, reachable from Settings → "Sign Out & Clear Wallet" (and from the "Secure Storage Inaccessible" recovery screen). The destructive action is disabled until the user explicitly types a confirmation phrase.Confirmation phrase is clear
The input is labeled
Type "confirm reset" to confirm, with the exact phrase shown directly in the label and placeholder. Matching is trimmed/case-insensitive so minor typing variance (Confirm Reset, extra spaces) isn't punished, without weakening the requirement.Reset cannot proceed until confirmation is valid
The confirm button (
confirmDisabled={!isConfirmed}inConfirmModal) stays disabled — greyed out and non-interactive, withaccessibilityState={{ disabled }}— until the typed text matches. Verified in__tests__/WalletResetConfirmModal.test.tsx.Destructive action is clearly labelled
Modal title "Reset Wallet", a warning banner, an itemized list of exactly what gets deleted (secret key, preferences, contacts, transaction history), a red "Delete Everything" button, and a disclaimer about backing up the secret key first. The entry point button in Settings is styled
danger/red.Flow remains accessible
Added
accessibilityRole,accessibilityLabel, andaccessibilityState(disabled/busy) to the modal's close/cancel/confirm buttons inConfirmModal, which were previously unlabeled for screen readers. Also fixed the modal's layout so it scrolls instead of clipping content on smaller screens, with header and action buttons pinned so they're always reachable, and wrapped it inKeyboardAvoidingViewso the keyboard doesn't obscure the input.Bugs found and fixed while validating the flow end-to-end
(tabs)route group) left the user stranded on wallet screens — a stale route-based guard inapp/_layout.tsxwas skipping the redirect-to-login whenever the current screen was under(tabs). Replaced it with a properwalletCheckedload-state flag inwalletStore, which also fixes the cold-start race the old guard was papering over.metro.config.jsoverride pointed@stellar/stellar-sdkat a deleted nested path; once fixed, a second issue surfaced — the SDK's browser bundle uses private class-field syntax Hermes can't parse, so the resolver now points at the SDK's Node build instead.expo-camera,expo-clipboard,expo-local-authentication,react,babel-preset-expo, andjest-expowere installed at versions incompatible with the project's Expo SDK (54); realigned viaexpo install --fix.Test plan
npx jest __tests__/WalletResetConfirmModal.test.tsx— confirm button disabled on empty/wrong input, enabled on exact (case/whitespace-insensitive) phrase match, cancel works without the phrasenpx jest __tests__/walletStore.test.ts __tests__/walletStore.pagination.test.ts— 24/24 passingnpx jest __tests__/ErrorBoundary.test.tsx— passing