feat(mental-health): make the wellbeing check-in a standalone module page

Move the PHQ-9 / GAD-7 screener off `/insights/mental-wellbeing` to a
top-level `/mental-wellbeing` route so it no longer borrows the Insights
tab strip and layout shell. The page now uses the standard module-page
frame at the wider content width the other module pages use.

Replace the standing screening disclaimer block and the opt-in/private
line in the header with an info icon after the page heading whose
hover/focus tooltip carries the screening-not-a-diagnosis note. Drop the
now-orphaned `disclaimer` / `optInNote` strings across all six locales
and add the `infoTooltip` string in their place.

The questionnaire, scoring, severity result, PHQ-9 item-9 crisis-resource
handling, focus-on-submit, and 44px touch targets are unchanged. Repoint
the module nav entry and the registry comments at the new route.
This commit is contained in:
Marc-André Bombeck committed 2026-06-28 20:48:39 +02:00
1 parent 651b02bc1b
commit 37c977e3a4
10 files changed
+21 -28

No files matched your search

+1 -2
View File
@@ -7558,8 +7558,7 @@
"mentalHealth": {
"pageTitle": "Check-in zum seelischen Wohlbefinden",
"pageDescription": "Zwei validierte, freiwillige Selbsttests — PHQ-9 (Stimmung) und GAD-7 (Sorgen) — ergänzend zu deinem Stimmungstagebuch. Aussagekräftig ist der Verlauf über die Zeit, nicht ein einzelner Wert.",
"disclaimer": "Dies ist ein Screening-Selbsttest, keine Diagnose. Ein hoher oder niedriger Wert bedeutet nicht, dass eine Erkrankung vorliegt oder nicht. Nur eine qualifizierte Fachperson kann eine Diagnose stellen. Bei Sorgen sprich bitte mit deiner Ärztin oder deinem Arzt.",
"optInNote": "Freiwillig und privat: Deine einzelnen Antworten sind verschlüsselt, bleiben aus dem KI-Coach und aus Exporten heraus und werden nie geteilt.",
"infoTooltip": "Dieses ist ein Screening-Selbsttest, keine Diagnose.",
"attributionLabel": "Quelle",
"choosePrompt": "Check-in auswählen",
"start": "Starten",
+1 -2
View File
@@ -7558,8 +7558,7 @@
"mentalHealth": {
"pageTitle": "Mental wellbeing check-in",
"pageDescription": "Two validated, opt-in self-assessments — PHQ-9 (mood) and GAD-7 (worry) — that sit beside your mood tracking. The value is the trend over time, not any single number.",
"disclaimer": "This is a screening self-assessment, not a diagnosis. A high or low score does not mean you do or do not have a condition. Only a qualified health professional can diagnose. If you have concerns, please talk to your doctor.",
"optInNote": "Opt-in and private: your individual answers are encrypted, kept out of the AI Coach and exports, and never shared.",
"infoTooltip": "This is a screening self-test, not a diagnosis.",
"attributionLabel": "Attribution",
"choosePrompt": "Choose a check-in",
"start": "Start",
+1 -2
View File
@@ -7558,8 +7558,7 @@
"mentalHealth": {
"pageTitle": "Revisión de bienestar mental",
"pageDescription": "Dos autoevaluaciones validadas y opcionales — PHQ-9 (estado de ánimo) y GAD-7 (preocupación) — junto a tu registro de ánimo. Lo valioso es la tendencia en el tiempo, no un único número.",
"disclaimer": "Esto es una autoevaluación de cribado, no un diagnóstico. Una puntuación alta o baja no significa que tengas o no una afección. Solo un profesional de salud cualificado puede diagnosticar. Si tienes dudas, habla con tu médico.",
"optInNote": "Opcional y privado: tus respuestas individuales están cifradas, se mantienen fuera del Coach de IA y de las exportaciones, y nunca se comparten.",
"infoTooltip": "Esto es una autoevaluación de cribado, no un diagnóstico.",
"attributionLabel": "Fuente",
"choosePrompt": "Elige una revisión",
"start": "Empezar",
+1 -2
View File
@@ -7558,8 +7558,7 @@
"mentalHealth": {
"pageTitle": "Point sur le bien-être mental",
"pageDescription": "Deux auto-évaluations validées et facultatives — PHQ-9 (humeur) et GAD-7 (inquiétude) — en complément de ton suivi de l'humeur. Ce qui compte, c'est la tendance dans le temps, pas un chiffre isolé.",
"disclaimer": "Il s'agit d'une auto-évaluation de dépistage, pas d'un diagnostic. Un score élevé ou bas ne signifie pas que tu as ou n'as pas un trouble. Seul un professionnel de santé qualifié peut poser un diagnostic. En cas de doute, parles-en à ton médecin.",
"optInNote": "Facultatif et privé : tes réponses individuelles sont chiffrées, tenues à l'écart du Coach IA et des exports, et ne sont jamais partagées.",
"infoTooltip": "Il s'agit d'un autotest de dépistage, pas d'un diagnostic.",
"attributionLabel": "Source",
"choosePrompt": "Choisis un bilan",
"start": "Commencer",
+1 -2
View File
@@ -7558,8 +7558,7 @@
"mentalHealth": {
"pageTitle": "Check-in sul benessere mentale",
"pageDescription": "Due autovalutazioni validate e facoltative — PHQ-9 (umore) e GAD-7 (preoccupazione) — accanto al tuo diario dell'umore. Ciò che conta è l'andamento nel tempo, non un singolo numero.",
"disclaimer": "Questa è un'autovalutazione di screening, non una diagnosi. Un punteggio alto o basso non significa che tu abbia o non abbia un disturbo. Solo un professionista sanitario qualificato può fare una diagnosi. In caso di dubbi, parlane con il tuo medico.",
"optInNote": "Facoltativo e privato: le tue risposte individuali sono cifrate, tenute fuori dal Coach IA e dalle esportazioni, e non vengono mai condivise.",
"infoTooltip": "Questo è un autotest di screening, non una diagnosi.",
"attributionLabel": "Fonte",
"choosePrompt": "Scegli un check-in",
"start": "Inizia",
+1 -2
View File
@@ -7558,8 +7558,7 @@
"mentalHealth": {
"pageTitle": "Sprawdzenie dobrostanu psychicznego",
"pageDescription": "Dwa zwalidowane, dobrowolne testy — PHQ-9 (nastrój) i GAD-7 (lęk) — obok Twojego dziennika nastroju. Liczy się trend w czasie, a nie pojedynczy wynik.",
"disclaimer": "To przesiewowa samoocena, a nie diagnoza. Wysoki lub niski wynik nie oznacza, że masz lub nie masz danego schorzenia. Tylko wykwalifikowany pracownik ochrony zdrowia może postawić diagnozę. W razie wątpliwości porozmawiaj z lekarzem.",
"optInNote": "Dobrowolne i prywatne: Twoje poszczególne odpowiedzi są szyfrowane, pozostają poza Coachem AI i eksportami i nigdy nie są udostępniane.",
"infoTooltip": "To jest przesiewowy autotest, a nie diagnoza.",
"attributionLabel": "Źródło",
"choosePrompt": "Wybierz sprawdzenie",
"start": "Rozpocznij",
@@ -8,7 +8,8 @@ import { useAuth } from "@/hooks/use-auth";
import { MentalWellbeing } from "@/components/mental-health/mental-wellbeing";
/**
* v1.25.0 — `/insights/mental-wellbeing`.
* `/mental-wellbeing` — standalone module page (moved off `/insights/*` in
* v1.25.1 so it no longer borrows the Insights tab strip / layout shell).
*
* Opt-in PHQ-9 / GAD-7 screener surface, beside mood tracking. The screen owns
* its own questionnaire + result + crisis-resource flow; it deliberately does
+3 -3
View File
@@ -87,10 +87,10 @@ export const NAV_DESTINATIONS: ReadonlyArray<NavDestination> = [
// Born-gated: `requiresModule: "mentalHealth"` reads the opt-in (default-off)
// key from the resolved module map, so the entry is absent until the account
// turns the module on from the Modules hub. The destination is the dedicated
// `/insights/mental-wellbeing` check-in surface (its own nav home — the
// active-detection helper defers `/insights` to it on that path).
// top-level `/mental-wellbeing` check-in surface (its own module page — it
// no longer borrows the Insights tab strip / layout shell).
{
href: "/insights/mental-wellbeing",
href: "/mental-wellbeing",
tKey: "nav.mentalWellbeing",
icon: Brain,
tourId: "nav-mental-wellbeing",
@@ -21,6 +21,7 @@ import { apiGet, apiPost } from "@/lib/api/api-fetch";
import { queryKeys } from "@/lib/query-keys";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { InfoHint } from "@/components/ui/info-hint";
import {
INSTRUMENTS,
PHQ_GAD_ATTRIBUTION,
@@ -122,20 +123,17 @@ export function MentalWellbeing() {
);
return (
<div className="mx-auto flex max-w-2xl flex-col gap-6">
<div className="mx-auto flex max-w-3xl flex-col gap-6">
<header className="flex flex-col gap-2">
<h1 className="text-2xl font-semibold">
{t("mentalHealth.pageTitle")}
</h1>
<div className="flex items-center gap-1.5">
<h1 className="text-2xl font-semibold">
{t("mentalHealth.pageTitle")}
</h1>
<InfoHint label={t("mentalHealth.infoTooltip")} />
</div>
<p className="text-muted-foreground text-sm">
{t("mentalHealth.pageDescription")}
</p>
<p className="text-muted-foreground border-border/60 bg-muted/40 rounded-md border p-3 text-xs">
{t("mentalHealth.disclaimer")}
</p>
<p className="text-muted-foreground text-xs">
{t("mentalHealth.optInNote")}
</p>
</header>
{phase === "choose" && (
+2 -2
View File
@@ -140,7 +140,7 @@ export const MODULE_KEYS = [
// tracking. OPT-IN (off by default): a depression / anxiety self-assessment
// is at least as sensitive as mood, so it ships dark and the user turns it on
// deliberately. The `optIn` marker inverts the per-user default; with it off
// the `/insights/mental-wellbeing` surface is hidden from nav and the
// the `/mental-wellbeing` surface is hidden from nav and the
// assessment routes refuse server-side. Item answers are always encrypted and
// always excluded from the AI Coach / MCP regardless of this toggle.
"mentalHealth",
@@ -313,7 +313,7 @@ export const MODULE_REGISTRY: Readonly<Record<ModuleKey, ModuleDefinition>> =
category: "tracking",
// Off by default: a depression / anxiety screener is highly sensitive, so
// the surface ships dark and the user opts in deliberately. Turning it on
// reveals the `/insights/mental-wellbeing` check-in and lets the screener
// reveals the `/mental-wellbeing` check-in and lets the screener
// total ride the doctor-report export; item answers stay encrypted and
// off the AI Coach / MCP regardless.
optIn: true,