feat(web): tracking page — weight entries with sparkline + history (PRD §5.2)

New /tracking route in the editorial language:
- "CAPITOLO VI / Pesata e misure." masthead
- 7/5 split: form left, STORICO right

Form (left, "NUOVA RILEVAZIONE"):
- Date + weight required, with the latest weight pre-filled to encourage
  consistency between weeks
- Optional misure: girovita / fianchi / coscia / braccio (cm), grouped under
  a "MISURE (CM) — OPZIONALI" eyebrow
- Subjective indicators 1–10: energia / sonno / fame
- Italic "Registrato." (oliva) confirmation after a successful POST
- Server action calls POST /me/weight-entries through API_URL with the
  user's session cookie; sparkline + history revalidate via
  revalidatePath('/tracking')

History (right, "STORICO"):
- Inline SVG sparkline of the user's weight series with a terracotta dot
  marking the latest reading; ink-soft date axis labels under the line
- Two big mono stats: "PESO ATTUALE" and "VARIAZIONE" (oliva when negative,
  pomodoro when positive, ink at zero)
- Newest 8 entries listed with hairline rules between rows
- Italian italic empty-state copy when no entries exist yet

Home gains a third NavItem ("Tracking — Pesata & misure").

Verified manually with a fresh user signup → disclaimer → profile → tracking:
sparkline / "PESO ATTUALE 76.0 kg" / "VARIAZIONE 0.0 kg" / list row "29 apr 76.0 kg".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
lucianoandClaude Opus 4.7 committed 2026-04-29 16:53:04 +02:00
1 parent 59a311cfc9
commit 4e00c131b9
6 files changed
+462

No files matched your search

+24
View File
@@ -9,6 +9,7 @@
"signOut": "Esci",
"completeProfile": "Profilo & calcoli",
"viewPlan": "Piano della settimana",
"viewTracking": "Pesata & misure",
"lettura": "Continua la lettura",
"inizia": "Inizia",
"greeting": "Buongiorno, <name>{name}</name>.",
@@ -68,6 +69,29 @@
"disclaimer": "Procedendo accetti che i tuoi dati siano trattati come descritto nell'informativa sulla privacy. KetoPath non sostituisce il parere medico."
}
},
"Tracking": {
"title": "Pesata e misure",
"subtitle": "Pochi numeri, una volta a settimana. La tendenza emerge dalla regolarità — non dalla pesata di oggi.",
"newEntry": "Nuova rilevazione",
"history": "Storico",
"date": "Data",
"weightKg": "Peso (kg)",
"measurements": "Misure (cm) — opzionali",
"waist": "Girovita",
"hips": "Fianchi",
"thigh": "Coscia",
"arm": "Braccio",
"subjective": "Indicatori soggettivi (1–10)",
"energy": "Energia",
"sleep": "Sonno",
"hunger": "Fame",
"save": "Registra",
"saving": "Salvataggio…",
"saved": "Registrato.",
"current": "Peso attuale",
"delta": "Variazione",
"emptyHistory": "Nessuna rilevazione registrata. Inserisci la prima a destra: la tendenza apparirà dopo due o tre pesate."
},
"Plan": {
"title": "Il tuo piano",
"weekOf": "Settimana del {date}",