Skip to content

Today: stop reloading every second; keep the header height fixed during sync - #48

Merged
gabrielbr merged 1 commit into
mainfrom
ccr-67ccb970-dqwwqd
Oct 26, 2026
Merged

gabrielbr merged 1 commit into
mainfrom
ccr-67ccb970-dqwwqd

Conversation

@gabrielbr

Copy link
Copy Markdown
Owner

Fixes the flicker on Today. It had two causes.

  • Constant reloads. TodayViewModel's HR, SpO₂ (every 2 s), BP and glucose (every 5 s) polls stamped lastUpdated on every pass, even when the reading hadn't changed.
    • Today keys six loaders on that stamp: readiness, activity score, guidance, food, drinks and the step calibration. All of them re-ran about once a second while the screen sat still.
    • Their computation ran on the main thread.
    • The polls now stamp only when a reading changes. The loaders compute on Dispatchers.Default.
  • Header height changes during sync. The sync progress line under the header appeared and disappeared, changing the header's height. Every sync (each reconnect, about every 5 minutes on an R10, and every 30 minutes in the background) shifted the tab down and back up. Its 2 dp are now always reserved.

No design-file change: this is behaviour, not layout.

CI green on 5d84e5d. Not tried on a device.


Generated by Claude Code

…ng sync

Two causes of the flicker on Today:

- TodayViewModel's HR, SpO2, BP and glucose polls stamped lastUpdated on
  every pass, changed reading or not. Today keys readiness, activity
  score, guidance, food, drinks and the step calibration on it, so all
  six re-ran about once a second while the screen sat still, with their
  computation on the main thread. The polls now stamp only on a change,
  and the loaders compute on Dispatchers.Default.
- The sync progress line under the header appeared and disappeared,
  changing the header's height, so every sync shifted the tab down and
  back. Its 2dp are now always reserved.

Claude-Session: https://claude.ai/code/session_01P1t1aUqSUPd3whKXmgVm7w
@gabrielbr
gabrielbr merged commit 2170382 into main Oct 26, 2026
2 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.

2 participants