Skip to content

firmware: flip to idle on the daemon's {"ok": false} no-data beat#65

Open
nathanjohnpayne wants to merge 1 commit into
HermannBjorgvin:mainfrom
nathanjohnpayne:idle-no-data-beat
Open

firmware: flip to idle on the daemon's {"ok": false} no-data beat#65
nathanjohnpayne wants to merge 1 commit into
HermannBjorgvin:mainfrom
nathanjohnpayne:idle-no-data-beat

Conversation

@nathanjohnpayne

Copy link
Copy Markdown
Contributor

Follow-up to #64 (idle screen, merged): make the idle screen appear immediately when the daemon explicitly says it has no data, instead of waiting out the ~90s freshness window.

The daemon (see #63) sends {"ok": false} when it genuinely can't get usage data — token expired, refresh failed, no token. This handles that beat: ui_update treats ok:false as "no fresh data" — it keeps the last numbers (so they update cleanly when data resumes) but doesn't refresh the freshness timer, and the view-state gate adds data_ok so it resolves to the idle screen right away.

Harmless on its own — ok:true is the steady state and behaves exactly as before; useful the moment a daemon that emits the beat (#63) is paired.

Merge order: land this before #63, so deployed firmware understands the beat. (Firmware without this change would treat {"ok":false} as a usage payload and render 0%.)

Verified end-to-end on an AMOLED-2.16: daemon {"ok":false} → idle ("No data…") within a second.

🤖 Generated with Claude Code

The idle screen (merged in HermannBjorgvin#64) appears after the data-freshness timer lapses
(~90s). This lets it appear *immediately* when the daemon explicitly signals it
has no data via an {"ok": false} payload — token expired, refresh failed, no
token — instead of waiting out the window holding stale numbers.

ui_update treats ok:false as "no fresh data": it keeps the last numbers (so they
update cleanly when data resumes) but doesn't refresh the freshness timer, and
the view-state gate adds data_ok so it resolves to the idle screen.

Pairs with the daemon-side beat in HermannBjorgvin#63. Harmless without it (ok:true is the
steady state); useful the moment a daemon that sends the beat is paired.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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