From 74244efbe13c267c19abddf8df8073bb92b20d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Tue, 20 Oct 2026 15:07:51 +0200 Subject: [PATCH] fix(targets): label the systolic bar on the blood-pressure target card The card stacks two range bars for blood pressure. The diastolic bar carried its label; the systolic one had none and no key to render, so the pair read as one unnamed bar above a "Diastolic" one. Both bars now name their reading (new key targets.systolic in every locale). --- messages/de.json | 1 + messages/en.json | 1 + messages/es.json | 1 + messages/fr.json | 1 + messages/it.json | 1 + messages/ko.json | 1 + messages/nl.json | 1 + messages/pl.json | 1 + .../__tests__/metric-target-summary.test.tsx | 11 ++++++++ .../insights/metric-target-summary.tsx | 27 ++++++++++++------- 10 files changed, 37 insertions(+), 9 deletions(-) diff --git a/messages/de.json b/messages/de.json index bc7ac86ec..3aff7d309 100644 --- a/messages/de.json +++ b/messages/de.json @@ -8901,6 +8901,7 @@ "inTarget": "Im Zielbereich", "aboveTarget": "{delta} {unit} über Zielbereich", "belowTarget": "{delta} {unit} unter Zielbereich", + "systolic": "Systolisch", "diastolic": "Diastolisch", "glucoseFasting": "Glukose, nüchtern", "glucosePostprandial": "Glukose, postprandial", diff --git a/messages/en.json b/messages/en.json index 780787051..b58302e22 100644 --- a/messages/en.json +++ b/messages/en.json @@ -8901,6 +8901,7 @@ "inTarget": "Within target range", "aboveTarget": "{delta} {unit} above target", "belowTarget": "{delta} {unit} below target", + "systolic": "Systolic", "diastolic": "Diastolic", "glucoseFasting": "Glucose (fasting)", "glucosePostprandial": "Glucose (post-meal)", diff --git a/messages/es.json b/messages/es.json index 8782a47a7..a682b92ab 100644 --- a/messages/es.json +++ b/messages/es.json @@ -8901,6 +8901,7 @@ "inTarget": "En rango objetivo", "aboveTarget": "{delta} {unit} por encima del rango", "belowTarget": "{delta} {unit} por debajo del rango", + "systolic": "Sistólica", "diastolic": "Diastólica", "glucoseFasting": "Glucemia (en ayunas)", "glucosePostprandial": "Glucemia (posprandial)", diff --git a/messages/fr.json b/messages/fr.json index f2db6c1a6..e0fd482d5 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -8901,6 +8901,7 @@ "inTarget": "Dans la plage cible", "aboveTarget": "{delta} {unit} au-dessus de la plage", "belowTarget": "{delta} {unit} en dessous de la plage", + "systolic": "Systolique", "diastolic": "Diastolique", "glucoseFasting": "Glycémie (à jeun)", "glucosePostprandial": "Glycémie (postprandiale)", diff --git a/messages/it.json b/messages/it.json index ea19c378e..19db4220d 100644 --- a/messages/it.json +++ b/messages/it.json @@ -8901,6 +8901,7 @@ "inTarget": "Nel range obiettivo", "aboveTarget": "{delta} {unit} sopra il range", "belowTarget": "{delta} {unit} sotto il range", + "systolic": "Sistolica", "diastolic": "Diastolica", "glucoseFasting": "Glicemia (a digiuno)", "glucosePostprandial": "Glicemia (postprandiale)", diff --git a/messages/ko.json b/messages/ko.json index 3a753a8f9..fb03673be 100644 --- a/messages/ko.json +++ b/messages/ko.json @@ -8901,6 +8901,7 @@ "inTarget": "목표 범위 안", "aboveTarget": "목표보다 {delta} {unit} 높음", "belowTarget": "목표보다 {delta} {unit} 낮음", + "systolic": "수축기", "diastolic": "이완기", "glucoseFasting": "혈당 (공복)", "glucosePostprandial": "혈당 (식후)", diff --git a/messages/nl.json b/messages/nl.json index 3b80f1854..b70878026 100644 --- a/messages/nl.json +++ b/messages/nl.json @@ -8901,6 +8901,7 @@ "inTarget": "Binnen het streefbereik", "aboveTarget": "{delta} {unit} boven het doel", "belowTarget": "{delta} {unit} onder het doel", + "systolic": "Systolisch", "diastolic": "Diastolisch", "glucoseFasting": "Glucose (nuchter)", "glucosePostprandial": "Glucose (na de maaltijd)", diff --git a/messages/pl.json b/messages/pl.json index 78b02dc65..7c0d439f1 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -8901,6 +8901,7 @@ "inTarget": "W zakresie docelowym", "aboveTarget": "{delta} {unit} powyżej zakresu", "belowTarget": "{delta} {unit} poniżej zakresu", + "systolic": "Skurczowe", "diastolic": "Rozkurczowe", "glucoseFasting": "Glikemia: na czczo", "glucosePostprandial": "Glikemia: po posiłku", diff --git a/src/components/insights/__tests__/metric-target-summary.test.tsx b/src/components/insights/__tests__/metric-target-summary.test.tsx index 2491772cf..61651bf8a 100644 --- a/src/components/insights/__tests__/metric-target-summary.test.tsx +++ b/src/components/insights/__tests__/metric-target-summary.test.tsx @@ -214,10 +214,21 @@ describe("", () => { // The diastolic range bar renders alongside the systolic one. const barCount = (html.match(/data-slot="target-range-bar"/g) ?? []).length; expect(barCount).toBe(2); + // Each stacked bar names its reading, the systolic one first. The + // systolic label was missing while the diastolic one rendered. + const sys = html.indexOf(">Systolic

"); + const dia = html.indexOf(">Diastolic

"); + expect(sys).toBeGreaterThan(-1); + expect(dia).toBeGreaterThan(sys); // 30-day average stitches the diastolic pair — kept on the BP panel. expect(html).toContain("30-day average: 122/76 mmHg"); }); + it("labels a single-band bar with nothing extra", () => { + const html = renderWith("weight", WEIGHT_DATA); + expect(html).not.toContain(">Systolic

"); + }); + it("keeps the adjust-target affordance out of the card body", () => { // The "Adjust target range" affordance moved to the page-header gear // (`` via `TargetAdjustProvider`); the card is now diff --git a/src/components/insights/metric-target-summary.tsx b/src/components/insights/metric-target-summary.tsx index 872632957..b2e5c9484 100644 --- a/src/components/insights/metric-target-summary.tsx +++ b/src/components/insights/metric-target-summary.tsx @@ -367,16 +367,25 @@ function TargetReferencePanel({ ) : null} - {/* Row 2: range bar — where today's value sits inside the band. */} + {/* Row 2: range bar — where today's value sits inside the band. + Blood pressure stacks two bars, so each one names its reading; + an unlabelled first bar read as the diastolic one's sibling. */} {currentValue != null ? ( - +
+ {isBp ? ( +

+ {t("targets.systolic")} +

+ ) : null} + +
) : null} {/* Row 2b: diastolic range bar for blood pressure. */}