From db4450fe008ec4299f72bb643c0cd35ed5922f17 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Tue, 15 Sep 2026 20:20:43 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=B3=B8=EB=AC=B8=EC=9D=84=20=EC=9D=BD?= =?UTF-8?q?=EB=8A=94=20=EB=8F=99=EC=95=88=EC=97=90=EB=8F=84=20=EC=A1=B0?= =?UTF-8?q?=EC=82=AC=20=EC=95=88=EC=9D=98=20=EC=9C=84=EC=B9=98=EA=B0=80=20?= =?UTF-8?q?=EB=B3=B4=EC=9D=B8=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 레일에는 「이 글에서」만 있었다. 이 글 안의 위치는 알아도 이 조사 안의 위치는 알 수 없었고, 제목 아래의 맥락 덩어리는 화면을 몇 번 넘기면 사라진다. 레일 아래 칸에 프로젝트·주제·종류를 짧게 붙여 따라오게 한다. 관계 목록은 두지 않는다 — 제목 아래에 이미 있고, 같은 목록이 한 화면에 두 번 있으면 목록이 아니라 소음이다. 레일이 둘을 담게 되었으므로 이름도 갈랐다. 「이 글에서」와 「맥락」은 서로 다른 질문에 답한다. 작성자가 확대를 끈 도식도 좁은 화면에서는 확대할 수 있게 했다. 390px 화면에서 폭 1,200px 짜리 도식은 3분의 1 로 눌려 덩어리만 보이고 글자는 읽히지 않는다 — 설명하는 일을 하지 못한다. 기준은 치수다: 본문 폭(720px)보다 넓은 그림은 어디선가 반드시 줄어든다. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_015c8cBFUaVr7KLVUx6ujz7D --- .../shared/public-render/document-toc.tsx | 46 ++++++++++++------- .../shared/public-render/evidence-figure.tsx | 11 ++++- .../public-render/public-record-renderer.tsx | 19 ++++++-- .../shared/public-render/rail-context.tsx | 42 +++++++++++++++++ .../tech-log/presentation/styles/globals.css | 37 +++++++++++++++ .../tech-log/public-document-screens.test.tsx | 2 + .../features/tech-log/public-render.test.tsx | 13 ++++-- 7 files changed, 146 insertions(+), 24 deletions(-) create mode 100644 src/features/tech-log/presentation/shared/public-render/rail-context.tsx diff --git a/src/features/tech-log/presentation/shared/public-render/document-toc.tsx b/src/features/tech-log/presentation/shared/public-render/document-toc.tsx index e490e3c..ea1a5f2 100644 --- a/src/features/tech-log/presentation/shared/public-render/document-toc.tsx +++ b/src/features/tech-log/presentation/shared/public-render/document-toc.tsx @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState } from "react"; +import { useEffect, useRef, useState, type ReactNode } from "react"; type HeadingItem = { id: string; @@ -8,9 +8,14 @@ type HeadingItem = { type DocumentTocProps = { headings: ReadonlyArray; variant: "desktop" | "mobile"; + /** + * 데스크톱 레일의 아래 칸. 「이 글에서」와 「맥락」은 서로 다른 질문에 답한다 — 앞은 이 글의 + * 어디인지, 뒤는 이 조사의 어디인지다. 한 레일에 두되 마디를 갈라 둔다. + */ + context?: ReactNode; }; -export function DocumentToc({ headings, variant }: DocumentTocProps) { +export function DocumentToc({ headings, variant, context }: DocumentTocProps) { const [currentId, setCurrentId] = useState(headings[0]?.id ?? ""); const empty = headings.length === 0; const detailsRef = useRef(null); @@ -56,7 +61,7 @@ export function DocumentToc({ headings, variant }: DocumentTocProps) { 제목이 없는 문서에는 목차를 그리지 않는다. 예전에는 이 컴포넌트가 픽스처 문서 하나에서만 쓰여 빈 경우를 만날 일이 없었지만, 이제 모든 Case 가 지나므로 빈 레일이 남을 수 있다. */ - if (empty) return null; + if (empty && !(variant === "desktop" && context)) return null; if (variant === "mobile") { const current = @@ -86,20 +91,27 @@ export function DocumentToc({ headings, variant }: DocumentTocProps) { } return ( -