From 9065092ba0d79fe430805a3b0117267cb6714d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 14 Jun 2026 17:48:18 +0200 Subject: [PATCH] fix(insights): drop unhonored day-count from glucose median label --- messages/de.json | 2 +- messages/en.json | 2 +- messages/es.json | 2 +- messages/fr.json | 2 +- messages/it.json | 2 +- messages/pl.json | 2 +- .../insights/__tests__/metric-stat-strip.test.tsx | 8 ++++---- src/components/insights/metric-stat-strip.tsx | 11 ++++++----- 8 files changed, 16 insertions(+), 15 deletions(-) diff --git a/messages/de.json b/messages/de.json index 13fc79099..cfea1b804 100644 --- a/messages/de.json +++ b/messages/de.json @@ -2791,7 +2791,7 @@ "title": "Blutzucker", "description": "Deine Blutzuckerwerte im Zeitverlauf, in mg/dL.", "chartTitle": "Blutzucker", - "medianLabel": "Median Blutzucker (90 Tage)", + "medianLabel": "Median Blutzucker", "emptyState": { "title": "Noch keine Glukosedaten", "description": "Blutzuckerwerte erscheinen hier, sobald du einen erfasst oder ein Gerät synchronisiert." diff --git a/messages/en.json b/messages/en.json index a7cf788fe..0e147aab4 100644 --- a/messages/en.json +++ b/messages/en.json @@ -2791,7 +2791,7 @@ "title": "Blood Glucose", "description": "Your blood-glucose readings over time, in mg/dL.", "chartTitle": "Blood glucose", - "medianLabel": "Median glucose (90 days)", + "medianLabel": "Median glucose", "emptyState": { "title": "No glucose data yet", "description": "Blood-glucose readings appear here once you log one or a connected device syncs." diff --git a/messages/es.json b/messages/es.json index fd11a818a..ee2ea77c3 100644 --- a/messages/es.json +++ b/messages/es.json @@ -2791,7 +2791,7 @@ "title": "Glucosa en sangre", "description": "Tus lecturas de glucosa en el tiempo, en mg/dL.", "chartTitle": "Glucosa en sangre", - "medianLabel": "Glucosa mediana (90 días)", + "medianLabel": "Glucosa mediana", "emptyState": { "title": "Aún no hay datos de glucosa", "description": "Las lecturas de glucosa aparecen aquí cuando registras una o un dispositivo sincroniza." diff --git a/messages/fr.json b/messages/fr.json index d9dd8830c..54b3b084b 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -2791,7 +2791,7 @@ "title": "Glycémie", "description": "Vos relevés de glycémie au fil du temps, en mg/dL.", "chartTitle": "Glycémie", - "medianLabel": "Glycémie médiane (90 jours)", + "medianLabel": "Glycémie médiane", "emptyState": { "title": "Aucune donnée de glycémie", "description": "Les relevés de glycémie apparaissent ici dès que vous en saisissez un ou qu’un appareil se synchronise." diff --git a/messages/it.json b/messages/it.json index 5e6627dc8..04730edac 100644 --- a/messages/it.json +++ b/messages/it.json @@ -2791,7 +2791,7 @@ "title": "Glicemia", "description": "Le tue letture di glicemia nel tempo, in mg/dL.", "chartTitle": "Glicemia", - "medianLabel": "Glicemia mediana (90 giorni)", + "medianLabel": "Glicemia mediana", "emptyState": { "title": "Nessun dato di glicemia", "description": "Le letture di glicemia appaiono qui quando ne registri una o un dispositivo si sincronizza." diff --git a/messages/pl.json b/messages/pl.json index 69d441ba8..e3915160a 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -2791,7 +2791,7 @@ "title": "Poziom glukozy", "description": "Twoje odczyty glukozy w czasie, w mg/dL.", "chartTitle": "Poziom glukozy", - "medianLabel": "Mediana glukozy (90 dni)", + "medianLabel": "Mediana glukozy", "emptyState": { "title": "Brak danych o glukozie", "description": "Odczyty glukozy pojawią się tutaj po zapisaniu jednego lub synchronizacji urządzenia." diff --git a/src/components/insights/__tests__/metric-stat-strip.test.tsx b/src/components/insights/__tests__/metric-stat-strip.test.tsx index 1296f810c..c85632ecc 100644 --- a/src/components/insights/__tests__/metric-stat-strip.test.tsx +++ b/src/components/insights/__tests__/metric-stat-strip.test.tsx @@ -75,17 +75,17 @@ describe("", () => { expect(html).toContain("Median"); }); - // v1.16.16 — glucose declares the trailing-90-day p50 window in the label - // so the median is not read as an all-time central value. + // v1.16.16 — the median cell follows the chart's active range, so the label + // names the metric without asserting a fixed window it can't honor. it("renders an overridden median label when medianLabel is provided", () => { const html = render( , ); - expect(html).toContain("Median glucose (90 days)"); + expect(html).toContain("Median glucose"); }); it("honours fractionDigits for integer-unit metrics (0 decimals)", () => { diff --git a/src/components/insights/metric-stat-strip.tsx b/src/components/insights/metric-stat-strip.tsx index 86000301b..2ad72e687 100644 --- a/src/components/insights/metric-stat-strip.tsx +++ b/src/components/insights/metric-stat-strip.tsx @@ -93,11 +93,12 @@ export interface MetricStatSeries { */ dataKey?: string; /** - * v1.16.16 — optional override for the "Median" cell label. The strip's - * median is a trailing-90-day p50 (see `DataSummary.median` / - * `summaries-slice.ts`); the default generic "Median" label leaves that - * window undeclared. Blood glucose passes a window- + context-declaring - * string (e.g. "Median glucose (90 days)") so the number is not read as an + * v1.16.16 — optional override for the "Median" cell label. The median + * cell follows the chart's ACTIVE range (`windowStats`) when a range is + * selected and only falls back to the full-range `summary` p50 otherwise, + * so the label must NOT assert a fixed day-count it can't honor. Blood + * glucose passes a metric-naming string (e.g. "Median glucose") so the + * number reads as that metric's median for the visible range, not an * all-time central value. Omit it to keep the generic label. */ medianLabel?: string;