Add annual location time forecasts - #187
Open
kyleve wants to merge 22 commits into
Open
Conversation
kyleve
commented
Aug 5, 2026
| 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 |
Owner
Author
There was a problem hiding this comment.
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.
kyleve
commented
Aug 5, 2026
Owner
Author
There was a problem hiding this comment.
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?
kyleve
commented
Aug 6, 2026
|
|
||
| public func replacePlannedStayRecord(with record: PlannedStayRecord) async throws { | ||
| let context = mutationContext() | ||
| for existing in try context.fetch(FetchDescriptor<SDPlannedStay>()) { |
Owner
Author
There was a problem hiding this comment.
wait, we're fetching them all and deleting them all, for one record?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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 --lintruby -c Where/Tools/upgrade-backup.rbgit diff --check