From 732e85e4df67295e67884d0a404431d8700f5108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Wed, 3 Jun 2026 08:54:54 +0200 Subject: [PATCH] fix(insights): add scores drill-down back-link and unify back-link styling The composite-score detail page (/insights/scores/[metric]) gains a leading back-link to the Insights overview, matching the other drill-down surfaces. Align the medication detail + history back-links onto the canonical ghost recipe (-ml-2 w-fit, mr-1 size-4 icon) used by the values and workout-detail pages, replacing the divergent -ml-2 gap-1 variant. --- messages/de.json | 4 +++- messages/en.json | 4 +++- messages/es.json | 4 +++- messages/fr.json | 4 +++- messages/it.json | 4 +++- messages/pl.json | 4 +++- src/app/insights/scores/[metric]/page.tsx | 17 +++++++++++++++++ src/app/medications/[id]/history/page.tsx | 9 ++------- src/app/medications/[id]/page.tsx | 18 ++++-------------- 9 files changed, 41 insertions(+), 27 deletions(-) diff --git a/messages/de.json b/messages/de.json index f069f25de..840cfa241 100644 --- a/messages/de.json +++ b/messages/de.json @@ -2047,7 +2047,9 @@ "weekday": "Die meisten deiner {metric}-Werte fallen auf einen Wochentag. Messungen an anderen Tagen ergeben ein vollständigeres Bild.", "timeOfDay": "Die meisten deiner {metric}-Werte fallen auf eine ähnliche Tageszeit. Unterschiedliche Zeiten ergeben ein vollständigeres Bild." }, - "valuesBack": "Zurück zu Insights" + "valuesBack": "Zurück zu Insights", + "valuesBackToMetric": "Zurück zu {metric}", + "scoresBack": "Zurück zu Insights" }, "sleep": { "title": "Schlaf", diff --git a/messages/en.json b/messages/en.json index 1160ba975..9369d1c64 100644 --- a/messages/en.json +++ b/messages/en.json @@ -2047,7 +2047,9 @@ "weekday": "Most of your {metric} readings land on one weekday. Logging on other days gives a fuller picture.", "timeOfDay": "Most of your {metric} readings land at a similar time of day. Varying the time gives a fuller picture." }, - "valuesBack": "Back to insights" + "valuesBack": "Back to insights", + "valuesBackToMetric": "Back to {metric}", + "scoresBack": "Back to insights" }, "sleep": { "title": "Sleep", diff --git a/messages/es.json b/messages/es.json index 8c0b10aaf..99faabece 100644 --- a/messages/es.json +++ b/messages/es.json @@ -2047,7 +2047,9 @@ "weekday": "La mayoría de tus mediciones de {metric} caen en un mismo día de la semana. Registrar en otros días ofrece una imagen más completa.", "timeOfDay": "La mayoría de tus mediciones de {metric} caen a una hora similar del día. Variar la hora ofrece una imagen más completa." }, - "valuesBack": "Volver a Insights" + "valuesBack": "Volver a Insights", + "valuesBackToMetric": "Volver a {metric}", + "scoresBack": "Volver a Insights" }, "sleep": { "title": "Sueño", diff --git a/messages/fr.json b/messages/fr.json index b0f7ed8ca..e6fd310c5 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -2047,7 +2047,9 @@ "weekday": "La plupart de vos mesures de {metric} tombent le même jour de la semaine. Enregistrer d'autres jours donne une image plus complète.", "timeOfDay": "La plupart de vos mesures de {metric} tombent à une heure similaire de la journée. Varier l'heure donne une image plus complète." }, - "valuesBack": "Retour aux Insights" + "valuesBack": "Retour aux Insights", + "valuesBackToMetric": "Retour à {metric}", + "scoresBack": "Retour aux Insights" }, "sleep": { "title": "Sommeil", diff --git a/messages/it.json b/messages/it.json index 39c72189e..231752a58 100644 --- a/messages/it.json +++ b/messages/it.json @@ -2047,7 +2047,9 @@ "weekday": "La maggior parte delle tue misurazioni di {metric} cade in un solo giorno della settimana. Registrare in altri giorni offre un quadro più completo.", "timeOfDay": "La maggior parte delle tue misurazioni di {metric} cade in un orario simile della giornata. Variare l'orario offre un quadro più completo." }, - "valuesBack": "Torna a Insights" + "valuesBack": "Torna a Insights", + "valuesBackToMetric": "Torna a {metric}", + "scoresBack": "Torna a Insights" }, "sleep": { "title": "Sonno", diff --git a/messages/pl.json b/messages/pl.json index f2b500f4c..f42943669 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -2047,7 +2047,9 @@ "weekday": "Większość Twoich pomiarów {metric} przypada na jeden dzień tygodnia. Pomiary w inne dni dają pełniejszy obraz.", "timeOfDay": "Większość Twoich pomiarów {metric} przypada o podobnej porze dnia. Różne pory dają pełniejszy obraz." }, - "valuesBack": "Powrót do Insights" + "valuesBack": "Powrót do Insights", + "valuesBackToMetric": "Powrót do {metric}", + "scoresBack": "Powrót do Insights" }, "sleep": { "title": "Sen", diff --git a/src/app/insights/scores/[metric]/page.tsx b/src/app/insights/scores/[metric]/page.tsx index fe7c630de..e8b541d68 100644 --- a/src/app/insights/scores/[metric]/page.tsx +++ b/src/app/insights/scores/[metric]/page.tsx @@ -1,8 +1,11 @@ "use client"; +import Link from "next/link"; import { useParams } from "next/navigation"; +import { ArrowLeft } from "lucide-react"; import { useTranslations } from "@/lib/i18n/context"; +import { Button } from "@/components/ui/button"; import { SubPageShell } from "@/components/insights/sub-page-shell"; import { CompositeScoreAnatomy, @@ -68,6 +71,20 @@ export default function CompositeScorePage() { + +