diff --git a/frontend/src/routes/study/topics/+page.svelte b/frontend/src/routes/study/topics/+page.svelte index 40d16bd..0b4704c 100644 --- a/frontend/src/routes/study/topics/+page.svelte +++ b/frontend/src/routes/study/topics/+page.svelte @@ -13,7 +13,7 @@ import { goto } from '$app/navigation'; import { api } from '$lib/api'; import { addToast } from '$lib/stores/toast'; - import { Plus, ArrowLeft, FolderKanban, Trash2, Pencil } from 'lucide-svelte'; + import { Plus, ArrowLeft, FolderKanban, Trash2, Pencil, Activity } from 'lucide-svelte'; import Button from '$lib/components/ui/Button.svelte'; import Card from '$lib/components/ui/Card.svelte'; import EmptyState from '$lib/components/ui/EmptyState.svelte'; @@ -21,6 +21,7 @@ import TextInput from '$lib/components/ui/TextInput.svelte'; import Select from '$lib/components/ui/Select.svelte'; import Textarea from '$lib/components/ui/Textarea.svelte'; + import { renderMathMarkdown } from '$lib/utils/mathMarkdown'; const STUDY_TYPE_OPTIONS = [ { value: '', label: '미지정' }, @@ -35,6 +36,29 @@ let total = $state(0); let loading = $state(true); + // ─── 이드 학습 진단 (study_diagnosis surface) ─── + // 워커(study_weakness)가 산출한 최신 약점 스냅샷을 코치 언어로 번역. 데이터 없으면 status='none'. + // LLM 호출이라 버튼 트리거(자동 호출 X). + let diag = $state(null); // StudyDiagnosisResponse | null + let diagLoading = $state(false); + async function generateDiagnosis() { + if (diagLoading) return; + diagLoading = true; + try { + diag = await api('/study-topics/diagnosis/generate', { method: 'POST' }); + } catch { + addToast('error', '진단 생성 실패'); + } finally { + diagLoading = false; + } + } + function fmtDiagTime(s) { + if (!s) return ''; + const d = new Date(s); + if (isNaN(d.getTime())) return ''; + return d.toLocaleString('ko-KR', { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' }); + } + // 생성 폼 let formOpen = $state(false); let f_name = $state(''); @@ -205,6 +229,48 @@
한 주제 아래에 필기 세션과 자료를 묶어 보고 진도 관리. 향후 단어장·오디오·문제세트도 같은 묶음으로 연결됩니다.
+ ++ 아직 진단할 약점 데이터가 없습니다. 학습 주제를 공부중으로 표시하면 매일 새벽 누적 풀이에서 약점·태도 스냅샷이 만들어지고, 여기서 진단 코치를 받을 수 있습니다. +
+ {:else} ++ 누적 학습 이력을 근거로 약점 토픽과 학습 태도를 진단합니다. 진단 생성을 눌러보세요. +
+ {/if} +