mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 23:33:29 +00:00
feat(health-score): inline provenance accordion with source attribution
Adds a tap-to-expand 'Driven by' panel under the four component sub-bars inside <HealthScoreCard>. Each row pairs the existing value bar with a second weight-share bar tinted in the Coach provenance accent plus a source pill (manual / withings / appleHealth / mixed / none). Rows sort by effective weight descending so the biggest contributor leads; null components sink to the bottom and dim to 50 % opacity. A 'Provisional' header badge fires when fewer than half of the configured inputs carry data, and a role=status 'mixed sources' banner surfaces above the rows whenever at least one component blends multiple ingest paths. i18n keys land under insights.healthScore.provenance.* across all six locales (en / de / fr / es / it / pl with formal register). The locale-integrity drift-guard auto-discovers the new keys. 14 new RTL-style SSR tests pin the contract: aria-expanded toggle, aria-controls/id pairing, sort order, source-pill localisation, mixed banner gating, empty-state dimming, provisional threshold, asOf tooltip forwarding, and footnote rendering.
This commit is contained in:
1 parent
86737fd6a5
commit
b48d05a8be
9 files changed
+809
-23
No files matched your search
@@ -60,10 +60,33 @@ interface AnalyticsData {
|
||||
score: number;
|
||||
band: "green" | "yellow" | "red";
|
||||
components: {
|
||||
bp: { value: number | null; weight: number };
|
||||
weight: { value: number | null; weight: number };
|
||||
mood: { value: number | null; weight: number };
|
||||
compliance: { value: number | null; weight: number };
|
||||
// v1.4.25 W8e — the optional `source`/`asOf` slots feed the
|
||||
// provenance accordion. Older clients reading this payload
|
||||
// happily ignore the extras (additive contract).
|
||||
bp: {
|
||||
value: number | null;
|
||||
weight: number;
|
||||
source?: "manual" | "withings" | "appleHealth" | "mixed" | "none";
|
||||
asOf?: string;
|
||||
};
|
||||
weight: {
|
||||
value: number | null;
|
||||
weight: number;
|
||||
source?: "manual" | "withings" | "appleHealth" | "mixed" | "none";
|
||||
asOf?: string;
|
||||
};
|
||||
mood: {
|
||||
value: number | null;
|
||||
weight: number;
|
||||
source?: "manual" | "withings" | "appleHealth" | "mixed" | "none";
|
||||
asOf?: string;
|
||||
};
|
||||
compliance: {
|
||||
value: number | null;
|
||||
weight: number;
|
||||
source?: "manual" | "withings" | "appleHealth" | "mixed" | "none";
|
||||
asOf?: string;
|
||||
};
|
||||
};
|
||||
delta: number | null;
|
||||
} | null;
|
||||
|
||||
Reference in new issue
Block a user