mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
Surface the day's read at the top of the dashboard: a Today hero that renders the daily digest — the health score with an honest provisional/final and sleep-pending face, the briefing lead with a read-the-full-briefing affordance, and the worth-a-look rail of priority cards. The dense tile grid and chart rows stay exactly where they are, one scroll below, so muscle memory survives and no new nav destination is added. The hero reads one cached digest cell (GET /api/daily/digest) through the centralised query-key factory and unwraps the envelope; it recomputes nothing and never warms a provider on mount. It is gated on the insights module and self-gates its empty state: a genuinely empty account renders nothing rather than an alarming card, while an account with a score but nothing notable gets a calm all-clear line in the rail's place. A shimmer skeleton holds the footprint while the digest loads. Priority-card actions wire to their existing destinations by construction (log dose, reconnect a sync, view check-ups). New copy lands in all six locales.
15 lines
626 B
TypeScript
15 lines
626 B
TypeScript
/**
|
|
* Query keys — the unified daily-value system (S2 Today surface).
|
|
* Part of the centralized factory; aggregated in `./index.ts`.
|
|
*
|
|
* The Today hero reads ONE cell against `GET /api/daily/digest` (the
|
|
* `DailyDigest` DTO S1 shipped). A single flat key: the digest is a
|
|
* per-user daily read with no discriminator, so `["daily","digest"]`
|
|
* is the whole surface. Kept in the factory so a future daily-data
|
|
* mutation can invalidate it by prefix without a bare-array literal
|
|
* (the `healthlog/queryKey-factory` rule bans those).
|
|
*/
|
|
export const dailyKeys = {
|
|
dailyDigest: () => ["daily", "digest"] as const,
|
|
};
|