Add trend charts and calendar-week averages to History page

Adds Recharts-based calorie and macro trend charts plus real
calendar-week (Mon-Sun) averages, replacing the old rolling
7-day average. Colors were chosen and validated with the dataviz
skill's contrast/CVD checks separately for light and dark mode.

Fixes a timezone bug where Date.toISOString() shifted week
boundaries by one day in UTC+ timezones, and two Recharts pitfalls
(negative chart margin hiding the Y-axis, mount animation stuck
invisible in headless browsers).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-29 13:36:38 +02:00
co-authored by Claude Sonnet 5
parent 2f95eeda83
commit 5196ff0194
8 changed files with 685 additions and 24 deletions
+2 -1
View File
@@ -14,7 +14,8 @@
"html5-qrcode": "^2.3.8",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"react-router-dom": "^7.18.1"
"react-router-dom": "^7.18.1",
"recharts": "^3.10.1"
},
"devDependencies": {
"@tailwindcss/vite": "^4.3.2",