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.
This commit is contained in:
Marc-André Bombeck committed 2026-07-31 18:06:09 +02:00
1 parent c29055be1c
commit 0276ca9121
8 files changed
+60

No files matched your search

+1
View File
@@ -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": {
+1
View File
@@ -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": {
+1
View File
@@ -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": {
+1
View File
@@ -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": {
+1
View File
@@ -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": {
+1
View File
@@ -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": {
@@ -675,6 +675,44 @@ describe("<HealthScoreCard> 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(
<HealthScoreCard
report={scoredReport({
composite: {
...(scoredReport().composite as Extract<
HealthScoreReport["composite"],
{ status: "ok" }
>),
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(<HealthScoreCard report={scoredReport()} />);
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(
<HealthScoreCard
@@ -594,6 +594,22 @@ export function HealthScoreCard({
noise: composite.value.noiseFloor,
})}
</p>
{/*
* 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 ? (
<p
data-slot="health-score-configured"
className="text-muted-foreground text-xs"
>
{t("insights.healthScore.configured")}
</p>
) : null}
</>
) : (
<p className="text-muted-foreground text-xs">