Skip to content

Animate and haptically signal updated location counts - #192

Merged
kyleve merged 3 commits into
mainfrom
codex/location-day-count-haptics
Aug 5, 2026
Merged

Animate and haptically signal updated location counts#192
kyleve merged 3 commits into
mainfrom
codex/location-day-count-haptics

Conversation

@kyleve

@kyleve kyleve commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Posted by an AI agent on kve's behalf.

Summary

  • persist the primary Location-card counts last presented for each year
  • hold saved counts until the card surface is visible and unobscured, then animate to the current report
  • emit one light haptic when one or more visible counts increased; keep decreases, first visits, and newly appearing cards silent
  • clear presentation history on reset and cover the behavior with focused persistence and presentation-model tests

Design notes

The reconciliation task is attached to the card surface and keyed by its counts, year, and explicit visibility. Switching tabs, pushing a destination, or presenting the Resolve sheet leaves the saved baseline untouched; returning to unobscured cards reconciles against the latest report. Multiple increased cards intentionally produce one coordinated haptic event.

Testing

  • ./swiftformat --lint
  • ./test --all (1,629 tests passed before the focused review commits)
  • ./test WhereUITests (350 tests passed after review fixes)
  • ./test --snapshots (33 tests passed after review fixes; references unchanged)
  • git diff --check

// A task belongs to the card surface rather than the tab container: it
// is cancelled while another tab or a pushed destination covers these
// numbers, then re-runs when the user can see them again.
.task(id: report.ranking.primary) {

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.

Reviewer note: this task placement is the load-bearing visibility boundary. It must remain on the primary-card surface (not the surrounding NavigationStack or TabView) so hidden report updates do not consume the saved baseline before the numbers are visible again.

preferences.setLastSeenLocationDayCounts(currentCounts, in: year)
lastSeenCounts = currentCounts
}
if shouldProvideFeedback {

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.

Lets ensure this only happens for increases, not just changes.

// is cancelled while another tab or a pushed destination covers these
// numbers, then re-runs when the user can see them again.
.task(id: report.ranking.primary) {
dayCountPresentation.reveal(report.ranking.primary, in: report.selectedYear)

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.

Do we need to gate this on if we're visible as well?

@kyleve
kyleve enabled auto-merge (squash) August 5, 2026 21:17
@kyleve
kyleve merged commit 98e30de into main Aug 5, 2026
5 checks passed
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