Files
HealthLog/src/lib/query-keys/daily.ts
T
Marc-André Bombeck 168c1c85d7 feat(dashboard): promote a Today hero above the tile strip
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.
2026-07-16 19:31:13 +02:00

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,
};