From 74e29e510ee2ea7af825695ccc7edcec5b097d4a Mon Sep 17 00:00:00 2001 From: hyungi Date: Sat, 13 Jun 2026 15:53:34 +0900 Subject: [PATCH] =?UTF-8?q?feat(docpage):=20D3=20=EC=83=81=EC=84=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EB=A5=BC=20=ED=99=95=EC=A0=95=20?= =?UTF-8?q?=EC=8B=9C=EC=95=88=20=EA=B7=B8=EB=8C=80=EB=A1=9C=20=EC=9E=AC?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 기존 컴포넌트 재사용/배치변경(불충실)을 폐기하고 deepened 시안을 충실히 구현: - 좌 절 트리: 유형 색칩(정의/절차/요건)·신뢰도 dot·저신뢰 경고·레벨 들여쓰기·클릭=절 선택 - 중 절 집중 뷰: breadcrumb + 제목 + 유형 배지 + 신뢰도 막대 + 절 요약 인용 + 절 본문 (md_content 를 char_start 로 슬라이스) + 이전/다음 절 - 우 슬림 레일: TL;DR · 핵심점 · 심층(DEEP) · 불일치 · 분류 · 태그 (읽기) + 정보/관리 접이(편집 보존) - 절 없음 fallback: 전체 본문/뷰어 + 레일 (D3 빈 절 graceful) - 모바일: 본문(절 집중) 메인 + 절구조/인사이트 접이 svelte-check 0. 시안=comparisons/2026-06-13-ds-docpage-d3-deepened.html. Co-Authored-By: Claude Fable 5 --- .../src/routes/documents/[id]/+page.svelte | 781 +++++++++--------- 1 file changed, 369 insertions(+), 412 deletions(-) diff --git a/frontend/src/routes/documents/[id]/+page.svelte b/frontend/src/routes/documents/[id]/+page.svelte index 1016377..e6f8746 100644 --- a/frontend/src/routes/documents/[id]/+page.svelte +++ b/frontend/src/routes/documents/[id]/+page.svelte @@ -1,19 +1,17 @@ -
+ +{#snippet treeNav()} +
+
+ 절 구조 + {sections.length}절 +
+ +
+ 정의 + 절차 + 요건 +
+
    + {#each sections as s (s.chunk_id)} + {@const tm = typeMeta(s.section_type)} + {@const active = s.chunk_id === selectedSection?.chunk_id} + {@const low = isLowConf(s.confidence)} +
  • + +
  • + {/each} +
+ {#if quality} +
+ 추출 품질 + {#if quality.headings != null}· 제목 {quality.headings}{/if} + {#if quality.tables != null}· 표 {quality.tables}{/if} + {#if quality.images != null}· 이미지 {quality.images}{/if} +
+ {/if} +
+{/snippet} + + +{#snippet rail()} +
+ + {#if doc.ai_tldr || doc.ai_summary} +
+
TL;DR
+

{doc.ai_tldr || doc.ai_summary}

+
+ {/if} + + {#if doc.ai_bullets && doc.ai_bullets.length} +
+
핵심점
+
    + {#each doc.ai_bullets as b} +
  • ·{b}
  • + {/each} +
+
+ {/if} + + {#if doc.ai_detail_summary} +
+
+ 심층 + {#if doc.ai_analysis_tier === 'deep'}DEEP{/if} +
+

{doc.ai_detail_summary}

+
+ {/if} + + {#if doc.ai_inconsistencies && doc.ai_inconsistencies.length} +
+
불일치 {doc.ai_inconsistencies.length}
+
    + {#each doc.ai_inconsistencies as inc} +
  • · {typeof inc === 'string' ? inc : inc.desc || inc.kind}
  • + {/each} +
+
+ {/if} + + {#if doc.ai_domain} +
+
분류
+
+ {domainLabel(doc.ai_domain)}{#if doc.ai_sub_group} · {doc.ai_sub_group}{/if} +
+ {#if doc.ai_confidence != null}신뢰도 {doc.ai_confidence.toFixed(2)}{/if} + {#if doc.ai_analysis_tier}{doc.ai_analysis_tier}{/if} +
+
+
+ {/if} + + {#if doc.ai_tags && doc.ai_tags.length} +
+
태그
+
+ {#each doc.ai_tags as t}{t}{/each} +
+
+ {/if} + +
+
관련 문서
+

벡터 유사도 기반 — 준비 중

+
+ +
+ + 문서 정보 + +
+ {#if doc.category === 'library'}{/if} + + +
+
+ +
+ + 관리 · 분류 편집 + +
+ + + + + +
+
+
+
+{/snippet} + +
문서 @@ -244,320 +330,191 @@
{#if loading} -
- -
+ {:else if error === 'not_found'} - + {:else if error === 'network'} - + {:else if doc} -
- {#if hasSections} - - - {/if} - - -
- {#if hasSections} - -
- 절 목차 ({sections.length}) - -
- {/if} - -
- {#if doc.edit_url} - - {/if} - - {#if doc.preview_status === 'ready'} - - {/if} - + +
+
+
+
+ {#if doc.ai_domain} + + {domainLabel(doc.ai_domain)} + + {/if} + {#if doc.ai_sub_group}{doc.ai_sub_group}{/if} + {doc.file_format}{#if canShowMarkdown}→MD{/if} + {#if doc.ai_analysis_tier === 'deep'}tier DEEP{/if} + {#if doc.ai_confidence != null}신뢰도 {doc.ai_confidence.toFixed(2)}{/if} +
+

{doc.title}

+
+
+ {#if doc.edit_url}{/if} + + {#if doc.category === 'library'} - + + {/if} +
+
+
+ + {#if useSectionView} + + +
+ 절 구조 ({sections.length}절) +
{@render treeNav()}
+
+ +
+ + + + +
+ {#if selectedSection} + {@const tm = typeMeta(selectedSection.section_type)} + +
+ {doc.title} + {#each pathSegments(selectedSection.heading_path) as seg}/{seg}{/each} +
+ +
+

{secTitle(selectedSection)}

+ {#if tm.label}{tm.label}{/if} +
+ + {#if selectedSection.confidence != null} +
+ 신뢰도 + + + + {selectedSection.confidence.toFixed(2)} +
+ {/if} + + {#if isLowConf(selectedSection.confidence)} +
+ ! + 저신뢰 절 — 표·수식 추출이 불완전할 수 있습니다. 정확한 내용은 원본을 확인하세요. +
+ {/if} + + {#if selectedSection.summary} +
+
절 요약
+

{selectedSection.summary}

+
+ {/if} + + {#if selectedBodyHtml} +
{@html selectedBodyHtml}
+ {:else} +

이 절의 본문은 추출되지 않았습니다. 헤더의 '원본'에서 확인하세요.

+ {/if} + +
+ + {selIdx + 1} / {sections.length} + +
{/if}
- - + + +
+ {:else} + +
+
+ {#if !hasSections && canShowMarkdown} +

이 문서는 절 분석이 없습니다 (짧은 문서이거나 분석 전) — 전체 본문으로 표시합니다.

+ {/if} {#if viewerType === 'markdown' || viewerType === 'hwp-markdown'} - + {:else if viewerType === 'pdf'}
- + {#if canShowMarkdown} - - + + {/if}
{#if pdfViewMode === 'markdown' && canShowMarkdown} - + {:else} - + {/if} {:else if viewerType === 'image'} - {doc.title} + {doc.title} {:else if viewerType === 'synology'} - - + + {:else if viewerType === 'article'} -
-

{doc.title}

-
- 출처: {doc.source_channel} - · - - {new Date(doc.created_at).toLocaleDateString('ko-KR', { - year: 'numeric', - month: 'short', - day: 'numeric', - })} - -
- {#if doc.md_content || doc.extracted_text} - - - {/if} - {#if doc.edit_url} - - {/if} -
+ {#if doc.md_content || doc.extracted_text} + + {/if} + {#if doc.edit_url}
{/if} {:else} - + {/if} - - - - {#if noteOpen && doc.category === 'library' && noteLoaded} - -
- saveNote(strokes)} - /> -
-
- {/if} +
+
+ {/if} - - -
- - + {#if doc.category === 'library'}
- - - + - - +
-
{/if} {/if}