From db34a0624314c7619cbc0886bd7b105ce488b5ba Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Mon, 6 Apr 2026 15:42:33 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=89=B4=EC=8A=A4=20=EB=AF=B8=EB=A6=AC?= =?UTF-8?q?=EB=B3=B4=EA=B8=B0=20=E2=80=94=20AI=20=EC=9A=94=EC=95=BD=20?= =?UTF-8?q?=EC=83=81=EB=8B=A8=20+=20=EB=B3=B8=EB=AC=B8/=EB=A9=94=EB=AA=A8?= =?UTF-8?q?=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AI 요약: 파란 박스로 상단에 별도 표시 - 본문 입력: extracted_text에 추가 (기사 전문 붙여넣기) - 메모: user_note에 저장 (개인 메모) - 기사 선택 시 편집 상태 초기화 Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/routes/news/+page.svelte | 85 ++++++++++++++++++++++----- 1 file changed, 69 insertions(+), 16 deletions(-) diff --git a/frontend/src/routes/news/+page.svelte b/frontend/src/routes/news/+page.svelte index 3eaf8a3..08680fe 100644 --- a/frontend/src/routes/news/+page.svelte +++ b/frontend/src/routes/news/+page.svelte @@ -24,6 +24,8 @@ let currentPage = $state(1); let noteEditing = $state(false); let noteText = $state(''); + let contentEditing = $state(false); + let contentText = $state(''); let expandedSources = $state({}); onMount(async () => { @@ -71,6 +73,8 @@ function selectArticle(article) { selectedArticle = article; + noteEditing = false; + contentEditing = false; if (!article.is_read) markRead(article); } @@ -95,6 +99,22 @@ } } + async function saveContent() { + try { + // 본문은 extracted_text에 추가 (기존 요약 유지 + 본문 합산) + const newText = selectedArticle.extracted_text + '\n\n---\n\n' + contentText; + await api(`/documents/${selectedArticle.id}/content`, { + method: 'PUT', + body: JSON.stringify({ content: newText }), + }); + selectedArticle.extracted_text = newText; + contentEditing = false; + addToast('success', '본문 저장됨'); + } catch (e) { + addToast('error', '본문 저장 실패'); + } + } + async function saveNote() { try { await api(`/documents/${selectedArticle.id}`, { @@ -269,35 +289,68 @@

{selectedArticle.title}

+ + + {#if selectedArticle.ai_summary} +
+

AI 요약

+
+ {@html renderMd(selectedArticle.ai_summary)} +
+
+ {/if} + +
{@html renderMd(selectedArticle.extracted_text || '')}
- {#if noteEditing} -
-

본문 / 메모 입력

+
+

본문 입력

+ {#if contentEditing} + +
+ + +
+ {:else} + + {/if} +
+ + +
+

메모

+ {#if noteEditing}
-
- {:else} - - {#if selectedArticle.user_note} -
- {selectedArticle.user_note} -
+ {:else} + + {#if selectedArticle.user_note} +
+ {selectedArticle.user_note} +
+ {/if} {/if} - {/if} +
{/if}