feat(mental-health): rebuild the check-in page around four instrument cards

The landing slims to intro + instrument cards: the combined history card
leaves the main page entirely. Each card body now opens a per-instrument
detail sheet (the med-/Vorsorge card interaction) carrying the last
score + band, the score-over-time trend chart (restored from the
pre-v1.27.6 chart, lazy Recharts, bands surfacing discreetly in the
tooltip), the dated result history with the crisis re-surface, the Start
action, and the instrument's required attribution line — the Verlauf is
deliberately opt-in behind a click, never pushed onto the page someone
arrives at to take stock.

The wizard drives from the registry: option values in source order (the
WHO-5 leads with 5 = all of the time, the SCI with 4), shared vs
per-item anchor groups, and recall-stem captions above the WHO-5 / SCI
item fragments. WHO-5 items and anchors ship VERBATIM from the official
WHO publication in all six locales; the SCI is validated in English, so
every non-English locale presents the English items plus a localized
'validated in English' note (a self-made translation would invalidate
the instrument — the leak-guard allowlist documents this as intended).
Result view: direction-aware follow-up hints (WHO-5 <= 50 points gently
to the PHQ-9 check-in; SCI <= 16 carries the paper's neutral band
wording; PHQ-9 / GAD-7 keep their >= 10 hint). The intro states each
recall window honestly (two weeks vs past month). The Vorsorge screening
group offers all four instruments. Chrome localized in de/en/es/fr/it/pl.
This commit is contained in:
Marc-André Bombeck committed 2026-07-05 20:34:01 +02:00
1 parent 03d4496d3a
commit 8f1485fdcb
16 files changed
+1445 -268

No files matched your search

@@ -155,6 +155,39 @@ const LEGIT_IDENTICAL = new Set<string>([
"mentalHealth.items.phq9.7",
"mentalHealth.items.phq9.8",
"mentalHealth.items.phq9.9",
// v1.27.9 — the Sleep Condition Indicator is validated in English only
// (Espie 2014, CC BY-NC). Item text, section stems and response anchors
// ship VERBATIM in the source language in every locale — a self-made
// translation would invalidate the instrument — and the UI shows a
// localized "validated in English" note instead. Identical-to-EN is the
// intended state here, not a leak.
"mentalHealth.items.sci.1",
"mentalHealth.items.sci.2",
"mentalHealth.items.sci.3",
"mentalHealth.items.sci.4",
"mentalHealth.items.sci.5",
"mentalHealth.items.sci.6",
"mentalHealth.items.sci.7",
"mentalHealth.items.sci.8",
"mentalHealth.stems.sci.night",
"mentalHealth.stems.sci.impact",
"mentalHealth.stems.sci.finally",
"mentalHealth.sciOptions.duration.0",
"mentalHealth.sciOptions.quality.4",
"mentalHealth.sciOptions.quality.3",
"mentalHealth.sciOptions.quality.2",
"mentalHealth.sciOptions.quality.1",
"mentalHealth.sciOptions.quality.0",
"mentalHealth.sciOptions.impact.4",
"mentalHealth.sciOptions.impact.3",
"mentalHealth.sciOptions.impact.2",
"mentalHealth.sciOptions.impact.1",
"mentalHealth.sciOptions.impact.0",
"mentalHealth.sciOptions.problemDuration.4",
"mentalHealth.sciOptions.problemDuration.3",
"mentalHealth.sciOptions.problemDuration.2",
"mentalHealth.sciOptions.problemDuration.1",
"mentalHealth.sciOptions.problemDuration.0",
]);
describe("i18n English-leak guard", () => {