From 0276ca91216752c006ba7c26abd51148b0ad65ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Fri, 31 Jul 2026 18:06:09 +0200 Subject: [PATCH] State an authored composition in the score's method footer One line under the method version, shown only when the server says the composition is the person's own. It states the fact and stops there: which pillars they took out belongs to the settings surface, and working it out here from a configuration blob would put a second decider behind one sentence. --- messages/de.json | 1 + messages/en.json | 1 + messages/es.json | 1 + messages/fr.json | 1 + messages/it.json | 1 + messages/pl.json | 1 + .../__tests__/health-score-card.test.tsx | 38 +++++++++++++++++++ src/components/insights/health-score-card.tsx | 16 ++++++++ 8 files changed, 60 insertions(+) diff --git a/messages/de.json b/messages/de.json index 71774346c..8cd49fd84 100644 --- a/messages/de.json +++ b/messages/de.json @@ -2275,6 +2275,7 @@ "bandSetter": "Gesamtstufe bestimmt durch {pillar}", "versionAndNoise": "Methodenversion {version}. Schwelle für den Wochenvergleich: {noise} Punkte.", "methodVersion": "Methodenversion {version}.", + "configured": "Du hast festgelegt, welche Bereiche in diesen Score einfließen.", "none": "keiner", "delta": "{delta} gegenüber dem vorherigen vergleichbaren Zeitraum", "deltaReason": { diff --git a/messages/en.json b/messages/en.json index c8f7ba43e..671707c0e 100644 --- a/messages/en.json +++ b/messages/en.json @@ -2275,6 +2275,7 @@ "bandSetter": "Overall band set by {pillar}", "versionAndNoise": "Method version {version}. Weekly comparison floor: {noise} points.", "methodVersion": "Method version {version}.", + "configured": "You chose which pillars count toward this score.", "none": "none", "delta": "{delta} vs the previous comparable window", "deltaReason": { diff --git a/messages/es.json b/messages/es.json index dd6ae9b36..2cf66b4a7 100644 --- a/messages/es.json +++ b/messages/es.json @@ -2275,6 +2275,7 @@ "bandSetter": "Categoría general determinada por {pillar}", "versionAndNoise": "Versión del método {version}. Umbral de comparación semanal: {noise} puntos.", "methodVersion": "Versión del método {version}.", + "configured": "Tú has elegido qué pilares cuentan para esta puntuación.", "none": "ninguno", "delta": "{delta} frente al periodo comparable anterior", "deltaReason": { diff --git a/messages/fr.json b/messages/fr.json index 446b1a1af..045397178 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -2275,6 +2275,7 @@ "bandSetter": "Catégorie globale fixée par {pillar}", "versionAndNoise": "Version de la méthode {version}. Seuil de comparaison hebdomadaire : {noise} points.", "methodVersion": "Version de la méthode {version}.", + "configured": "Vous avez choisi les piliers qui comptent pour ce score.", "none": "aucun", "delta": "{delta} par rapport à la période comparable précédente", "deltaReason": { diff --git a/messages/it.json b/messages/it.json index b176dfa11..9cf858017 100644 --- a/messages/it.json +++ b/messages/it.json @@ -2275,6 +2275,7 @@ "bandSetter": "Fascia complessiva determinata da {pillar}", "versionAndNoise": "Versione del metodo {version}. Soglia del confronto settimanale: {noise} punti.", "methodVersion": "Versione del metodo {version}.", + "configured": "Hai scelto quali pilastri contano per questo punteggio.", "none": "nessuno", "delta": "{delta} rispetto al periodo precedente confrontabile", "deltaReason": { diff --git a/messages/pl.json b/messages/pl.json index 4b60aa32d..373259b63 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -2275,6 +2275,7 @@ "bandSetter": "Ogólny zakres wyznacza {pillar}", "versionAndNoise": "Wersja metody {version}. Próg porównania tygodniowego: {noise} pkt.", "methodVersion": "Wersja metody {version}.", + "configured": "Wybrane przez Ciebie filary decydują o tym wyniku.", "none": "brak", "delta": "{delta} względem poprzedniego porównywalnego okresu", "deltaReason": { diff --git a/src/components/insights/__tests__/health-score-card.test.tsx b/src/components/insights/__tests__/health-score-card.test.tsx index 9938c6ca1..34a181398 100644 --- a/src/components/insights/__tests__/health-score-card.test.tsx +++ b/src/components/insights/__tests__/health-score-card.test.tsx @@ -675,6 +675,44 @@ describe(" footer", () => { expect(region).toContain("equal-weighted average"); }); + it("states an authored composition in the method footer, and only when the server says so", () => { + // The footer reads the resolved flag off the composite and says one + // sentence. It never names the pillars the person took out — that is + // the settings surface's job — and it never appears for an account + // whose composition is the default one. + const configured = render( + ), + value: { + ...( + scoredReport().composite as Extract< + HealthScoreReport["composite"], + { status: "ok" } + > + ).value, + configured: true, + }, + }, + })} + />, + ); + expect(anatomyRegion(configured)).toContain( + 'data-slot="health-score-configured"', + ); + expect(anatomyRegion(configured)).toContain( + "You chose which pillars count toward this score.", + ); + + const inherited = render(); + expect(inherited).not.toContain('data-slot="health-score-configured"'); + expect(inherited).not.toContain("You chose which pillars count"); + }); + it("shows the personal weight goal as explicitly unscored context", () => { const html = render( + {/* + * The server resolved whether this composition is the + * person's own; the footer states it and nothing more. + * Which pillars they took out is the settings surface's + * to show, not this one's, and re-deriving the answer + * from a configuration blob here would put a second + * decider behind one sentence. + */} + {composite.value.configured ? ( +

+ {t("insights.healthScore.configured")} +

+ ) : null} ) : (