From 2b457a830532081842f075a7859d6104e2174f97 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Mon, 6 Apr 2026 13:55:49 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=89=B4=EC=8A=A4=20=EC=A0=84=EC=9A=A9?= =?UTF-8?q?=20=EB=B7=B0=EC=96=B4=20+=20=EC=B9=B4=EB=93=9C=20=EA=B5=AC?= =?UTF-8?q?=EB=B6=84=20+=20=EC=84=A4=EC=A0=95=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DocumentViewer: source_channel=news → article 전용 뷰어 (제목/소스/날짜/요약/원문 링크 rel=noopener) - DocumentCard: 뉴스 카드에 📰 아이콘 - settings: 뉴스 소스 관리 (목록/추가/삭제/토글/수집/마지막 시간) Co-Authored-By: Claude Opus 4.6 (1M context) --- .../src/lib/components/DocumentCard.svelte | 3 + .../src/lib/components/DocumentViewer.svelte | 30 +++- frontend/src/routes/settings/+page.svelte | 164 ++++++++++++++++-- 3 files changed, 179 insertions(+), 18 deletions(-) diff --git a/frontend/src/lib/components/DocumentCard.svelte b/frontend/src/lib/components/DocumentCard.svelte index a88e43e..952a0fd 100644 --- a/frontend/src/lib/components/DocumentCard.svelte +++ b/frontend/src/lib/components/DocumentCard.svelte @@ -96,6 +96,9 @@
+ {#if doc.source_channel === 'news' && doc.edit_url} + 📰 + {/if} {#if doc.score !== undefined} {(doc.score * 100).toFixed(0)}% {/if} diff --git a/frontend/src/lib/components/DocumentViewer.svelte b/frontend/src/lib/components/DocumentViewer.svelte index b704109..457cac9 100644 --- a/frontend/src/lib/components/DocumentViewer.svelte +++ b/frontend/src/lib/components/DocumentViewer.svelte @@ -62,7 +62,7 @@ loading = true; try { fullDoc = await api(`/documents/${id}`); - viewerType = getViewerType(fullDoc.file_format); + viewerType = fullDoc.source_channel === 'news' ? 'article' : getViewerType(fullDoc.file_format); // Markdown: extracted_text 없으면 원본 파일 직접 가져오기 if (viewerType === 'markdown' && !fullDoc.extracted_text) { @@ -232,6 +232,34 @@ class="px-3 py-1.5 text-sm bg-[var(--accent)] text-white rounded hover:bg-[var(--accent-hover)]" >AutoCAD Web에서 열기
+ {:else if viewerType === 'article'} + +
+

{fullDoc.title}

+
+ {#if fullDoc.ai_tags?.length} + {#each fullDoc.ai_tags.filter(t => t.startsWith('News/')) as tag} + {tag.replace('News/', '')} + {/each} + {/if} + {new Date(fullDoc.created_at).toLocaleDateString('ko-KR', { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' })} +
+
+ {@html renderMd(fullDoc.extracted_text || '')} +
+
+ {#if fullDoc.edit_url} + + 원문 보기 + + {/if} +
+
{:else}

미리보기를 지원하지 않는 형식입니다 ({fullDoc.file_format})

diff --git a/frontend/src/routes/settings/+page.svelte b/frontend/src/routes/settings/+page.svelte index 19ec2b3..000ba48 100644 --- a/frontend/src/routes/settings/+page.svelte +++ b/frontend/src/routes/settings/+page.svelte @@ -1,4 +1,5 @@
-
+
-
+

계정 정보

@@ -63,21 +120,94 @@

비밀번호 변경

{ e.preventDefault(); changePassword(); }} class="space-y-3">
- - + +
- - + +
- - + +
+ + +
+
+

뉴스 소스

+
+ + +
+
+ + + {#if showAddForm} +
{ e.preventDefault(); addSource(); }} class="mb-4 p-3 bg-[var(--bg)] rounded-lg space-y-2"> +
+ + + + +
+ +
+ {/if} + + + {#if loadingSources} +
로딩 중...
+ {:else if sources.length === 0} +
등록된 소스가 없습니다
+ {:else} +
+ {#each sources as source} +
+
+ + {source.name} + {source.category} +
+
+ {#if source.last_fetched_at} + + {new Date(source.last_fetched_at).toLocaleDateString('ko-KR', { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' })} + + {/if} + +
+
+ {/each} +
+ {/if} +