Skip to content

feat(settings): Privacy & Data — sectioned page + Unpair Ring / Reset App Data#73

Open
rgvxsthi wants to merge 2 commits into
saksham2001:mainfrom
rgvxsthi:feat/privacy-data-reset
Open

feat(settings): Privacy & Data — sectioned page + Unpair Ring / Reset App Data#73
rgvxsthi wants to merge 2 commits into
saksham2001:mainfrom
rgvxsthi:feat/privacy-data-reset

Conversation

@rgvxsthi

@rgvxsthi rgvxsthi commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

Restructures Settings → Privacy & Data into three iOS-grouped sections and adds reset/restore actions.

Sections (SettingsGroup, grouped like the other sub-pages)

  • Diagnostics — Export diagnostics (the "local-first" note is now this group's footer).
  • App data — three destructive, confirmation-gated actions (see below).
  • Demo data — Clear / Reseed demo data.

App-data actions (each behind a confirmation, destructive styling)

  • Unpair Ringble.forget(): the ring forgets this phone; your health data stays.
  • Reset App Data — factory reset: SeedData.clearAll (all SwiftData) + delete the coach API keys from Keychain (OpenAI/Gemini/OpenRouter/MiniMax) + wipe the app's UserDefaults domain + reset the in-memory setting singletons to .default. Emptying UserProfile returns the app to onboarding (RootViews gates on onboardingCompleted).
  • Unpair Ring & Reset App Dataforget() first (so the unbind write flushes), then the full reset.

Notes

  • Only PrivacyDataSettingsView.swift changed; no other Settings pages/structure touched.
  • Adds a small private DangerButton (there's no shared destructive button role) mirroring SecondaryButton's look, tinted PulseColors.danger, role: .destructive.
  • Tested on-device: sectioning renders, unpair drops the ring, Reset App Data lands back on onboarding with everything cleared. Builds clean.

Image Preview

image

…actions

Restructure Privacy & Data into three iOS-grouped SettingsGroup sections
(Diagnostics · App data · Demo data) and add reset/restore actions:
- Unpair Ring — ble.forget() (ring forgets this phone; health data kept).
- Reset App Data — factory reset: SeedData.clearAll (all SwiftData) + delete
  coach API keys from Keychain (OpenAI/Gemini/OpenRouter/MiniMax) + wipe the
  app's UserDefaults domain + reset the in-memory setting singletons to defaults.
  Emptying UserProfile returns the app to onboarding (RootViews gates on it).
- Unpair Ring & Reset App Data — forget() first (flush the unbind), then reset.

All three are confirmation-gated (destructive role, strong warning on reset).
Export diagnostics + Clear/Reseed demo data preserved, re-sectioned.
@rgvxsthi
rgvxsthi requested a review from saksham2001 as a code owner July 9, 2026 14:12
…sted pills

The reset/export/demo actions were capsule buttons wrapped in FormField inside
SettingsGroup, which nested a pill inside each group card (redundant surfaces +
wasted space). Replace them with flat full-width action rows placed directly in
SettingsGroup, so each section is one inset card of rows with hairline dividers
and a one-line footer description — matching the app's other grouped settings.
Destructive App-data actions are tinted danger; behavior (confirmations, wipe,
export, demo) is unchanged. Drops the local DangerButton in favor of the row's
tint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant