From cb8a84677363cea3a055cfe28fb743b96c5e519b Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Fri, 3 Apr 2026 09:05:40 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Phase=201B=20=E2=80=94=20DocumentCard/T?= =?UTF-8?q?agPill/FormatIcon=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DocumentCard: 포맷 아이콘, 제목+요약, domain 경로, 태그 pill, data_origin 배지, 날짜, 파일 크기 - TagPill: 계층별 색상 (@amber, #blue, $green, !red), 클릭→필터 - FormatIcon: 파일 포맷별 lucide 아이콘 매핑 - documents 페이지에서 DocumentCard 컴포넌트 사용 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../src/lib/components/DocumentCard.svelte | 79 +++++++++++++++++++ frontend/src/lib/components/FormatIcon.svelte | 30 +++++++ frontend/src/lib/components/TagPill.svelte | 40 ++++++++++ frontend/src/routes/documents/+page.svelte | 32 +------- 4 files changed, 151 insertions(+), 30 deletions(-) create mode 100644 frontend/src/lib/components/DocumentCard.svelte create mode 100644 frontend/src/lib/components/FormatIcon.svelte create mode 100644 frontend/src/lib/components/TagPill.svelte diff --git a/frontend/src/lib/components/DocumentCard.svelte b/frontend/src/lib/components/DocumentCard.svelte new file mode 100644 index 0000000..274d636 --- /dev/null +++ b/frontend/src/lib/components/DocumentCard.svelte @@ -0,0 +1,79 @@ + + + + +
+ +
+ + +
+ +

+ {doc.title || '제목 없음'} +

+ + + {#if doc.ai_summary} +

{doc.ai_summary.slice(0, 100)}

+ {/if} + + +
+ {#if showDomain && doc.ai_domain} + + {doc.ai_domain.replace('Knowledge/', '')}{doc.ai_sub_group ? ` / ${doc.ai_sub_group}` : ''} + + {/if} + {#if doc.ai_tags?.length} +
+ {#each doc.ai_tags.slice(0, 3) as tag} + + {/each} +
+ {/if} +
+
+ + +
+ {#if doc.score !== undefined} + {(doc.score * 100).toFixed(0)}% + {/if} + {#if doc.data_origin} + + {doc.data_origin} + + {/if} + {formatDate(doc.created_at)} + {#if doc.file_size} + {formatSize(doc.file_size)} + {/if} +
+
diff --git a/frontend/src/lib/components/FormatIcon.svelte b/frontend/src/lib/components/FormatIcon.svelte new file mode 100644 index 0000000..a23e724 --- /dev/null +++ b/frontend/src/lib/components/FormatIcon.svelte @@ -0,0 +1,30 @@ + + + diff --git a/frontend/src/lib/components/TagPill.svelte b/frontend/src/lib/components/TagPill.svelte new file mode 100644 index 0000000..8c401d3 --- /dev/null +++ b/frontend/src/lib/components/TagPill.svelte @@ -0,0 +1,40 @@ + + +{#if clickable} + +{:else} + + {tag} + +{/if} diff --git a/frontend/src/routes/documents/+page.svelte b/frontend/src/routes/documents/+page.svelte index 3ff06fb..89dc07d 100644 --- a/frontend/src/routes/documents/+page.svelte +++ b/frontend/src/routes/documents/+page.svelte @@ -3,6 +3,7 @@ import { goto } from '$app/navigation'; import { api } from '$lib/api'; import { addToast } from '$lib/stores/ui'; + import DocumentCard from '$lib/components/DocumentCard.svelte'; let documents = $state([]); let total = $state(0); @@ -182,36 +183,7 @@ {:else}