From 36c8a0df3c98b5fad6dd926f05cca64eb0441809 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Thu, 30 Apr 2026 10:44:00 +0900 Subject: [PATCH] =?UTF-8?q?refactor(study):=20=EB=B3=B8=EB=AC=B8=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=EB=A5=BC=20q=20=EB=8B=A8=EB=8F=85=20?= =?UTF-8?q?=EB=8F=84=EC=B0=A9=20=EC=8B=9C=EC=A0=90=EC=9C=BC=EB=A1=9C=20unb?= =?UTF-8?q?lock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - load() 가 q 도착 후 related-types/siblings Promise.all 까지 기다려서 loading=false → 빈 카드 노출 시간이 셋 중 가장 느린 것 기준으로 늘어남 - q 직후 loading=false, 나머지 두 fetch 는 fire-and-forget - related 섹션 자체 relatedLoading, prev/next 는 siblings 비면 안 보여 UX 영향 0 Co-Authored-By: Claude Opus 4.7 (1M context) --- .../study/topics/[id]/questions/[qid]/+page.svelte | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/src/routes/study/topics/[id]/questions/[qid]/+page.svelte b/frontend/src/routes/study/topics/[id]/questions/[qid]/+page.svelte index d90ba7e..996be4e 100644 --- a/frontend/src/routes/study/topics/[id]/questions/[qid]/+page.svelte +++ b/frontend/src/routes/study/topics/[id]/questions/[qid]/+page.svelte @@ -132,18 +132,17 @@ loading = true; try { q = await api(`/study-questions/${qid}`); - // 페이지 진입 시 AI 해설 상태 초기화 — q.ai_explanation_status 가 ready/stale 이면 1회 prefetch (캐시 hit). - // 사용자가 [해설 보기] 누르기 전엔 본문 표시 안 함, 다만 상태는 미리 알 수 있음. aiState = 'idle'; aiData = null; aiError = null; related = null; - // 회차 prev/next + 반복 출제/유사 유형 병렬 로드. - await Promise.all([loadRoundSiblings(), loadRelatedTypes()]); + // body 표시는 q 도착 직후. 관련 유형/회차 sibling 은 fire-and-forget — + // related 섹션은 자체 relatedLoading 플래그, prev/next 는 siblings 비면 안 보임. + loading = false; + void Promise.allSettled([loadRoundSiblings(), loadRelatedTypes()]); } catch (err) { addToast('error', err?.detail || '문제 로드 실패'); q = null; - } finally { loading = false; } }