From db832289920ca074fdb56d3866f30da6ea646908 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Tue, 1 Sep 2026 18:40:08 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=80=8C=EB=A8=BC=EC=A0=80=20=EC=9D=BD?= =?UTF-8?q?=EC=9D=84=20=EA=B2=83=E3=80=8D=EC=9D=84=20=EC=A2=85=EB=A5=98?= =?UTF-8?q?=EB=A7=88=EB=8B=A4=20=ED=95=9C=20=ED=8E=B8=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=A4=84=EC=9D=B4=EA=B3=A0=20=EB=82=98=EB=A8=B8=EC=A7=80?= =?UTF-8?q?=EB=8F=84=20=EA=B0=99=EC=9D=80=20=EC=88=9C=EC=84=9C=EB=A1=9C=20?= =?UTF-8?q?=EB=91=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 종류마다 두 편씩 담았더니 일곱 줄이 되어, 순서가 아니라 또 하나의 목록이 됐다. 이 자리가 답하는 것은 무엇이 있나가 아니라 어디서부터 읽나다. 아래 나머지 목록도 같은 순서를 따른다 — 한 화면에서 순서가 두 번 바뀌면 순서로 읽히지 않는다. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_011nAjrqNHGPNngN4aUbcyvJ --- .../presentation/public/pages/topic-page.tsx | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/src/features/tech-log/presentation/public/pages/topic-page.tsx b/src/features/tech-log/presentation/public/pages/topic-page.tsx index db6fb47..d53780f 100644 --- a/src/features/tech-log/presentation/public/pages/topic-page.tsx +++ b/src/features/tech-log/presentation/public/pages/topic-page.tsx @@ -27,20 +27,30 @@ import { usePublicContent } from "../use-public-content.tsx"; */ const READING_ORDER: ReadonlyArray = ["CONCEPT", "CASE", "REFERENCE", "QUESTION"]; -/** 한 종류에서 앞의 몇 편까지. 넘으면 순서가 아니라 목록이 된다. */ -const PER_KIND = 2; - +/** + * 종류마다 한 편씩. 둘씩 담아 봤더니 일곱 줄이 되어 순서가 아니라 또 하나의 목록이 됐다 — + * 여기가 답하는 것은 「무엇이 있나」가 아니라 「어디서부터 읽나」다. + */ function firstReads(records: ReadonlyArray) { - return READING_ORDER.flatMap((kind) => - records - .filter((record) => record.kind === kind) - .slice(0, PER_KIND) - .map((record) => ({ - label: DOCUMENT_KIND_LABELS[record.kind], - title: record.title, - path: record.path, - summary: record.summary, - })), + return READING_ORDER.flatMap((kind) => { + const first = records.find((record) => record.kind === kind); + return first + ? [ + { + label: DOCUMENT_KIND_LABELS[first.kind], + title: first.title, + path: first.path, + summary: first.summary, + }, + ] + : []; + }); +} + +/** 나머지 목록도 같은 순서를 따른다 — 한 화면에서 순서가 두 번 바뀌면 순서로 읽히지 않는다. */ +function byReadingOrder(records: ReadonlyArray) { + return [...records].sort( + (left, right) => READING_ORDER.indexOf(left.kind) - READING_ORDER.indexOf(right.kind), ); } @@ -70,7 +80,7 @@ export function TopicPage() { const axisLabel = topic.variantLabel.trim() || "접근"; const readingOrder = firstReads(records); const readingPaths = new Set(readingOrder.map((entry) => entry.path)); - const rest = records.filter((record) => !readingPaths.has(record.path)); + const rest = byReadingOrder(records.filter((record) => !readingPaths.has(record.path))); return (