From ef6f857a6d3e563a4e8c424f1c8ca5b9ea0c7145 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Mon, 6 Apr 2026 14:38:42 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=89=B4=EC=8A=A4=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=E2=80=94=20=EB=8B=AB=EA=B8=B0=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=20+=20=ED=8E=98=EC=9D=B4=EC=A7=80=EB=84=A4=EC=9D=B4=EC=85=98?= =?UTF-8?q?=20+=20=EC=83=81=EC=84=B8=20=EB=A7=81=ED=81=AC=20+=20=EB=B3=B8?= =?UTF-8?q?=EB=AC=B8=20=EC=9E=85=EB=A0=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 미리보기 닫기 버튼 추가 - 페이지네이션 (30건 단위) - "상세" 링크 → /documents/{id} - "본문/메모 입력" → user_note 저장 - DocumentUpdate에 is_read 필드 추가 Co-Authored-By: Claude Opus 4.6 (1M context) --- app/api/documents.py | 1 + frontend/src/routes/news/+page.svelte | 105 ++++++++++++++++++++++---- 2 files changed, 90 insertions(+), 16 deletions(-) diff --git a/app/api/documents.py b/app/api/documents.py index 862b9cd..ff11fe0 100644 --- a/app/api/documents.py +++ b/app/api/documents.py @@ -72,6 +72,7 @@ class DocumentUpdate(BaseModel): ai_sub_group: str | None = None ai_tags: list | None = None user_note: str | None = None + is_read: bool | None = None edit_url: str | None = None source_channel: str | None = None data_origin: str | None = None diff --git a/frontend/src/routes/news/+page.svelte b/frontend/src/routes/news/+page.svelte index 7c57eea..0ad1fb0 100644 --- a/frontend/src/routes/news/+page.svelte +++ b/frontend/src/routes/news/+page.svelte @@ -22,6 +22,8 @@ let showUnreadOnly = $state(false); let sources = $state([]); let currentPage = $state(1); + let noteEditing = $state(false); + let noteText = $state(''); onMount(async () => { try { @@ -79,6 +81,20 @@ } } + async function saveNote() { + try { + await api(`/documents/${selectedArticle.id}`, { + method: 'PATCH', + body: JSON.stringify({ user_note: noteText }), + }); + selectedArticle.user_note = noteText; + noteEditing = false; + addToast('success', '저장됨'); + } catch (e) { + addToast('error', '저장 실패'); + } + } + function timeAgo(dateStr) { const diff = Date.now() - new Date(dateStr).getTime(); const mins = Math.floor(diff / 60000); @@ -172,26 +188,83 @@ {/if} + + {#if total > 30} +
+ {#each Array(Math.ceil(total / 30)) as _, i} + + {/each} +
+ {/if} + {#if selectedArticle} -
-

{selectedArticle.title}

-
- {selectedArticle.ai_sub_group} - · - {timeAgo(selectedArticle.created_at)} +
+ +
+
+ {selectedArticle.ai_sub_group} + · + {timeAgo(selectedArticle.created_at)} + · + {selectedArticle.file_format} +
+
+ {#if selectedArticle.edit_url} + 원문 보기 → + {/if} + 상세 + +
-
- {@html renderMd(selectedArticle.extracted_text || '')} + + +
+

{selectedArticle.title}

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

본문 / 메모 입력

+ +
+ + +
+
+ {:else} + + {#if selectedArticle.user_note} +
+ {selectedArticle.user_note} +
+ {/if} + {/if}
- {#if selectedArticle.edit_url} - 원문 보기 → - {/if}
{/if}