feat: teeth tracker, feeding analysis, sidebar groups, timeline polish

Features:
- Teeth tracker: Tooth model + migration, API routes (GET/POST upsert/DELETE),
  page at /teeth with 20-tooth grid, progress bar, inline mark/unmark flow
- Dashboard feeding analysis: avg interval + last feed + next expected time widget
- Fix dashboard baby?.name crash (selectedBaby?.name)

UI/UX:
- Sidebar: grouped into Suivi / Santé / Vie du bébé / Outils sections
- Nav: active highlight works on child routes (startsWith)
- Timeline: filter chips sticky on mobile; skeleton cards replace spinner
- Stats: 500-event limit warning banner
- Medications: 3 states — "Dans Xh" (orange), "Disponible" (green), "En retard de Xh" (amber)
- Notes: skip auto-save on empty/whitespace blur

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 21:51:32 +02:00
parent 8bb048ff56
commit cd3efa98fc
11 changed files with 596 additions and 25 deletions
+21 -3
View File
@@ -160,7 +160,8 @@ export default function TimelinePage() {
</button>
</div>
{/* Filter chips */}
<div className="flex gap-2 overflow-x-auto pb-1 no-scrollbar">
<div className="sticky top-0 z-10 bg-white dark:bg-slate-900 -mx-4 px-4 py-2 border-b border-slate-100 dark:border-slate-800">
<div className="flex gap-2 overflow-x-auto no-scrollbar">
<button
onClick={() => handleFilterChange("")}
className={`flex-shrink-0 px-3 py-1.5 rounded-full text-xs font-medium transition border ${
@@ -182,6 +183,7 @@ export default function TimelinePage() {
</button>
))}
</div>
</div>
</div>
{selectMode && (
@@ -210,8 +212,24 @@ export default function TimelinePage() {
)}
{isLoading && (
<div className="flex justify-center py-16">
<div className="w-6 h-6 border-2 border-indigo-600 border-t-transparent rounded-full animate-spin" />
<div className="space-y-6">
{[1, 2, 3].map((g) => (
<div key={g}>
<div className="h-3 w-24 bg-slate-200 dark:bg-slate-700 rounded animate-pulse mb-3" />
<div className="bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-xl overflow-hidden divide-y divide-slate-100 dark:divide-slate-700">
{[1, 2, 3, 4].map((r) => (
<div key={r} className="flex items-center gap-3 px-4 py-3">
<div className="w-8 h-8 rounded-lg bg-slate-200 dark:bg-slate-700 animate-pulse flex-shrink-0" />
<div className="flex-1 space-y-1.5">
<div className="h-3 w-28 bg-slate-200 dark:bg-slate-700 rounded animate-pulse" />
<div className="h-2.5 w-16 bg-slate-100 dark:bg-slate-800 rounded animate-pulse" />
</div>
<div className="h-3 w-10 bg-slate-200 dark:bg-slate-700 rounded animate-pulse" />
</div>
))}
</div>
</div>
))}
</div>
)}