feat(mobile): add native app unlock state - #5719
Merged
iscekic merged 6 commits intoSep 1, 2026
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (6 files)
Previous Review Summary (commit 4320843)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 4320843)Status: No Issues Found | Recommendation: Merge Files Reviewed (6 files)
Reviewed by grok-4.6 · Input: 100.7K · Output: 5.2K · Cached: 78.7K Review guidance: REVIEW.md from base branch |
eshurakov
approved these changes
Sep 1, 2026
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
No new behavior — this change does not connect app unlocking to a setting or a lock screen.
AppUnlockProvideranduseAppUnlockexposeUnlockState,AppUnlockContextValue, andOutcomefor device-local locking;setEnabledchangesapp-unlock-enabledonly after authentication and durable storage.Enabled cold starts and returns after at least five background minutes trigger locking; absent preferences keep older installations disabled.
nativeResultSchemavalidates native results; callers supplypromptMessage, render protection, and useretryfor failed preference reads or locked authentication.Files
apps/mobile/src/lib/app-unlock-context.tsx— adds preference loading/error states, operation phases, and busy feedback. Setting changes authenticate both directions, wait for storage, and retain the prior preference after save failure. Requests run only while active and idle. Native capability checks permit biometrics and passcode fallback; outcomes distinguish setup requirements, cancellation, lockout, and other failures. Setup reasons distinguish missing hardware, unenrolled biometrics, unavailable authentication, and an absent passcode. Lazy imports contain missing-module errors, and success validation accepts nullable iOS fields. Invalid stored values become preference errors instead of disabling protection. Interval tracking excludes inactive-only and duplicate events, prevents concurrent or recursive prompts, and scopes completed attempts to their pending returns. Saving an enabled preference preserves a newer lock; saving disabled clears it. The hook requires its provider, prompt text follows updates, and unmounting removes event handling and stops state publication.expo-local-authenticationbecomes a native dependency at~57.0.2, withfaceIDPermissiondescribing app unlocking through Face ID.The module and permission require a rebuilt native client; older clients return a failed authentication outcome instead of crashing.
Files
apps/mobile/app.config.ts— registers the authentication plugin with “Allow Kilo to use Face ID to unlock the app.”apps/mobile/package.json— adds theexpo-local-authenticationdependency at~57.0.2.Tests: 2 files added —
apps/mobile/src/lib/app-unlock-context.mounted.test.tsx(+285 lines) andapps/mobile/src/lib/app-unlock-context.test-helpers.tsx(+120 lines).Generated: 1 lockfile updated —
pnpm-lock.yaml(+13 lines).Verification
Local end-to-end verification on an iOS simulator, 2026-09-01. Seven of eleven checks passed. Four have partial coverage.
This section covers the stack's three PRs together: #5715, #5719, and #5721.
No product bug was found. No product source changed. The worktree stayed clean.
Test-harness limits, not defects
simctl biometric. Native simulator enrollment, match, and failure notifications were used instead.Setup
mobile-context-unlock-a61f-s3, simulator iOS 26.5.xcrun simctl io <udid> screenshot. Full report and images:/Users/igor/Projects/.scratch/local-e2e-context/.