mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-18 16:12:11 +00:00
fix(insights): surface Rest Mode on the web and align sleep assessments
Add a calm, value-free Rest Mode indicator to the dashboard score card and the recovery insight so the web matches what iOS already shows: when an illness/condition episode is active the score and recovery are framed, never penalised, and the surface now says so. The new banner is neutral and untinted, self-gates on an active episode, and reveals only the onset date — never a decrypted note or episode label. The dashboard reads the annotation from the snapshot (resolved server-side alongside the score); the recovery section reads it from the analytics payload. Give the sleep page one assessment per distinct chart group: the duration/architecture assessment now sits with its charts, and the sleep-quality block carries its own SLEEP_SCORE assessment, matching the "multiple charts, multiple texts" structure the recovery page meets. Add the steps explainer (insights.subPage.explainer.steps*) and pass explainerMetric="steps", and demote the recovery per-block title to an h3 so the heading outline nests cleanly under the page heading and group heading.
This commit is contained in:
1 parent
a3217ff767
commit
201686f498
18 files changed
+249
-21
No files matched your search
@@ -49,6 +49,7 @@ export const dynamic = "force-dynamic";
|
||||
const METRIC_MODULE: Partial<Record<MetricStatusMetricId, ModuleKey>> = {
|
||||
SLEEP_DURATION: "sleep",
|
||||
BREATHING_DISTURBANCES: "sleep",
|
||||
SLEEP_SCORE: "sleep",
|
||||
BLOOD_GLUCOSE: "glucose",
|
||||
CARDIO_RECOVERY: "recovery",
|
||||
// v1.18.1 — device-native recovery / strain signals gate on the
|
||||
|
||||
@@ -95,6 +95,26 @@ export default function InsightsSchlafPage() {
|
||||
>
|
||||
<SleepOverview />
|
||||
|
||||
{/*
|
||||
v1.8.7.1 — the duration/architecture assessment lands via the generic
|
||||
metric-status route (`?metric=SLEEP_DURATION`). The shared
|
||||
`<MetricStatusCard>` owns the hook + card; only the icon differs from
|
||||
the HealthKit scaffold (Moon vs Sparkles).
|
||||
|
||||
v1.18.1 — moved up to sit DIRECTLY with the duration/architecture chart
|
||||
group it describes (`<SleepOverview>`), rather than trailing the whole
|
||||
page. The sleep-quality block below now carries its OWN assessment, so
|
||||
each distinct chart group reads its own matching text — the canonical
|
||||
"multiple charts ⇒ multiple texts" rule the recovery page meets. The
|
||||
card mounts only on this data-bearing branch, so a source-less account
|
||||
never fetches.
|
||||
*/}
|
||||
<MetricStatusCard
|
||||
metric="SLEEP_DURATION"
|
||||
icon={<Moon className="h-5 w-5" />}
|
||||
enabled={!isEmpty}
|
||||
/>
|
||||
|
||||
{/*
|
||||
v1.17.0 — sleep-debt headline + chronotype card. Server-authoritative
|
||||
(the same DTO iOS renders), gated on the data-bearing branch so a
|
||||
@@ -108,25 +128,12 @@ export default function InsightsSchlafPage() {
|
||||
disturbance count + the Oura sleep score) that were ingested but never
|
||||
rendered. Each tile is data-gated, so the block is invisible for
|
||||
non-wearable users and collapses metric-by-metric. Server-authoritative
|
||||
— the tiles render stored values.
|
||||
— the tiles render stored values. v1.18.1 — the block carries its own
|
||||
`<MetricStatusCard metric="SLEEP_SCORE">` assessment internally.
|
||||
*/}
|
||||
<SleepQualitySection enabled={!isEmpty} />
|
||||
|
||||
<MetricTargetSummary slug="sleep" />
|
||||
|
||||
{/*
|
||||
v1.8.7.1 — the per-section sleep assessment lands via the generic
|
||||
metric-status route (`?metric=SLEEP_DURATION`), closing the slot
|
||||
the v1.4.28 deferral left open. The shared `<MetricStatusCard>`
|
||||
owns the hook + card; only the icon differs from the HealthKit
|
||||
scaffold (Moon vs Sparkles). The card mounts only on this
|
||||
data-bearing branch, so a source-less account never fetches.
|
||||
*/}
|
||||
<MetricStatusCard
|
||||
metric="SLEEP_DURATION"
|
||||
icon={<Moon className="h-5 w-5" />}
|
||||
enabled={!isEmpty}
|
||||
/>
|
||||
</SubPageShell>
|
||||
);
|
||||
}
|
||||
@@ -24,6 +24,7 @@ export default function InsightsStepsPage() {
|
||||
insightMetric="ACTIVITY_STEPS"
|
||||
chartKey="steps"
|
||||
i18nPrefix="insights.steps"
|
||||
explainerMetric="steps"
|
||||
statIcon={Footprints}
|
||||
color="#50fa7b"
|
||||
unit="steps"
|
||||
|
||||
Reference in new issue
Block a user