mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
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.
This commit is contained in:
1 parent
955ef6c6b6
commit
e344ebb781
10 files changed
+23
-92
No files matched your search
@@ -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"
|
||||
>
|
||||
<div className="min-w-0 space-y-0.5">
|
||||
<Label htmlFor={inputId} className="text-sm font-medium">
|
||||
|
||||
@@ -72,7 +72,6 @@ import {
|
||||
import { useTranslations } from "@/lib/i18n/context";
|
||||
import { queryKeys } from "@/lib/query-keys";
|
||||
import { useAnalyticsQuery } from "@/lib/queries/use-analytics-query";
|
||||
import { SCORE_DOMAIN_LABEL_KEYS } from "@/lib/score-config/labels";
|
||||
import {
|
||||
buildScoreConfigRows,
|
||||
type ScorePillarVerdict,
|
||||
@@ -387,38 +386,22 @@ export function ScoreSection() {
|
||||
<Skeleton className="h-11 w-full" />
|
||||
</div>
|
||||
) : (
|
||||
<div className="space-y-6">
|
||||
{groups.map((group) => (
|
||||
<div
|
||||
key={group.domain}
|
||||
data-slot="score-config-group"
|
||||
data-domain={group.domain}
|
||||
className="space-y-2"
|
||||
>
|
||||
{/* 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. */}
|
||||
<h3
|
||||
data-slot="score-config-group-heading"
|
||||
className="text-foreground text-xs font-medium tracking-wide uppercase"
|
||||
>
|
||||
{t(SCORE_DOMAIN_LABEL_KEYS[group.domain])}
|
||||
</h3>
|
||||
{/* No rules between the rows: the gap between groups
|
||||
is the grouping. */}
|
||||
<div className="space-y-3">
|
||||
{group.rows.map((row) => (
|
||||
<ScorePillarRow
|
||||
key={row.id}
|
||||
row={row}
|
||||
pending={busy}
|
||||
onToggle={(next) => toggle(row.id, next)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
// 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.
|
||||
<div className="divide-border divide-y">
|
||||
{groups.flatMap((group) =>
|
||||
group.rows.map((row) => (
|
||||
<ScorePillarRow
|
||||
key={row.id}
|
||||
row={row}
|
||||
pending={busy}
|
||||
onToggle={(next) => toggle(row.id, next)}
|
||||
/>
|
||||
)),
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
@@ -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<ScorePillarId, string> = {
|
||||
BLOOD_PRESSURE: "insights.healthScore.pillar.bloodPressure",
|
||||
@@ -17,12 +17,3 @@ export const SCORE_PILLAR_LABEL_KEYS: Record<ScorePillarId, string> = {
|
||||
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<ScoreDomain, string> = {
|
||||
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",
|
||||
};
|
||||
Reference in new issue
Block a user