feat: move HealthKit permission to onboarding, remove HR write #3

Merged
millianlmx merged 1 commits from fix/healthkit-setup-popup into main 2026-05-24 15:29:12 +02:00
Owner

feat: move HealthKit permission to onboarding

Summary

Move HealthKit permission popup from pre-workout to onboarding so it's asked once during setup and never interrupts workouts again.


What changed

New

  • 🆕 Health step in onboarding between frequency and ready
  • 🆕 Non-blocking flow: Allow Health Access or Not Now
  • 🆕 Analytics tracking for permission decisions (granted/denied)
  • 🆕 4 new L10n keys + EN/DE/ES/FR translations
  • 🆕 Entry animation on HealthStep (fade-in + slide-up)

Removed

  • HealthKit auth from PlayerViewModel.startWorkout() — no more popup mid-workout
  • Heart rate write from authorization popup (kept HR read for live sessions)
  • Heart rate sample writing from saveWorkout() — would fail without write perm

Fixed (post-review)

  • 🔒 Bottom button bypass on .health step — now hidden
  • 🔒 Guard isAuthorized before live session start
  • 🔒 try?do/catch with explicit error logging

Files changed (6 files, +197 / −23)

File Change
Views/Onboarding/OnboardingView.swift HealthStep view, analytics, animation
ViewModels/PlayerViewModel.swift Remove auth call, add isAuthorized guard
Services/HealthKitService.swift Remove HR from writeTypes, remove HR sample code
Utilities/Strings.swift 4 new onboarding keys
Resources/Localizable.xcstrings EN/DE/ES/FR translations

Flow

flowchart LR
    A[Welcome] --> B[Name] --> C[Level] --> D[Goal] --> E[Frequency] --> F[🆕 Health]
    F --> G{Allow Health Access?}
    G -->|Granted| H[analytics.granted]
    G -->|Not Now| I[analytics.denied]
    H --> J[advance]
    I --> J
    J --> K[Ready]

Verified

Check Status
Build (iPhone 17 Pro Simulator) SUCCEEDED
Code review 5 issues fixed
Philosophy (code-philosophy) PASS
detect_changes scope confirmed

Branch: fix/healthkit-setup-popupmain
Commit: 310124a

## feat: move HealthKit permission to onboarding ### Summary Move HealthKit permission popup from pre-workout to onboarding so it's asked **once during setup** and never interrupts workouts again. --- ### What changed **New** - 🆕 **Health step** in onboarding between frequency and ready - 🆕 Non-blocking flow: **Allow Health Access** or **Not Now** - 🆕 Analytics tracking for permission decisions (granted/denied) - 🆕 4 new L10n keys + EN/DE/ES/FR translations - 🆕 Entry animation on HealthStep (fade-in + slide-up) **Removed** - ❌ HealthKit auth from `PlayerViewModel.startWorkout()` — no more popup mid-workout - ❌ Heart rate write from authorization popup (kept HR read for live sessions) - ❌ Heart rate sample writing from `saveWorkout()` — would fail without write perm **Fixed** (post-review) - 🔒 Bottom button bypass on .health step — now hidden - 🔒 Guard `isAuthorized` before live session start - 🔒 `try?` → `do/catch` with explicit error logging --- ### Files changed (6 files, +197 / −23) | File | Change | | ------------------------------------- | ------------------------------------------------ | | `Views/Onboarding/OnboardingView.swift` | HealthStep view, analytics, animation | | `ViewModels/PlayerViewModel.swift` | Remove auth call, add `isAuthorized` guard | | `Services/HealthKitService.swift` | Remove HR from writeTypes, remove HR sample code | | `Utilities/Strings.swift` | 4 new onboarding keys | | `Resources/Localizable.xcstrings` | EN/DE/ES/FR translations | --- ### Flow ```mermaid flowchart LR A[Welcome] --> B[Name] --> C[Level] --> D[Goal] --> E[Frequency] --> F[🆕 Health] F --> G{Allow Health Access?} G -->|Granted| H[analytics.granted] G -->|Not Now| I[analytics.denied] H --> J[advance] I --> J J --> K[Ready] ``` --- ### Verified | Check | Status | | ------------------------------- | ----------------- | | Build (iPhone 17 Pro Simulator) | ✅ SUCCEEDED | | Code review | ✅ 5 issues fixed | | Philosophy (code-philosophy) | ✅ PASS | | `detect_changes` scope | ✅ confirmed | --- **Branch:** `fix/healthkit-setup-popup` → `main` **Commit:** `310124a`
millianlmx added 1 commit 2026-05-24 15:28:23 +02:00
feat: move HealthKit permission to onboarding, remove HR write
All checks were successful
CI / Detect Changes (pull_request) Successful in 3s
CI / Admin Web CI (pull_request) Has been skipped
CI / YouTube Worker (pull_request) Has been skipped
CI / Deploy (pull_request) Has been skipped
310124ad63
- Add .health step to onboarding between frequency and ready
- HealthStep with non-blocking permission flow (Not Now skips)
- Remove requestAuthorization() from PlayerViewModel.startWorkout()
- Guard live session start with isAuthorized check
- Remove heart rate write from HealthKit authorization popup
- Remove HR sample writing from saveWorkout (now without permission)
- Add L10n keys: healthAccess, healthAccessSubtitle, allowHealthAccess, notNow
- Add EN/DE/ES/FR translations
- Track permission decisions through analytics
- Entry animation on HealthStep (fade-in + slide-up)

HealthKit permission is now asked once during onboarding,
never interrupting workouts again.
millianlmx merged commit 77c17046d5 into main 2026-05-24 15:29:12 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: millianlmx/tabatago#3