d39882c38e
신규 라우트 /study/topics/[id]/stats — backend 단일 endpoint 호출로 6 섹션:
진척도 / 학습 상태 분포 / 복습 큐 / 세션 추이 / 일별 풀이량 / 과목별 약점.
차트는 SVG 직접 렌더 (의존성 0).
Backend (app/api/study_question_progress.py):
- GET /study-topics/{tid}/stats — 6~7 쿼리 묶음
· 문제 진척도 (study_questions count + progress count)
· pattern_state 분포 (NULL → unattempted + 토픽 미시도분 합산)
· review_stage 분포 (0/1/2/3/mastered≥4)
· due 분류 (today / this_week / later / mastered) — datetime 비교 + filter
· 최근 done 세션 추이 (Phase 2-B 4 컬럼 활용, limit 20)
· 일별 풀이량 30일 (cast Date + group)
· 과목별 약점 (subject 별 attempted/correct/pending_review/chronic)
Frontend (/study/topics/[id]/stats):
- Card grid 6개. 진행률 바 + stacked horizontal bar + SVG sparkline + bar chart.
- 패턴 분포: 7색 stacked bar + 범례 grid.
- 복습 큐: 4 카운트 박스 + stage 분포 inline.
- 세션 추이: SVG sparkline (50% baseline) + 최근 5세션 표 (회복/퇴행/새로 맞힘 인라인).
- 일별 풀이량: SVG bar (max 동적) + title tooltip + start/end 날짜 라벨.
- 과목별: 정답률 진행률 바 + 미확인/반복 오답 인라인.
진입: 토픽 페이지 헤더 [통계] 버튼.
Plan: ~/.claude/plans/crispy-petting-dijkstra.md (Phase 2-D)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>