diff --git a/home-others.png b/home-others.png new file mode 100644 index 0000000..d812b29 Binary files /dev/null and b/home-others.png differ diff --git a/public/release-manifest.json b/public/release-manifest.json index 8518f76..5e828e3 100644 --- a/public/release-manifest.json +++ b/public/release-manifest.json @@ -38,28 +38,28 @@ }, "contractSet": { "setAlgorithm": "CA_CONTRACT_SET_V1", - "setDigest": "sha256:cb8c02d87ac373d46de335091e435400ae1374002da9a446ee203b02c1dd58ec", + "setDigest": "sha256:aa41ae707608d877c99542aa839b88a3dda60169402b7bacdff5176913a973f0", "packages": [ { "packageId": "@tech-log/management-contract", "version": "1.0.0", "digest": "sha256:61f8360cfb2e638c5d8c5557434b564e39cea517464c33cedcd1c5bf39a58aa8", "runtimeProtocolVersion": 1, - "sourceRevision": "b93d62a" + "sourceRevision": "559d04f" }, { "packageId": "@tech-log/public-contract", "version": "2.1.0", - "digest": "sha256:10b922715a4149f2dcf4d5925fb1d3e3e820a6d14d9e4a91d7a325027684280d", + "digest": "sha256:babb24ab85c5b92b2d8b9ad9aa10151430fd15aae84ca5318564468b3c9278ca", "runtimeProtocolVersion": 1, - "sourceRevision": "b93d62a" + "sourceRevision": "559d04f" }, { "packageId": "@tech-log/studio-contract", "version": "3.1.0", "digest": "sha256:d2bfbe0a12136f131ccb8c42f8868108ba8d0f0182b347f9b815316c343a970c", "runtimeProtocolVersion": 1, - "sourceRevision": "b93d62a" + "sourceRevision": "559d04f" } ] } diff --git a/src/features/tech-log/adapters/http/http-public-content-gateway.ts b/src/features/tech-log/adapters/http/http-public-content-gateway.ts index 44f8a41..259038d 100644 --- a/src/features/tech-log/adapters/http/http-public-content-gateway.ts +++ b/src/features/tech-log/adapters/http/http-public-content-gateway.ts @@ -448,6 +448,10 @@ export function createHttpPublicContentGateway( Object.freeze({ name: String(item.name ?? ""), slug: String(item.slug ?? ""), + thesis: String(item.thesis ?? ""), + description: String(item.description ?? ""), + variantLabel: String(item.variantLabel ?? ""), + variantCount: Number(item.variantCount ?? 0), recordCount: Number(item.recordCount ?? 0), }), ); diff --git a/src/features/tech-log/adapters/static/public-query.ts b/src/features/tech-log/adapters/static/public-query.ts index dbb2f29..7a1fed5 100644 --- a/src/features/tech-log/adapters/static/public-query.ts +++ b/src/features/tech-log/adapters/static/public-query.ts @@ -127,12 +127,27 @@ export function getProjectActivity(projectSlug: string): ProjectActivity[] { * 그린다)에도 맞는다. */ export function listTopics(): PublicTopic[] { - const counts = new Map(); + const counts = new Map(); for (const record of listRecords()) { if (!record.topic) continue; const existing = counts.get(record.topicSlug); - if (existing) existing.recordCount += 1; - else counts.set(record.topicSlug, { name: record.topic, slug: record.topicSlug, recordCount: 1 }); + if (existing) { + counts.set(record.topicSlug, { ...existing, recordCount: existing.recordCount + 1 }); + continue; + } + /* + 정적 자료에는 논지도 축도 없다 — 사람이 Studio 에서 쓰는 글이라 픽스처가 지어낼 수 없다. + 화면은 비면 그 줄을 그리지 않는다. + */ + counts.set(record.topicSlug, { + name: record.topic, + slug: record.topicSlug, + thesis: "", + description: "", + variantLabel: "", + variantCount: 0, + recordCount: 1, + }); } return [...counts.values()] .sort((left, right) => right.recordCount - left.recordCount || (left.name < right.name ? -1 : 1)) diff --git a/src/features/tech-log/application/ports/public-content-queries.ts b/src/features/tech-log/application/ports/public-content-queries.ts index e590038..4f14b2d 100644 --- a/src/features/tech-log/application/ports/public-content-queries.ts +++ b/src/features/tech-log/application/ports/public-content-queries.ts @@ -191,10 +191,16 @@ export type Release = { related: ReadonlyArray<{ title: string; path: string }>; }; -/** 계약 `TopicSummary`. 목록에 필요한 만큼만 옮긴다. */ +/** 계약 `TopicListItem`. 목록 화면이 쓰는 만큼만 옮긴다. */ export type PublicTopic = { name: string; slug: string; + /** 이 주제가 답하는 질문. 이름은 무엇에 대한 것인지만 말하고 무엇에 답하는지는 말하지 않는다. */ + thesis: string; + description: string; + /** 축의 이름. 비면 이 주제는 축을 쓰지 않는다. */ + variantLabel: string; + variantCount: number; recordCount: number; }; diff --git a/src/features/tech-log/contracts/management/canonical-source.json b/src/features/tech-log/contracts/management/canonical-source.json index 54e1939..eb3075e 100644 --- a/src/features/tech-log/contracts/management/canonical-source.json +++ b/src/features/tech-log/contracts/management/canonical-source.json @@ -2,7 +2,7 @@ "packageId": "@tech-log/management-contract", "version": "1.0.0", "digest": "sha256:61f8360cfb2e638c5d8c5557434b564e39cea517464c33cedcd1c5bf39a58aa8", - "sourceRevision": "b93d62a", + "sourceRevision": "559d04f", "operationIds": [ "createCaseDraft", "getCaseForEdit", diff --git a/src/features/tech-log/contracts/public/canonical-source.json b/src/features/tech-log/contracts/public/canonical-source.json index 27de2ec..0cad783 100644 --- a/src/features/tech-log/contracts/public/canonical-source.json +++ b/src/features/tech-log/contracts/public/canonical-source.json @@ -1,8 +1,8 @@ { "packageId": "@tech-log/public-contract", "version": "2.1.0", - "digest": "sha256:10b922715a4149f2dcf4d5925fb1d3e3e820a6d14d9e4a91d7a325027684280d", - "sourceRevision": "b93d62a", + "digest": "sha256:babb24ab85c5b92b2d8b9ad9aa10151430fd15aae84ca5318564468b3c9278ca", + "sourceRevision": "559d04f", "operationIds": [ "getPublicSite", "getPublicHome", diff --git a/src/features/tech-log/contracts/public/generated.ts b/src/features/tech-log/contracts/public/generated.ts index 0e75af9..f859b45 100644 --- a/src/features/tech-log/contracts/public/generated.ts +++ b/src/features/tech-log/contracts/public/generated.ts @@ -539,6 +539,15 @@ export interface components { name: string; slug: string; description: string; + /** @description 이 주제가 답하는 질문. 목록이 이름과 개수만 싣던 동안 독자는 주제 이름만 보고 + * 들어갈지 말지를 정해야 했다 — 이름은 무엇에 대한 것인지만 말하고 무엇에 답하는지는 + * 말하지 않는다. + * */ + thesis?: string; + /** @description 축의 이름. 비면 이 주제는 축을 쓰지 않는다. */ + variantLabel?: string; + /** @description 이 주제가 견주는 접근의 수. 축을 쓰지 않으면 0 이다. */ + variantCount?: number; recordCount?: number; }; TopicListResponse: { diff --git a/src/features/tech-log/contracts/public/public-api.openapi.yaml b/src/features/tech-log/contracts/public/public-api.openapi.yaml index 914884e..99b7d4f 100644 --- a/src/features/tech-log/contracts/public/public-api.openapi.yaml +++ b/src/features/tech-log/contracts/public/public-api.openapi.yaml @@ -1228,6 +1228,19 @@ components: type: string description: type: string + thesis: + type: string + description: | + 이 주제가 답하는 질문. 목록이 이름과 개수만 싣던 동안 독자는 주제 이름만 보고 + 들어갈지 말지를 정해야 했다 — 이름은 무엇에 대한 것인지만 말하고 무엇에 답하는지는 + 말하지 않는다. + variantLabel: + type: string + description: 축의 이름. 비면 이 주제는 축을 쓰지 않는다. + variantCount: + type: integer + minimum: 0 + description: 이 주제가 견주는 접근의 수. 축을 쓰지 않으면 0 이다. recordCount: type: integer TopicListResponse: diff --git a/src/features/tech-log/contracts/studio/canonical-source.json b/src/features/tech-log/contracts/studio/canonical-source.json index d04cd6c..74a251c 100644 --- a/src/features/tech-log/contracts/studio/canonical-source.json +++ b/src/features/tech-log/contracts/studio/canonical-source.json @@ -2,7 +2,7 @@ "packageId": "@tech-log/studio-contract", "version": "3.1.0", "digest": "sha256:d2bfbe0a12136f131ccb8c42f8868108ba8d0f0182b347f9b815316c343a970c", - "sourceRevision": "b93d62a", + "sourceRevision": "559d04f", "operationIds": [ "getStudioSession", "getStudioDashboard", diff --git a/src/features/tech-log/contracts/tech-log-route-contract.ts b/src/features/tech-log/contracts/tech-log-route-contract.ts index 10ae3f8..a543228 100644 --- a/src/features/tech-log/contracts/tech-log-route-contract.ts +++ b/src/features/tech-log/contracts/tech-log-route-contract.ts @@ -29,6 +29,7 @@ const TECH_LOG_ROUTE_SPECS = [ defineSpec({ routeId: "TECH_LOG_REFERENCE", path: "/references/:slug", layoutGroup: "PUBLIC", paramsSchema: "TechLogSlugParams", searchSchema: null, title: "Reference", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_CONCEPT", path: "/concepts/:slug", layoutGroup: "PUBLIC", paramsSchema: "TechLogSlugParams", searchSchema: null, title: "개념", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_QUESTION", path: "/questions/:slug", layoutGroup: "PUBLIC", paramsSchema: "TechLogSlugParams", searchSchema: null, title: "Open Question", navigationLabel: null, navigationOrder: null }), + defineSpec({ routeId: "TECH_LOG_TOPICS", path: "/topics", layoutGroup: "PUBLIC", paramsSchema: null, searchSchema: null, title: "주제", navigationLabel: "주제", navigationOrder: 15 }), defineSpec({ routeId: "TECH_LOG_TOPIC", path: "/topics/:slug", layoutGroup: "PUBLIC", paramsSchema: "TechLogSlugParams", searchSchema: null, title: "Topic", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_TOPIC_VARIANT", path: "/topics/:slug/:variant", layoutGroup: "PUBLIC", paramsSchema: "TechLogTopicVariantParams", searchSchema: null, title: "Topic", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_PROJECTS", path: "/projects", layoutGroup: "PUBLIC", paramsSchema: null, searchSchema: null, title: "프로젝트", navigationLabel: "프로젝트", navigationOrder: 20 }), 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 393e422..1acd55c 100644 --- a/src/features/tech-log/presentation/public/pages/home-page.tsx +++ b/src/features/tech-log/presentation/public/pages/home-page.tsx @@ -255,18 +255,13 @@ export function HomePage() { {/* - 나머지 주제. 하나만 펼쳐 두면 그 주제가 이 기록의 전부인 것처럼 보인다 — 실제로 - JPA 주제는 최근 기록에 우연히 걸릴 때만 보였고, 무엇을 견줬는지는 홈 어디에서도 - 닿을 수 없었다. 펼치지는 않는다; 견주는 자리는 한 번에 하나여야 읽힌다. + 나머지 주제로 가는 길. 하나만 펼쳐 두면 그 주제가 이 기록의 전부인 것처럼 보인다 — + 실제로 JPA 주제는 최근 기록에 우연히 걸릴 때만 보였다. 여기서 펼치지는 않는다; + 견주는 자리는 한 번에 하나여야 읽히고, 나머지는 주제 목록이 받는다. */} {topics.others.length > 0 ? (

- 다른 주제 - {topics.others.map((topic) => ( - - {`${topic.name} (${topic.recordCount})`} - - ))} + {`다른 주제 ${topics.others.length}개 보기`}

) : null} diff --git a/src/features/tech-log/presentation/public/pages/topics-page.tsx b/src/features/tech-log/presentation/public/pages/topics-page.tsx new file mode 100644 index 0000000..af715a4 --- /dev/null +++ b/src/features/tech-log/presentation/public/pages/topics-page.tsx @@ -0,0 +1,67 @@ +import { Link } from "react-router-dom"; + +import { usePublicContent } from "../use-public-content.tsx"; + +/** + * 주제 목록. + * + *

주제로 가는 길이 기록의 breadcrumb 과 탐색의 묶음 제목뿐이었다. 주제가 이 기록의 뼈대인데 + * 그 목록을 정면으로 보여 주는 자리가 없었고, 홈이 한 주제만 펼치던 동안 나머지는 최근 기록에 + * 우연히 걸릴 때만 보였다. + * + *

줄마다 이름·논지·축·기록 수를 싣는다. 이름은 무엇에 대한 것인지만 말하므로, 들어갈지 + * 말지를 정하려면 그 주제가 무엇에 답하는지가 함께 있어야 한다. + */ +export function TopicsPage() { + const view = usePublicContent(["tech-log", "topics"], async (queries) => ({ + topics: await queries.listTopics(), + })); + if (!view.ready) return view.fallback; + + const { topics } = view.data; + return ( +

+
+

Topics

+

주제

+

같은 질문에 답하려고 모은 기록들입니다. 주제 안에서 접근을 나눠 견줍니다.

+
+ +
+

전체 주제

+

{`${topics.length}개`}

+
+ + {topics.length === 0 ? ( +

아직 공개된 주제가 없습니다.

+ ) : ( +
    + {topics.map((topic) => ( +
  • + + {topic.name} + {/* + 논지가 있으면 그것이 이 주제를 고르는 근거다. 아직 쓰지 않았으면 설명으로 + 물러서고, 둘 다 없으면 그 줄을 그리지 않는다 — 빈 문단은 아무것도 말하지 않는다. + */} + {topic.thesis || topic.description ? ( +

    {firstLine(topic.thesis || topic.description)}

    + ) : null} + + {topic.variantCount > 0 + ? `${topic.variantLabel || "접근"} ${topic.variantCount} · 기록 ${topic.recordCount}` + : `기록 ${topic.recordCount}`} + + +
  • + ))} +
+ )} +
+ ); +} + +/** 논지는 여러 문단이다. 목록에는 첫 문단만 — 목록에서 필요한 것은 고를 근거 한 줄이다. */ +function firstLine(text: string): string { + return text.split(/\n{2,}/u)[0]?.trim() ?? ""; +} diff --git a/src/features/tech-log/presentation/styles/globals.css b/src/features/tech-log/presentation/styles/globals.css index cd4c9f2..880c0c3 100644 --- a/src/features/tech-log/presentation/styles/globals.css +++ b/src/features/tech-log/presentation/styles/globals.css @@ -3056,10 +3056,6 @@ textarea.studio-control { min-height: 118px; resize: vertical; line-height: 1.65 font-size: 13px; } -.home-other-topics > span { - font-weight: 600; -} - .home-other-topics a { color: var(--muted); } @@ -3067,3 +3063,62 @@ textarea.studio-control { min-height: 118px; resize: vertical; line-height: 1.65 .home-other-topics a:hover { color: var(--signal); } + +/* + 주제 목록. 기록 목록과 같은 배치를 쓰되 칸이 셋이다 — 이름, 고를 근거, 규모. +*/ +.topic-index-list { + margin: 0; + padding: 0; + list-style: none; + border-top: 1px solid var(--line-strong); +} + +.topic-index-list li { + border-bottom: 1px solid var(--line); +} + +.topic-index-list li > a { + display: grid; + grid-template-columns: 220px minmax(0, 1fr) 160px; + gap: 24px; + align-items: baseline; + padding: 30px 2px 32px; +} + +.topic-index-list strong { + color: var(--ink); + font-size: 18px; + font-weight: 630; + letter-spacing: -0.02em; + line-height: 1.4; +} + +.topic-index-list p { + max-width: 700px; + margin: 0; + color: var(--muted); + font-size: 14px; + line-height: 1.65; +} + +.topic-index-meta { + color: var(--faint); + font-size: 12px; + text-align: right; +} + +.topic-index-list li > a:hover strong { + color: var(--signal); +} + +@media (max-width: 720px) { + .topic-index-list li > a { + grid-template-columns: minmax(0, 1fr); + gap: 8px; + } + + .topic-index-meta { + text-align: left; + } +} diff --git a/src/features/tech-log/presentation/tech-log-route-runtime.tsx b/src/features/tech-log/presentation/tech-log-route-runtime.tsx index 0e8ac55..8638240 100644 --- a/src/features/tech-log/presentation/tech-log-route-runtime.tsx +++ b/src/features/tech-log/presentation/tech-log-route-runtime.tsx @@ -82,6 +82,13 @@ export const TECH_LOG_ROUTE_RUNTIME = Object.freeze({ "QuestionPage", ), ), + TECH_LOG_TOPICS: runtime( + "TECH_LOG_TOPICS", + routeModule( + () => import("./public/pages/topics-page.tsx"), + "TopicsPage", + ), + ), TECH_LOG_TOPIC: runtime( "TECH_LOG_TOPIC", routeModule(() => import("./public/pages/topic-page.tsx"), "TopicPage"), diff --git a/tests/features/tech-log/navigation-derivation.test.ts b/tests/features/tech-log/navigation-derivation.test.ts index c39a2f3..00198ab 100644 --- a/tests/features/tech-log/navigation-derivation.test.ts +++ b/tests/features/tech-log/navigation-derivation.test.ts @@ -15,6 +15,7 @@ describe("TechLog navigation derivation", () => { techLogNavigation("PUBLIC").map((entry) => [entry.label, entry.path]), ).toEqual([ ["탐색", "/explore"], + ["주제", "/topics"], ["프로젝트", "/projects"], ["프로필", "/profile"], ]); diff --git a/tests/features/tech-log/public-shell.test.tsx b/tests/features/tech-log/public-shell.test.tsx index c56d126..8c294af 100644 --- a/tests/features/tech-log/public-shell.test.tsx +++ b/tests/features/tech-log/public-shell.test.tsx @@ -102,6 +102,7 @@ describe("TechLog Public shell", () => { ).toBeInTheDocument(); const expectedNavigation = [ ["탐색", "/explore"], + ["주제", "/topics"], ["프로젝트", "/projects"], ["프로필", "/profile"], ]; diff --git a/tests/features/tech-log/route-contract.test.ts b/tests/features/tech-log/route-contract.test.ts index c9b9b9b..9eb2311 100644 --- a/tests/features/tech-log/route-contract.test.ts +++ b/tests/features/tech-log/route-contract.test.ts @@ -19,6 +19,7 @@ const expectedRoutes = [ ["TECH_LOG_REFERENCE", "/references/:slug", "PUBLIC", "TechLogSlugParams", null], ["TECH_LOG_CONCEPT", "/concepts/:slug", "PUBLIC", "TechLogSlugParams", null], ["TECH_LOG_QUESTION", "/questions/:slug", "PUBLIC", "TechLogSlugParams", null], + ["TECH_LOG_TOPICS", "/topics", "PUBLIC", null, null], ["TECH_LOG_TOPIC", "/topics/:slug", "PUBLIC", "TechLogSlugParams", null], [ "TECH_LOG_TOPIC_VARIANT", @@ -63,6 +64,7 @@ const expectedTitles = { TECH_LOG_CONCEPT: "개념", TECH_LOG_REFERENCE: "Reference", TECH_LOG_QUESTION: "Open Question", + TECH_LOG_TOPICS: "주제", TECH_LOG_TOPIC: "Topic", TECH_LOG_TOPIC_VARIANT: "Topic", TECH_LOG_PROJECTS: "프로젝트", @@ -94,7 +96,7 @@ const expectedTitles = { } as const; describe("TechLog route boundary contract", () => { - it("freezes the standalone 33-route inventory before runtime installation", () => { + it("freezes the standalone 34-route inventory before runtime installation", () => { expect( Object.values(TECH_LOG_ROUTE_REGISTRY).map((definition) => [ definition.routeId, @@ -156,6 +158,7 @@ describe("TechLog route boundary contract", () => { ]), ).toEqual([ ["TECH_LOG_EXPLORE", "PUBLIC", "탐색", 10], + ["TECH_LOG_TOPICS", "PUBLIC", "주제", 15], ["TECH_LOG_PROJECTS", "PUBLIC", "프로젝트", 20], ["TECH_LOG_PROFILE", "PUBLIC", "프로필", 40], ["TECH_LOG_STUDIO_DOCUMENTS", "STUDIO", "작업본", 10], @@ -168,7 +171,7 @@ describe("TechLog route boundary contract", () => { for (const locale of ["ko-KR", "en-US"] as const) { const catalog: Readonly> = TECH_LOG_MESSAGE_CATALOGS[locale]; - expect(Object.keys(catalog)).toHaveLength(70); + expect(Object.keys(catalog)).toHaveLength(72); for (const [routeId, title] of Object.entries(expectedTitles)) { expect(catalog[`route.${routeId}.title`]).toBe(title); expect(catalog[`route.${routeId}.navigation`]).toBe(title); diff --git a/variant-final.png b/variant-final.png new file mode 100644 index 0000000..363b27f Binary files /dev/null and b/variant-final.png differ diff --git a/vite.config.ts b/vite.config.ts index 54e5035..a48b7a0 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,6 +12,7 @@ const techLogRouteChunks = Object.freeze({ "/public/pages/reference-page.tsx": "route-tech-log-reference", "/public/pages/concept-page.tsx": "route-tech-log-concept", "/public/pages/question-page.tsx": "route-tech-log-question", + "/public/pages/topics-page.tsx": "route-tech-log-topics", "/public/pages/topic-page.tsx": "route-tech-log-topic", "/public/pages/topic-variant-page.tsx": "route-tech-log-topic-variant", "/public/pages/projects-page.tsx": "route-tech-log-projects",