Skip to content

Add an encryption key status section to the Settings screen #169

Description

@Lakes41

Difficulty: Intermediate
Type: Feature / UI-UX

Background: KeyManager.getKeyInfo() already returns { key, createdAt, needsRotation }, and rotation is currently fully automatic and invisible to the user (triggered silently during initialize()). app/settings.tsx exists and is the natural home for device/security-related visibility, but doesn't currently surface anything about the offline-cache encryption key.

Problem: There's no way for a user (or a support agent troubleshooting a "my offline data disappeared" report) to see when the encryption key was created, whether it's due for rotation, or to manually trigger rotation/cache-clear — all of this state exists in KeyManager but is completely invisible in the UI today.

Expected outcome: A new "Offline Data & Security" section in app/settings.tsx showing the key's creation date (formatted relative, e.g. "Created 12 days ago"), whether rotation is due, and a manual "Rotate encryption key now" action with a clear confirmation dialog explaining the effect on offline data.

Suggested implementation: Add a useKeyInfo() hook (or call keyManager.getKeyInfo() directly in an effect) in settings.tsx; render the info in a Card; wire a button to keyManager.rotateKey() behind a confirmation Alert. This issue pairs naturally with Issue #5/Advanced Issue #3 — the confirmation copy should be accurate about whether rotation currently preserves or clears offline data.

Acceptance criteria:

  • Settings screen shows key age and rotation-due status, reading real KeyManager state.
  • Manual rotation is gated behind an explicit confirmation with accurate copy about data impact.
  • pnpm typecheck passes; screenshot included in the PR per existing NativeWind/UI reviewer conventions.

Likely affected files: app/settings.tsx, src/lib/keyManager.ts, tests/components.test.tsx (or a new settings test).

Labels: feature, ui, security, GrantFox OSS, Maybe Rewarded, Official Campaign | FWC26

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesOfficial Campaign | FWC26Official FWC26 campaign issue — eligible for campaign scoring and rewardsfeatureNew feature, enhancement, or functional additionsecuritySecurity-related fix, hardening, audit, or vulnerability remediationuiui

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions