From b9d0585bc6132cb17871725de3abb1932256b04c Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 16 Sep 2026 15:29:16 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=B0=94=ED=83=95=ED=99=94=EB=A9=B4=20?= =?UTF-8?q?=EB=94=94=EC=9E=90=EC=9D=B8=20=EC=88=98=EC=A0=95=EB=B3=B8?= =?UTF-8?q?=EC=9D=84=20=EC=96=B9=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `~/Desktop/tech-log-frontend` 의 재디자인 결과물(DESIGN_REVISION.md)을 그대로 가져왔다. 바뀐 것은 소스 일곱과 검사 둘이고, 나머지 파일은 이 저장소의 것과 같았다. 공개 화면 — 홈을 큰 빈 히어로 + 평평한 줄 목록에서 실제 조사 경로로 흐르게 고쳤고, 프로젝트·주제·현재·관련 맥락을 본문 흐름 밖의 고정 레일로 옮겼다(좁은 화면은 접이식 유지). Case·Concept 장문을 읽기 폭 + 맥락/목차 레일 한 짜임으로 통일했고, Question·Reference 도 같은 짜임으로 다시 세웠다. Case 의 검증 조건은 곁다리 details 줄이 아니라 의도된 근거 공개로 바꿨다. 제목·본문 폭과 프로젝트 목록 밀도를 줄이고 상태 격자를 반응형으로 만들었다. Studio — Asset Picker 를 파일 이름·미리보기·치수·사용 수를 가진 검색 가능한 줄로 다시 만들었다. 지우는 동작은 Asset 화면에 남긴다. 내가 넣었던 개념 흐름 지도(`MechanismMap`)는 이 수정본이 뺐다 — 소제목을 알약으로 늘어놓은 근사치라 절 사이에 태그를 붙여 놓은 것처럼 보인다는 판단이다. 컴포넌트와 CSS 는 아직 남아 있으나 어디서도 부르지 않는다. 수정본은 Node 22 에서 검증됐다고 적혀 있어 이 저장소가 선언한 Node 24 로 다시 돌렸다: check:types · lint · test:unit(1829) · test:component(152) · test:tech-log(422) 전부 통과. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_015c8cBFUaVr7KLVUx6ujz7D --- .../components/home-investigation-path.tsx | 68 +- .../presentation/public/pages/home-page.tsx | 5 + .../public-render/public-record-renderer.tsx | 378 +++++---- .../shared/public-render/rail-context.tsx | 95 ++- .../studio/components/asset-picker.tsx | 110 ++- .../tech-log/presentation/styles/globals.css | 755 ++++++++++++++++++ .../presentation/styles/studio-editor.css | 158 ++++ .../features/tech-log/public-render.test.tsx | 7 +- .../features/tech-log/style-contract.test.ts | 5 +- 9 files changed, 1262 insertions(+), 319 deletions(-) diff --git a/src/features/tech-log/presentation/public/components/home-investigation-path.tsx b/src/features/tech-log/presentation/public/components/home-investigation-path.tsx index 0bbbd35..ac97188 100644 --- a/src/features/tech-log/presentation/public/components/home-investigation-path.tsx +++ b/src/features/tech-log/presentation/public/components/home-investigation-path.tsx @@ -2,29 +2,15 @@ import { Link } from "react-router-dom"; import type { LatestEntry } from "./latest-index.tsx"; -/** 한 줄에 펴 두는 기록 수. 넘으면 길이 아니라 또 하나의 목록이 된다. */ const PATH_SIZE = 4; /** - * 이 사이트를 어떻게 쓰는지를 실제 기록 하나로 가르친다. + * 홈에서 실제 프로젝트 하나를 이용해 이 사이트의 읽는 방식을 보여 준다. * - *

홈의 첫 문장은 글 쓰는 태도를 말했다 — "문제를 재현하고 검증해 정리합니다". 맞는 말이지만 - * 처음 온 사람이 알아야 하는 것은 태도가 아니라 길이다. 이 사이트에서 기록은 한 편으로 - * 끝나지 않고 프로젝트 안의 주제에 속하고, 주제 안에서 서로 이어진다. 그 구조를 설명하는 문장보다 - * 실제 사슬 하나를 보여 주는 편이 빠르다. - * - *

고르는 방법은 "최근 기록이 가장 많이 모인 프로젝트"다. 손으로 고른 예시를 코드에 적어 두면 - * 그 기록을 지우는 순간 홈이 죽은 링크를 가리킨다 — 이 저장소에서 주제 셋을 코드에 적어 두었다가 - * 같은 일을 겪었다. - * - *

주제가 아니라 프로젝트로 묶는다. 한 주제 안에 아직 기록이 하나씩뿐인 동안에는 주제로 묶으면 - * 이을 것이 없어 이 구역이 통째로 사라진다 — 실제로 그랬다. 조사는 프로젝트 안에서 여러 주제를 - * 오가며 자라므로, 프로젝트가 사슬의 자연스러운 단위다. - * - *

이을 것이 없으면 그리지 않는다. 한 편짜리 길은 길이 아니다. + * 단순 행 목록이 아니라 하나의 investigation sequence로 보이게 한다. 기록 종류와 주제는 + * 보조 정보이고, 제목과 짧은 요약이 단계의 본문이다. */ export function HomeInvestigationPath({ entries }: { entries: ReadonlyArray }) { - /* 기록만 센다. 프로젝트 활동과 릴리스는 기록이 아니라 일어난 일이라 사슬의 마디가 아니다. */ const records = entries.filter((entry) => entry.typeState !== undefined && entry.topic); const byProject = new Map(); @@ -45,39 +31,43 @@ export function HomeInvestigationPath({ entries }: { entries: ReadonlyArray -

- 이렇게 이어집니다 -

-
    -
  1. - 프로젝트 - {head.project} -
  2. -
- {/* 기록마다 어느 주제에 속하는지 함께 적는다 — 하나의 조사가 여러 주제를 오간다는 것이 - 이 사슬이 보여 주려는 것이다. */} - + ); } - -/** 요약의 첫 문장. 한 줄이면 충분하고, 문단째 넣으면 길이 다시 목록이 된다. */ function firstSentence(summary: string): string { const line = summary.split(/\n+/u)[0]?.trim() ?? ""; const stop = line.search(/[.。]\s|다\s/u); diff --git a/src/features/tech-log/presentation/public/pages/home-page.tsx b/src/features/tech-log/presentation/public/pages/home-page.tsx index 2ca6a48..b125cfe 100644 --- a/src/features/tech-log/presentation/public/pages/home-page.tsx +++ b/src/features/tech-log/presentation/public/pages/home-page.tsx @@ -200,8 +200,13 @@ export function HomePage() { return (
+

Engineering knowledge, in context

{publicSiteConfig.brandTitle}

{publicSiteConfig.identityStatement}

+
+ 프로젝트 둘러보기 + 기록 탐색 +
{/* diff --git a/src/features/tech-log/presentation/shared/public-render/public-record-renderer.tsx b/src/features/tech-log/presentation/shared/public-render/public-record-renderer.tsx index ab3669e..8921a5b 100644 --- a/src/features/tech-log/presentation/shared/public-render/public-record-renderer.tsx +++ b/src/features/tech-log/presentation/shared/public-render/public-record-renderer.tsx @@ -10,7 +10,6 @@ import type { import { CaseBodyRenderer } from "./case-body-renderer.tsx"; import { ContextNavigator } from "./context-navigator.tsx"; import { DocumentToc } from "./document-toc.tsx"; -import { MechanismMap } from "./mechanism-map.tsx"; import { RailContext } from "./rail-context.tsx"; import { PublicDocumentRelations, @@ -143,6 +142,32 @@ function publicRelations( } +function StructuredRecordRail({ + model, + sections, +}: { + model: PublicRenderModelBase; + sections: ReadonlyArray<{ id: string; label: string }>; +}) { + return ( + + ); +} + + /** * Case 한 편. * @@ -210,7 +235,10 @@ function CaseDocument({ 접어 둔다. 무엇이 들었는지는 손잡이가 말하므로 펴 보지 않아도 있다는 것은 안다. */}
- 실험 조건 · 검증 환경과 데이터 + + 검증 환경 + 이 결과를 다시 확인할 때 필요한 조건과 데이터 +
검증 환경
@@ -314,12 +342,6 @@ function ConceptDocument({ - {/* - 개념은 여느 긴 글과 달리 "어디를 지나는가"가 먼저 보여야 한다. 본문의 소제목이 곧 그 - 계층이므로 손으로 적지 않고 거기서 만든다 — 손으로 적게 하면 본문을 고칠 때 이 줄만 낡는다. - */} - -
@@ -443,85 +465,93 @@ function ReferenceDocument({ resolvePublishedLabel: ResolvePublishedLabel; }) { const Root = embedded ? "div" : "main"; + const railSections = [ + { id: "purpose-title", label: "이 기준을 쓰는 이유" }, + ...(model.applyWhen.length > 0 || model.exceptions.length > 0 + ? [{ id: "applicability-title", label: "언제 쓰는 기준인가" }] + : []), + { id: "rules-title", label: "판단 기준" }, + { id: "examples-title", label: "예시" }, + ]; return ( - +
+ +
-
-

Purpose

-

이 기준을 쓰는 이유

- -
- {/* - 이 기준이 어디에 걸리고 어디에 안 걸리는지를 먼저 말한다. - - 「적용할 때」와 「예외와 주의」는 오래 판단 기준 아래에 있었다. 그러면 읽는 사람은 기준 - 여럿을 다 읽은 뒤에야 "이건 내 경우가 아니었다"를 알게 된다 — 긴 문단을 다 읽히고 나서 - 해당 없음을 알리는 셈이다. 두 목록을 위로 올려 나란히 둔다. - */} - {model.applyWhen.length > 0 || model.exceptions.length > 0 ? ( -
-

언제 쓰는 기준인가

-
- {model.applyWhen.length > 0 ? ( +
+
+
+

Purpose

+

이 기준을 쓰는 이유

+ +
+ {model.applyWhen.length > 0 || model.exceptions.length > 0 ? ( +
+

언제 쓰는 기준인가

-

이럴 때 씁니다

-
    - {[...model.applyWhen] - .sort((left, right) => left.order - right.order) - .map((item) =>
  • )} -
-
- ) : null} - {model.exceptions.length > 0 ? ( -
-

이럴 때는 다릅니다

-
    - {[...model.exceptions] - .sort((left, right) => left.order - right.order) - .map((item) =>
  • )} -
-
- ) : null} -
-
- ) : null} -
-
-

판단 기준

-
    - {[...model.rules] - .sort((left, right) => left.order - right.order) - .map((rule, index) => ( -
  1. - {String(index + 1).padStart(2, "0")} + {model.applyWhen.length > 0 ? (
    -

    {rule.title}

    - +

    이럴 때 씁니다

    +
      + {[...model.applyWhen] + .sort((left, right) => left.order - right.order) + .map((item) =>
    • )} +
    -
  2. - ))} -
-
-
-

예시

-
    - {[...model.examples] - .sort((left, right) => left.order - right.order) - .map((item) =>
  • )} -
-

- 마지막 검증 {displayDate(model.verifiedOn)} -

-
-
- + ) : null} + {model.exceptions.length > 0 ? ( +
+

이럴 때는 다릅니다

+
    + {[...model.exceptions] + .sort((left, right) => left.order - right.order) + .map((item) =>
  • )} +
+
+ ) : null} +
+ + ) : null} +
+
+

판단 기준

+
    + {[...model.rules] + .sort((left, right) => left.order - right.order) + .map((rule, index) => ( +
  1. + {String(index + 1).padStart(2, "0")} +
    +

    {rule.title}

    + +
    +
  2. + ))} +
+
+
+

예시

+
    + {[...model.examples] + .sort((left, right) => left.order - right.order) + .map((item) =>
  • )} +
+

+ 마지막 검증 {displayDate(model.verifiedOn)} +

+
+
+ +
+ + ); } @@ -554,109 +584,111 @@ function QuestionDocument({ }) { const resolutionPath = model.resolution?.evidenceTarget.publicPath; const Root = embedded ? "div" : "main"; + const railSections = [ + { id: "facts-title", label: "확인한 사실" }, + { id: "assumptions-title", label: "가정" }, + { id: "unknowns-title", label: "남은 미지수" }, + { id: "constraints-title", label: "제약" }, + { id: "options-title", label: "검토한 선택지" }, + { id: "next-validation-title", label: "다음 검증" }, + ]; return ( - +
+ +
-

- {model.status} -

- {model.resolution ? ( - - ) : null} - {/* - 네 구역이 같은 제목+본문 모양이라, 긴 글을 훑을 때 「확인한 사실」과 「가정」이 눈으로 - 구분되지 않았다. 이 기록의 값어치는 무엇이 검증됐고 무엇이 아직 아닌지를 갈라 적는 - 데 있는데, 그 구분이 화면에서 사라져 있었다. - - 색을 다섯 개 칠하지 않는다. 표식 하나와 왼쪽 선만 다르게 둔다 — 나머지 화면이 카드도 - 채도 높은 색도 쓰지 않는다. - */} -
-
-

확인한 사실

- -
-
-

가정

- -
-
-

남은 미지수

- -
-
-

제약

- -
-
-

검토한 선택지

-
    - {[...model.options] - .sort((left, right) => left.order - right.order) - .map((option) => ( -
  1. -

    {option.title}

    - -
  2. - ))} -
-
-
-

Next

-

다음 검증

- {/* - 「무엇을 확인할 것인가」는 있었지만 「왜 그것이 다음인가」가 없었다. 이 기록이 열려 - 있는 이유는 남은 미지수이므로, 그 미지수를 여기 다시 세워 둘을 잇는다 — 작성자가 - 따로 적지 않아도 사슬이 보인다. - */} - {model.unknowns.length > 0 ? ( -
-

왜 다음인가

-
    - {[...model.unknowns] +
    +
    +

    + {model.status} +

    + {model.resolution ? ( + + ) : null} +
    +
    +

    확인한 사실

    + +
    +
    +

    가정

    + +
    +
    +

    남은 미지수

    + +
    +
    +

    제약

    + +
    +
    +

    검토한 선택지

    +
      + {[...model.options] .sort((left, right) => left.order - right.order) - .slice(0, 2) - .map((item) => ( -
    1. - + .map((option) => ( +
    2. +

      {option.title}

      +
    3. ))} -
-
- ) : null} -
-

어떻게 확인하나

- -
-
-
- + + +
+

Next

+

다음 검증

+ {model.unknowns.length > 0 ? ( +
+

왜 다음인가

+
    + {[...model.unknowns] + .sort((left, right) => left.order - right.order) + .slice(0, 2) + .map((item) => ( +
  • + +
  • + ))} +
+
+ ) : null} +
+

어떻게 확인하나

+ +
+
+ + + + +
); } diff --git a/src/features/tech-log/presentation/shared/public-render/rail-context.tsx b/src/features/tech-log/presentation/shared/public-render/rail-context.tsx index 135123f..2353f46 100644 --- a/src/features/tech-log/presentation/shared/public-render/rail-context.tsx +++ b/src/features/tech-log/presentation/shared/public-render/rail-context.tsx @@ -7,60 +7,67 @@ import { DOCUMENT_KIND_LABELS } from "../document-kind-labels.ts"; type PublicRenderModelBase = components["schemas"]["PublicRenderModelBase"]; /** - * 레일에 붙어 따라오는 「지금 어디인가」. + * 긴 글을 읽는 동안 유지되는 조사 맥락. * - *

제목 아래의 맥락 덩어리는 한 번 읽고 지나간다. 본문이 길면 화면을 몇 번 넘긴 뒤에는 이 - * 기록이 어느 프로젝트의 어느 주제였는지가 화면에서 사라진다 — 레일에는 「이 글에서」만 남아 - * 이 글 안의 위치는 알아도 조사 안의 위치는 알 수 없었다. - * - *

그래서 레일의 아래 칸에 프로젝트·주제·종류만 짧게 붙여 둔다. 관계 목록은 여기 두지 않는다 — - * 그것은 제목 아래에 이미 있고, 같은 목록이 한 화면에 두 번 있으면 목록이 아니라 소음이다. + * 본문 사이에 별도의 관계 표를 끼우지 않고, reading rail이 현재 위치와 관련 기록을 맡는다. + * 관계 데이터에는 앞/뒤 의미가 따로 없으므로 임의로 "이전/다음"이라 부르지 않는다. */ export function RailContext({ model }: { model: PublicRenderModelBase }) { const topic = model.topic.label ? model.topic : null; - const reachable = [...model.relations] + const related = [...model.relations] .filter((relation) => resolvesToPublicRoute(relation.publicPath ?? "")) - .sort((left, right) => left.order - right.order); - const path = [ - reachable[0] ? { ...reachable[0], mark: "다음" } : null, - reachable.length > 1 ? { ...reachable.at(-1)!, mark: "앞" } : null, - ].filter((step) => step !== null); - if (!model.project && !topic && path.length === 0) return null; + .sort((left, right) => left.order - right.order) + .slice(0, 3); + + if (!model.project && !topic && related.length === 0) return null; return ( -