diff --git a/src/features/tech-log/presentation/public/components/topic-reasoning-path.tsx b/src/features/tech-log/presentation/public/components/topic-reasoning-path.tsx index 630141d..a68f35c 100644 --- a/src/features/tech-log/presentation/public/components/topic-reasoning-path.tsx +++ b/src/features/tech-log/presentation/public/components/topic-reasoning-path.tsx @@ -22,12 +22,19 @@ import { DOCUMENT_KIND_LABELS } from "../../shared/document-kind-labels.ts"; */ const REASONING_ORDER: ReadonlyArray = ["CONCEPT", "CASE", "REFERENCE"]; -/** 흐름에 오른 기록. 아래 목록이 같은 편을 다시 그리지 않도록 경로를 함께 준다. */ +/** + * 흐름에 오른 기록. 아래 목록이 같은 편을 다시 그리지 않도록 부르는 쪽도 이 함수를 쓴다. + * + *

한 칸짜리는 흐름이 아니므로 빈 목록이다. 이 판단을 화면 안에 두었더니 기록이 하나뿐인 + * 주제에서 그 하나가 통째로 사라졌다 — 흐름은 그리지 않으면서 목록은 "흐름에 올랐다"며 빼고 + * 있었다. 그리는 쪽과 빼는 쪽이 같은 값을 봐야 한다. + */ export function reasoningSteps(records: ReadonlyArray) { - return REASONING_ORDER.flatMap((kind) => { + const steps = REASONING_ORDER.flatMap((kind) => { const first = records.find((record) => record.kind === kind); return first ? [first] : []; }); + return steps.length < 2 ? [] : steps; } export function TopicReasoningPath({ @@ -38,8 +45,7 @@ export function TopicReasoningPath({ headingId: string; }) { const steps = reasoningSteps(records); - /* 한 칸짜리는 흐름이 아니다. 그때는 아래 목록이 이미 같은 것을 말한다. */ - if (steps.length < 2) return null; + if (steps.length === 0) return null; return (

diff --git a/src/features/tech-log/presentation/styles/globals.css b/src/features/tech-log/presentation/styles/globals.css index 55cafd2..bbae0ab 100644 --- a/src/features/tech-log/presentation/styles/globals.css +++ b/src/features/tech-log/presentation/styles/globals.css @@ -504,19 +504,35 @@ a { text-transform: uppercase; } -.home-now__items > li > a { - font-size: 17px; - font-weight: 620; - line-height: 1.5; -} - +/* + 옆의 두 칸은 훑는 자리다. 작성자가 쓴 요약은 문단 여럿일 수 있어, 그대로 두면 「한눈에」를 + 말하면서 화면 두 개를 차지한다 — 목록 카드와 같은 규칙으로 세 줄에서 자른다. 잘리는 것은 + 보이는 것뿐이고 읽어 주는 기계에는 전문이 남는다. +*/ .home-now__items > li > p { + display: -webkit-box; + overflow: hidden; margin: 9px 0 0; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; + line-clamp: 3; color: var(--ink-soft); font-size: 14px; line-height: 1.65; } +/* 결정문은 한 문장이 길 수 있다. 제목 자리도 같은 규칙으로 막는다. */ +.home-now__items > li > a { + display: -webkit-box; + overflow: hidden; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; + line-clamp: 3; + font-size: 17px; + font-weight: 620; + line-height: 1.5; +} + /* 홈의 입구. 조사는 전부 어느 프로젝트에서 나온다. */ .home-projects { padding-top: 112px; @@ -596,6 +612,7 @@ a { } .context-flow__copy > p { + max-width: 760px; margin: 8px 0 0; color: var(--ink-soft); font-size: 14px; @@ -2290,7 +2307,11 @@ dialog::backdrop { .project-status-grid dt { color: var(--faint); font-size: 11px; } .project-status-grid dd { margin: 5px 0 0; font-size: 14px; font-weight: 590; } .project-topics h2 { margin: 11px 0 0; font-size: 28px; font-weight: 650; letter-spacing: -0.035em; } -.project-stat-links { border-top: 1px solid var(--line-strong); } +/* + 세 목록으로 가는 줄. 한때 「여기서부터 읽으면 됩니다」 옆 좁은 칸에 세로로 서 있었고, 그 + 기록 목록을 내리면서 폭 전체를 쓰게 됐다 — 세로로 두면 한 줄에 74px 짜리 빈 칸이 셋 생긴다. +*/ +.project-stat-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; margin-top: 66px; border-top: 1px solid var(--line-strong); } .project-stat-links > a { display: grid; min-height: 74px; grid-template-columns: 45px 1fr; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); } .project-stat-links strong { font-family: "IBM Plex Mono", monospace; font-size: 19px; } .project-stat-links span { color: var(--muted); font-size: 14px; } @@ -2342,7 +2363,7 @@ dialog::backdrop { .project-status-grid > div, .project-status-grid > div + div { padding: 17px 0; border-left: 0; } .project-status-grid > div + div { border-top: 1px solid var(--line); } - .project-stat-links { margin-top: 30px; } + .project-stat-links { grid-template-columns: minmax(0, 1fr); margin-top: 34px; } .project-decision-list { margin-top: 55px; } .project-decision-list h2 { font-size: 27px; } .project-decision-list article > section { display: block; } diff --git a/tests/features/tech-log/public-document-screens.test.tsx b/tests/features/tech-log/public-document-screens.test.tsx index cd470da..72a6fc6 100644 --- a/tests/features/tech-log/public-document-screens.test.tsx +++ b/tests/features/tech-log/public-document-screens.test.tsx @@ -395,6 +395,23 @@ describe("TechLog topics and Public not-found routing", () => { ).not.toBeInTheDocument(); }); + /* + 흐름이 서지 않는 주제에서도 기록은 남아야 한다. 흐름을 그릴지 말지를 화면 안에서만 판단했을 + 때, 기록이 하나뿐인 주제는 흐름도 없고 목록도 "흐름에 올랐다" 며 그 하나를 빼서 화면에 + 아무것도 남지 않았다. + */ + it("keeps the only record of a single-record topic visible", async () => { + const { container } = await renderDocumentRoute("TECH_LOG_TOPIC", "/topics/redis"); + + expect(container.querySelectorAll(".context-flow").length).toBe(0); + expect( + Array.from( + container.querySelectorAll(".public-record-list > li > a"), + (link) => link.getAttribute("href"), + ), + ).toContain("/cases/redis-adapter-ttl-boundary"); + }); + it("keeps JPA topic records in canonical reasoning order", async () => { const { container } = await renderDocumentRoute("TECH_LOG_TOPIC", "/topics/jpa");