From e344ebb78126fc6ba729b9cfbef287c71403b276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 8 Aug 2026 20:56:50 +0200 Subject: [PATCH] fix(settings): drop the score pillar group headings for a flat list The score-composition settings grouped its topics under domain headings (Heart and metabolism, Activity, Sleep, Body shape, Wellbeing). Remove them and list the individual topics one under another with hairline dividers, the way the health profile lists its facts. Each row keeps its domain data attribute, so the flattening preserves the registry order and tests still address a pillar by its domain. The now-orphaned domain-label map and its six-locale strings go with it. --- e2e/settings-score.spec.ts | 11 ++--- messages/de.json | 7 --- messages/en.json | 7 --- messages/es.json | 7 --- messages/fr.json | 7 --- messages/it.json | 7 --- messages/pl.json | 7 --- src/components/settings/score-pillar-row.tsx | 2 +- src/components/settings/score-section.tsx | 49 +++++++------------- src/lib/score-config/labels.ts | 11 +---- 10 files changed, 23 insertions(+), 92 deletions(-) diff --git a/e2e/settings-score.spec.ts b/e2e/settings-score.spec.ts index 399bd9f2e..f8e57e90a 100644 --- a/e2e/settings-score.spec.ts +++ b/e2e/settings-score.spec.ts @@ -130,14 +130,13 @@ test.describe("Settings → Health Score", () => { 1, ); - // The cardiometabolic triple, visibly under one heading. + // The cardiometabolic triple. The list is flat (no group headings) — the + // rows carry their domain, so the three cardiometabolic pillars are found + // on the row itself. const cardio = page.locator( - '[data-slot="score-config-group"][data-domain="cardiometabolic"]', - ); - await expect(cardio).toHaveCount(1); - await expect(cardio.locator('[data-slot="score-pillar-row"]')).toHaveCount( - 3, + '[data-slot="score-pillar-row"][data-domain="cardiometabolic"]', ); + await expect(cardio).toHaveCount(3); // The rows say nothing about recording or showing — the card says it // once, above them, and the modules screen owns those two questions. diff --git a/messages/de.json b/messages/de.json index 22e52f6b7..55b078172 100644 --- a/messages/de.json +++ b/messages/de.json @@ -5207,13 +5207,6 @@ "axis": { "countsFor": "{pillar} in den Score einrechnen" }, - "domain": { - "cardiometabolic": "Herz und Stoffwechsel", - "activity": "Aktivität", - "sleep": "Schlaf", - "adiposity": "Körperform", - "wellbeing": "Wohlbefinden" - }, "state": { "counting": "Zählt in deinen Score", "waiting": "Ausgewählt, wartet auf Daten", diff --git a/messages/en.json b/messages/en.json index 8998e4fad..dd0ba4ac5 100644 --- a/messages/en.json +++ b/messages/en.json @@ -5207,13 +5207,6 @@ "axis": { "countsFor": "Count {pillar} toward the score" }, - "domain": { - "cardiometabolic": "Heart and metabolism", - "activity": "Activity", - "sleep": "Sleep", - "adiposity": "Body shape", - "wellbeing": "Wellbeing" - }, "state": { "counting": "Counting toward your score", "waiting": "Selected, waiting for data", diff --git a/messages/es.json b/messages/es.json index f8b57316b..a0e7aae78 100644 --- a/messages/es.json +++ b/messages/es.json @@ -5207,13 +5207,6 @@ "axis": { "countsFor": "Contar {pillar} para la puntuación" }, - "domain": { - "cardiometabolic": "Corazón y metabolismo", - "activity": "Actividad", - "sleep": "Sueño", - "adiposity": "Forma corporal", - "wellbeing": "Bienestar" - }, "state": { "counting": "Cuenta para tu puntuación", "waiting": "Seleccionado, esperando datos", diff --git a/messages/fr.json b/messages/fr.json index 7daddbd8f..8ec4f749c 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -5207,13 +5207,6 @@ "axis": { "countsFor": "Compter {pillar} dans le score" }, - "domain": { - "cardiometabolic": "Cœur et métabolisme", - "activity": "Activité", - "sleep": "Sommeil", - "adiposity": "Silhouette", - "wellbeing": "Bien-être" - }, "state": { "counting": "Compte dans votre score", "waiting": "Sélectionné, en attente de données", diff --git a/messages/it.json b/messages/it.json index 471e33147..152f252b4 100644 --- a/messages/it.json +++ b/messages/it.json @@ -5207,13 +5207,6 @@ "axis": { "countsFor": "Conta {pillar} nel punteggio" }, - "domain": { - "cardiometabolic": "Cuore e metabolismo", - "activity": "Attività", - "sleep": "Sonno", - "adiposity": "Forma corporea", - "wellbeing": "Benessere" - }, "state": { "counting": "Conta nel tuo punteggio", "waiting": "Selezionato, in attesa di dati", diff --git a/messages/pl.json b/messages/pl.json index b4245f672..592b485bd 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -5207,13 +5207,6 @@ "axis": { "countsFor": "Licz {pillar} do wyniku" }, - "domain": { - "cardiometabolic": "Serce i metabolizm", - "activity": "Aktywność", - "sleep": "Sen", - "adiposity": "Sylwetka", - "wellbeing": "Samopoczucie" - }, "state": { "counting": "Liczy się do Twojego wyniku", "waiting": "Wybrany, czeka na dane", diff --git a/src/components/settings/score-pillar-row.tsx b/src/components/settings/score-pillar-row.tsx index 99853a15c..8e8f8dfaf 100644 --- a/src/components/settings/score-pillar-row.tsx +++ b/src/components/settings/score-pillar-row.tsx @@ -60,7 +60,7 @@ export function ScorePillarRow({ data-domain={row.domain} data-counts={row.counts ? "true" : "false"} data-eligibility={row.eligibility} - className="flex min-h-11 items-center justify-between gap-4" + className="flex min-h-11 items-center justify-between gap-4 py-3" >
) : ( -
- {groups.map((group) => ( -
- {/* Names an area of health, so it sits in the content - tier. The muted section-label treatment it shipped - with read as switched-off beside the rows it - heads. */} -

- {t(SCORE_DOMAIN_LABEL_KEYS[group.domain])} -

- {/* No rules between the rows: the gap between groups - is the grouping. */} -
- {group.rows.map((row) => ( - toggle(row.id, next)} - /> - ))} -
-
- ))} + // One flat list of topics separated by hairline dividers, the + // way Anamnese lists its facts. The group headings are gone; the + // registry order (domain, then pillar) is preserved by flattening + // the groups in order, and each row keeps its `data-domain` for + // tests and e2e. +
+ {groups.flatMap((group) => + group.rows.map((row) => ( + toggle(row.id, next)} + /> + )), + )}
)} diff --git a/src/lib/score-config/labels.ts b/src/lib/score-config/labels.ts index 2cf25b8b8..4e89e7407 100644 --- a/src/lib/score-config/labels.ts +++ b/src/lib/score-config/labels.ts @@ -6,7 +6,7 @@ * surface renames a pillar, and the two surfaces would then be talking * about different things while showing the same list. */ -import type { ScoreDomain, ScorePillarId } from "@/lib/analytics/score/types"; +import type { ScorePillarId } from "@/lib/analytics/score/types"; export const SCORE_PILLAR_LABEL_KEYS: Record = { BLOOD_PRESSURE: "insights.healthScore.pillar.bloodPressure", @@ -17,12 +17,3 @@ export const SCORE_PILLAR_LABEL_KEYS: Record = { WELLBEING: "insights.healthScore.pillar.wellbeing", LIPIDS: "insights.healthScore.pillar.lipids", }; - -/** Domain headings, one per distinct area of health. */ -export const SCORE_DOMAIN_LABEL_KEYS: Record = { - cardiometabolic: "settings.sections.score.domain.cardiometabolic", - activity: "settings.sections.score.domain.activity", - sleep: "settings.sections.score.domain.sleep", - adiposity: "settings.sections.score.domain.adiposity", - wellbeing: "settings.sections.score.domain.wellbeing", -};