Skip to content

Add annual location time forecasts - #187

Open
kyleve wants to merge 12 commits into
mainfrom
codex/location-time-forecasts
Open

Add annual location time forecasts#187
kyleve wants to merge 12 commits into
mainfrom
codex/location-time-forecasts

Conversation

@kyleve

@kyleve kyleve commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Posted by an AI agent on kve's behalf.

Summary

  • add current-year location forecasts once three complete months have elapsed
  • show the three leading location estimates and a focused-calendar estimate
  • let the user guide the estimate with one synced inclusive planned-stay date
  • preserve planned-stay revisions through SwiftData, CloudKit conflict resolution, and backup format v3
  • keep the forecast model independent so future percentage goals can compare against it

Behavior and trade-offs

The baseline annualizes days attributed to a region through today. A matching planned stay counts tomorrow through its inclusive departure date at full weight, then resumes the baseline pace for the remaining year. Only one planned stay is active at a time; clearing or expiry writes a tombstone so delayed sync cannot resurrect it.

Testing

  • ./test --no-generate --everything — 1,638 unit tests and 33 snapshot suites passed
  • ./swiftformat --lint
  • ./xcstrings --lint
  • ruby -c Where/Tools/upgrade-backup.rb
  • git diff --check

stay.region == region && stay.through >= today ? stay : nil
}
let plannedEnd = matchingStay.map { min($0.through, lastDay) }
let plannedDays = plannedEnd.map { tomorrow.days(through: $0).count } ?? 0

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted by an AI agent on kve's behalf.

Review focus: this is the load-bearing forecast policy. Planned days begin tomorrow, include the selected through-date, and baseline projection resumes the following day. The tests cover the April threshold, matching and non-matching stays, and cross-year stays.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come this has the "I'll be here through" button button but others don't? IMO we should have it on all of them?

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