feat: nutrition trend/history view (v0.69.0)

Extends GET /api/v1/users/me/nutrition-diary with a `range` query
param (7/30/90) that switches it into trend mode -- daily
calorie/macro totals bucketed from the same cooking-history rows the
single-day diary already reads, with zero-filled days so the chart
has a continuous x-axis. New NutritionTrend component reuses the
existing hand-rolled TimeSeriesChart (previously admin-only, now
imported from user-facing code too) for the calorie line, plus
simple average-macro stat tiles below it.

Nutrition page now has Diary/Trend tabs instead of just the diary.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Arnaud
2026-07-22 00:36:10 +02:00
parent 35d4f3d055
commit 592c86f8d4
11 changed files with 202 additions and 9 deletions
+6 -1
View File
@@ -686,7 +686,12 @@
"noEntries": "Nothing logged for this day. Mark a recipe as \"cooked\" to see it here.",
"servingsLabel": "{count, plural, one {1 serving} other {{count} servings}}",
"nutritionUnknownBadge": "Nutrition unknown",
"unknownNote": "{count, plural, one {1 entry has no nutrition data and isn't included in the totals above.} other {{count} entries have no nutrition data and aren't included in the totals above.}}"
"unknownNote": "{count, plural, one {1 entry has no nutrition data and isn't included in the totals above.} other {{count} entries have no nutrition data and aren't included in the totals above.}}",
"tabDiary": "Diary",
"tabTrend": "Trend",
"trendCaloriesTitle": "Calories over time",
"trendRangeDays": "{count} days",
"trendDailyAvg": "avg {value}/day"
},
"explore": {
"title": "Explore",