From 37c977e3a46cb93da452549b2656cd8db1dfe901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 28 Jun 2026 20:48:39 +0200 Subject: [PATCH] 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. --- messages/de.json | 3 +-- messages/en.json | 3 +-- messages/es.json | 3 +-- messages/fr.json | 3 +-- messages/it.json | 3 +-- messages/pl.json | 3 +-- .../{insights => }/mental-wellbeing/page.tsx | 3 ++- src/components/layout/nav-model.ts | 6 +++--- .../mental-health/mental-wellbeing.tsx | 18 ++++++++---------- src/lib/modules/registry.ts | 4 ++-- 10 files changed, 21 insertions(+), 28 deletions(-) rename src/app/{insights => }/mental-wellbeing/page.tsx (92%) diff --git a/messages/de.json b/messages/de.json index a90fecd6a..9d8bb8c15 100644 --- a/messages/de.json +++ b/messages/de.json @@ -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", diff --git a/messages/en.json b/messages/en.json index 511493b1c..1039d3c7a 100644 --- a/messages/en.json +++ b/messages/en.json @@ -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", diff --git a/messages/es.json b/messages/es.json index 298329f0c..ddb36a1ee 100644 --- a/messages/es.json +++ b/messages/es.json @@ -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", diff --git a/messages/fr.json b/messages/fr.json index ae54eb4e2..154da8762 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -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", diff --git a/messages/it.json b/messages/it.json index 7d47c79f9..ef8c1ff39 100644 --- a/messages/it.json +++ b/messages/it.json @@ -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", diff --git a/messages/pl.json b/messages/pl.json index 6e0a5ce53..2f4870bd4 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -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", diff --git a/src/app/insights/mental-wellbeing/page.tsx b/src/app/mental-wellbeing/page.tsx similarity index 92% rename from src/app/insights/mental-wellbeing/page.tsx rename to src/app/mental-wellbeing/page.tsx index 778255ddf..56b2e2d47 100644 --- a/src/app/insights/mental-wellbeing/page.tsx +++ b/src/app/mental-wellbeing/page.tsx @@ -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 diff --git a/src/components/layout/nav-model.ts b/src/components/layout/nav-model.ts index 49e04b45b..c4cb8ba72 100644 --- a/src/components/layout/nav-model.ts +++ b/src/components/layout/nav-model.ts @@ -87,10 +87,10 @@ export const NAV_DESTINATIONS: ReadonlyArray = [ // 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", diff --git a/src/components/mental-health/mental-wellbeing.tsx b/src/components/mental-health/mental-wellbeing.tsx index 1cd85d9c1..ebccc902f 100644 --- a/src/components/mental-health/mental-wellbeing.tsx +++ b/src/components/mental-health/mental-wellbeing.tsx @@ -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 ( -
+
-

- {t("mentalHealth.pageTitle")} -

+
+

+ {t("mentalHealth.pageTitle")} +

+ +

{t("mentalHealth.pageDescription")}

-

- {t("mentalHealth.disclaimer")} -

-

- {t("mentalHealth.optInNote")} -

{phase === "choose" && ( diff --git a/src/lib/modules/registry.ts b/src/lib/modules/registry.ts index 0fae157e5..2af5a9636 100644 --- a/src/lib/modules/registry.ts +++ b/src/lib/modules/registry.ts @@ -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> = 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,