Skip to content

feat(settings): add a weekly plan card (sleep, Effort and steps goals, Monday to Sunday) - #2821

Open
LeonardSEO wants to merge 1 commit into
ryanbr:mainfrom
LeonardSEO:feat/weekly-plan
Open

LeonardSEO wants to merge 1 commit into
ryanbr:mainfrom
LeonardSEO:feat/weekly-plan

Conversation

@LeonardSEO

Copy link
Copy Markdown

What this PR does

Adds a Weekly plan card under the streak card in Settings on Android and macOS/iOS: this week's progress (Monday to Sunday) toward three goals the user sets in days per week, with a dot per weekday:

  • sleep at least 7 h, default 5 nights
  • reach Effort 10, default 3 days
  • walk 8,000 steps, default 5 days

Each goal shows "Done", "On track" or "Out of reach this week", and its days per week can be changed with - / + (0 turns a goal off). The day counts are stored locally (weeklyPlan.<kind>Days, same keys on both platforms, not in .noopbak). Values outside each metric's plausible range never count.

Pure math in WeeklyPlan (StrandAnalytics) with a Kotlin twin and mirrored fixtures; TZ-free civil-day arithmetic. Display-only.

The official app's weekly plan is server-driven; this is a local equivalent with fixed thresholds.

Type of change

  • New feature

How it was tested

  • WeeklyPlanTests / WeeklyPlanTest (same fixtures: Monday-first weekday index, only this week's days count, implausible values ignored, days left and on-track, goals with 0 days dropped).
  • swift test in Packages/StrandAnalytics: 2146 tests pass.
  • ./gradlew testFullDebugUnitTest: 6691 tests, all pass apart from the 2 RecoveryDriversTest half-tie cases that fail the same way on unmodified main.
  • Tools/i18n_audit.py --ci, Tools/doc_comment_lint.py, docs/protocol-examples checks and Tools/parity_ledger.py --refresh-derived (derived snapshots included): pass.
  • Tools unit tests, the parity acceptance suite and the R-R contract: pass apart from the 4 test_check_source_references cases (/var vs /private/var temp path on macOS) that fail the same way on unmodified main.
  • Apple: the macOS app (Strand) builds with this change on my development branch; StrandTests and the iOS target were not run locally for this branch. app-build.yml covers both.

Checklist

  • Swift package tests pass for any package I touched
  • Android unit tests pass if I touched android/ (apart from the 2 RecoveryDriversTest half-tie cases that fail the same way on unmodified main)
  • No new build warnings introduced (Android: none; Apple warnings not checked per branch)
  • UI changes use only StrandDesign / Palette / Metrics tokens
  • No hardcoded hex frame bytes; protocol facts live in the schema / decoders
  • Follows the conventions in docs/CONTRIBUTING.md
  • I did not commit generated output (Strand.xcodeproj/) or any secrets/keystores

Related issues

None.

🤖 Generated with Claude Code

…to Sunday

Pure math in StrandAnalytics WeeklyPlan with a Kotlin twin and mirrored fixtures. Days per week stored locally under the same keys on both platforms. Display-only.
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