Repository navigation
fix(sleep): announce meaningful displayed result changes - #2544
Conversation
bf4de4c to
8f572f0
Compare
|
@fadkeprasad This is good work and I have no blocking objection. Checks below are things I ran or The oracle is the strongest part, and it pins more than it looks like it does. I walked all sixteen Localization is complete, and it actually takes effect. All nine Android No authority drift, which I verified rather than assumed. The reload guard deserves its own mention. Publishing blocks, learned timing and motion together Two notes, neither blockingThe shared oracle stops exactly where the platforms start differing. It covers #2108 asked for two things and this is one of them. The reporter wanted the persistent "calculating" The eight-second lifecycle still wants a device, as you say. I am not treating that as a gate for a |
|
Thanks Ryan for checking the oracle cases and reload guards directly, and for merging this. Agreed on both limits: the shared oracle proves the tracker’s comparison rules, not equivalence of Apple session values and Android grouped-night snapshot construction. Grouped/split-night snapshot coverage and the eight-second device lifecycle remain follow-up checks. The cancellation/refresh guard is also a robustness fix: it keeps a superseded reload from publishing mixed-generation screen state. And #2108 should stay open for its persistent calculating-message complaint; this change only supplies the transient notice when the displayed result changes. |
What this PR does
Replacement for the rejected #2530 approach, following the review's request to notify only when the displayed night actually changes. Refs #2108.
The comparison lives in the Sleep screen's presentation state on Apple and Android. It compares fully loaded results for the same displayed wake-day, active strap, and source set after scoring settles. Global computation alone cannot show the notice; the existing freshness priority remains unchanged.
A notice appears when onset, wake time, or total asleep changes by at least five minutes. Smaller shifts accumulate against the last announced baseline; stage redistribution without a meaningful total/boundary change stays quiet. Five minutes is a UX threshold, not an accuracy claim.
The notice says “Sleep result updated” and disappears after eight seconds. Opening the screen, navigating, changing strap/source/day, and manually edited nights establish a baseline without an announcement. State is view-local and does not retrospectively notify about changes made while the screen was closed.
The Apple reload publishes its blocks, learned timing, and motion together after cancellation checks. Android tracks which day/strap snapshot finished loading and checks cancellation before publishing it. Both platforms ignore intermediate scoring results.
Both strings are explicitly included in the Apple catalog (all ten locale entries) and Android resources (default plus eight translations).
Type of change
How it was tested
StrandTests/SleepResultChangeTests: passed.No real-device UI/sync session was performed for this presentation change. The eight-second notice lifecycle is implemented on both platforms; its visual timing still needs device review. No detector, BLE, persistence, or repair flags change.
Checklist
Related issues
Refs #2108. Supersedes the presentation approach in #2530; independent of the history-repair PR #2375.