Phase 9f: Statistik-Dashboard
Neuer Endpoint GET /api/v1/me/stats liefert in einem Aufruf alle Aggregate für die Stats-UI: - total_decks / total_cards / total_reviews / due_now - state_counts pro FSRS-Zustand (new/learning/review/relearning) - reviewed_per_day für die letzten 7 Tage (Quelle: reviews.last_review, via to_char(day, 'YYYY-MM-DD') auf Postgres-Seite gruppiert) - streak_days (rückwärts ab heute bis zum ersten Tag ohne Review) study_sessions wird aktuell NICHT befüllt — der Schema-Slot existiert seit Phase 3, aber der Session-Tracker kommt erst, wenn das Lern- Flow-Layer ausgebaut wird. last_review reicht für jetzt. /stats-Page rendert vier KPI-Cards, einen 7-Tage-Säulen-Chart per CSS-Heights, plus eine FSRS-State-Distribution. Header-Nav um "Statistik" ergänzt. E2E-Smoke gegen lokale Postgres bestätigt: bestehender Cloze-User zeigt 1 Deck, 1 Karte, 2 Reviews, 2 due, alle "new"-State, 0 Streak — passt zum gestern eingespielten Smoke-User. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
03117d5869
commit
6db6dc3e42
4 changed files with 238 additions and 2 deletions
|
|
@ -32,6 +32,11 @@
|
|||
class="hover:text-[var(--color-primary)]"
|
||||
class:font-medium={page.url.pathname.startsWith('/import')}>Import</a
|
||||
>
|
||||
<a
|
||||
href="/stats"
|
||||
class="hover:text-[var(--color-primary)]"
|
||||
class:font-medium={page.url.pathname.startsWith('/stats')}>Statistik</a
|
||||
>
|
||||
</nav>
|
||||
|
||||
<div class="flex items-center gap-3 text-sm">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue