diff --git a/messages/de.json b/messages/de.json index 2e80dbaad..29e955a0f 100644 --- a/messages/de.json +++ b/messages/de.json @@ -676,7 +676,8 @@ "insightsCallout": { "lastMonth": "Vergleich zum Vormonat aktiv", "lastYear": "Vergleich zum Vorjahr aktiv" - } + }, + "notAvailableForCompliance": "Vergleich für Compliance nicht verfügbar" }, "insights": { "aiAnalysisTitle": "KI-Gesundheitsanalyse", diff --git a/messages/en.json b/messages/en.json index 8260c4018..1b9f647ff 100644 --- a/messages/en.json +++ b/messages/en.json @@ -676,7 +676,8 @@ "insightsCallout": { "lastMonth": "Tracking against last month", "lastYear": "Tracking against last year" - } + }, + "notAvailableForCompliance": "Comparison N/A for compliance" }, "insights": { "aiAnalysisTitle": "AI Health Analysis", diff --git a/src/app/page.tsx b/src/app/page.tsx index 247615aa6..ebde5fc6b 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -994,7 +994,12 @@ export default function DashboardPage() { charts.push({ id: "medications", order: widgetOrder("medications"), - node: , + node: ( + + ), }); } if (showAchievementsCard) { diff --git a/src/components/charts/medication-compliance-chart.tsx b/src/components/charts/medication-compliance-chart.tsx index 6e89e742f..0a307b642 100644 --- a/src/components/charts/medication-compliance-chart.tsx +++ b/src/components/charts/medication-compliance-chart.tsx @@ -152,10 +152,22 @@ export function computeMedicationTrend7d( interface MedicationComplianceChartProps { /** Override the visible label, primarily for tests. */ title?: string; + /** + * v1.4.16 phase D reconcile (H4 design) — when the user toggles the + * dashboard comparison overlay, every other chart paints a dimmed + * prior-period line. Compliance is a percentage-of-doses metric whose + * "prior month" overlay would need a second window of intake events + * (deferred to v1.4.17). We accept the prop so the parent doesn't + * have to special-case this chart, and surface a small caption when + * comparison is on so the user understands the asymmetry rather than + * thinking the toggle is broken. + */ + compareBaseline?: "none" | "lastMonth" | "lastYear"; } export function MedicationComplianceChart({ title, + compareBaseline = "none", }: MedicationComplianceChartProps) { const { isAuthenticated } = useAuth(); const { t } = useTranslations(); @@ -266,6 +278,22 @@ export function MedicationComplianceChart({ + {/* v1.4.16 phase D reconcile (H4 design) — explicit "comparison + N/A" caption when the global toggle is on. The compliance + heatmap doesn't render a prior-period overlay (deferred to + v1.4.17 when the underlying intake-event window comparison + ships). Without this caption the user toggles Vormonat and + this card just stays static, which reads as a bug. */} + {compareBaseline !== "none" && ( +

+ {t("comparison.notAvailableForCompliance")} +

+ )} + {/* v1.4.16 B1a — sibling SVG block for SSR-discoverable gradient. */}