Skip to content

Profile: derive age from date of birth instead of a manual number (#146)#6

Closed
digitalerdude wants to merge 2 commits into
mainfrom
age-from-date-of-birth
Closed

Profile: derive age from date of birth instead of a manual number (#146)#6
digitalerdude wants to merge 2 commits into
mainfrom
age-from-date-of-birth

Conversation

@digitalerdude

Copy link
Copy Markdown
Owner

Summary

  • Addresses Automatically calculate age instead of updating it manually ryanbr/noop#146.
  • ProfileStore now persists dateOfBirth and computes age from it instead of storing a manually-entered, silently-staling number. Every existing consumer (HR-max/Tanaka, calories, Fitness Age, Body Age) keeps reading profile.age unchanged since it stays a computed Int.
  • Settings and onboarding's age Stepper become a DatePicker, bounded to the same 13–100 age range the stepper enforced.
  • A pre-existing stored age migrates to an equivalent date of birth on first launch. The legacy profile.age UserDefaults key stays mirrored on every change so the cross-platform .noopbak backup whitelist (BackupSettings.swift, mirrored by Android) keeps round-tripping unchanged — no changes needed there. A resync path also handles the case where a .noopbak restore only carries the legacy age key.

Test plan

  • macOS (Strand) and iOS (NOOPiOS) targets both build clean via xcodebuild.
  • Migration/derivation logic verified against a standalone script covering: fresh install, pre-Automatically calculate age instead of updating it manually ryanbr/noop#146 upgrade (legacy age only), steady state, and a backup-restore mismatch scenario — all pass.
  • Grepped every remaining profile.age call site across the app (HR zones, calories, Fitness/Body Age, IntelligenceEngine) — confirmed none needed changes.
  • Could not get a live visual check of the Settings/onboarding DatePicker in this environment (no GUI access) — worth a manual look before merge.

🤖 Generated with Claude Code

…anbr#146)

Age silently went stale once entered, so age-based metrics (Fitness
Age, HR-max/Tanaka, calorie estimates) drifted unless the user
remembered to bump the number. ProfileStore now stores a dateOfBirth
and computes age from it; the Settings and onboarding age Stepper
become a DatePicker. A pre-ryanbr#146 install's stored age is migrated into
an equivalent date of birth on first launch, and the legacy
profile.age UserDefaults key stays mirrored so the existing
cross-platform .noopbak backup whitelist keeps round-tripping
unchanged.
@digitalerdude

Copy link
Copy Markdown
Owner Author

Closing this fork-internal PR to declutter — the real submission lives at ryanbr/noop (upstream). See that repo's PR list for the current, actionable version of this work.

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