diff --git a/public/release-manifest.json b/public/release-manifest.json index c87ef3d..de6f773 100644 --- a/public/release-manifest.json +++ b/public/release-manifest.json @@ -38,28 +38,28 @@ }, "contractSet": { "setAlgorithm": "CA_CONTRACT_SET_V1", - "setDigest": "sha256:54e2295eb185cb608fcbe5c8557e0d4f436d8f83bd200e632f7b20e47b9b76d9", + "setDigest": "sha256:b9e1e6a07e087dc56fe81805303a6f20022956174449b65575b350a71ab40675", "packages": [ { "packageId": "@tech-log/management-contract", "version": "1.0.0", - "digest": "sha256:762aa81e6906469939fddd833c204ed3ca53f0fa96371f18a5ea1edaf76a64e8", + "digest": "sha256:f97b97101791d87fcf27d78a4c016370cabd2f02bb3b30eec0b8e453803d2d5f", "runtimeProtocolVersion": 1, - "sourceRevision": "617eb6a" + "sourceRevision": "5942a2e" }, { "packageId": "@tech-log/public-contract", "version": "2.1.0", "digest": "sha256:afe415880eb5d6289ae10abf493333c97270c323c16a7245a466d4db4466e630", "runtimeProtocolVersion": 1, - "sourceRevision": "617eb6a" + "sourceRevision": "5942a2e" }, { "packageId": "@tech-log/studio-contract", "version": "3.1.0", - "digest": "sha256:2236a17064a81ae7e0c358fbc0756c8d89a5bdd7a2dfba36efffae0a448624b1", + "digest": "sha256:7e1ee18f7e6a6cb1750dd0baec28d975fb3b535116d8dfb57c17ae16ee8d2be8", "runtimeProtocolVersion": 1, - "sourceRevision": "617eb6a" + "sourceRevision": "5942a2e" } ] } diff --git a/src/features/tech-log/contracts/management/canonical-source.json b/src/features/tech-log/contracts/management/canonical-source.json index c50aede..0f109ce 100644 --- a/src/features/tech-log/contracts/management/canonical-source.json +++ b/src/features/tech-log/contracts/management/canonical-source.json @@ -1,8 +1,8 @@ { "packageId": "@tech-log/management-contract", "version": "1.0.0", - "digest": "sha256:762aa81e6906469939fddd833c204ed3ca53f0fa96371f18a5ea1edaf76a64e8", - "sourceRevision": "617eb6a", + "digest": "sha256:f97b97101791d87fcf27d78a4c016370cabd2f02bb3b30eec0b8e453803d2d5f", + "sourceRevision": "5942a2e", "operationIds": [ "createCaseDraft", "getCaseForEdit", diff --git a/src/features/tech-log/contracts/management/management-api.openapi.yaml b/src/features/tech-log/contracts/management/management-api.openapi.yaml index d7a8c1f..8e87725 100644 --- a/src/features/tech-log/contracts/management/management-api.openapi.yaml +++ b/src/features/tech-log/contracts/management/management-api.openapi.yaml @@ -6331,7 +6331,7 @@ components: maxLength: 180 summary: type: string - maxLength: 600 + maxLength: 2000 context: type: string importance: @@ -6709,7 +6709,7 @@ components: maxLength: 180 summary: type: string - maxLength: 600 + maxLength: 2000 releasedOn: type: string format: date @@ -7243,7 +7243,7 @@ components: maxLength: 180 summary: type: string - maxLength: 600 + maxLength: 2000 visibility: type: string enum: diff --git a/src/features/tech-log/contracts/public/canonical-source.json b/src/features/tech-log/contracts/public/canonical-source.json index 0970c11..3a34722 100644 --- a/src/features/tech-log/contracts/public/canonical-source.json +++ b/src/features/tech-log/contracts/public/canonical-source.json @@ -2,7 +2,7 @@ "packageId": "@tech-log/public-contract", "version": "2.1.0", "digest": "sha256:afe415880eb5d6289ae10abf493333c97270c323c16a7245a466d4db4466e630", - "sourceRevision": "617eb6a", + "sourceRevision": "5942a2e", "operationIds": [ "getPublicSite", "getPublicHome", diff --git a/src/features/tech-log/contracts/studio/canonical-source.json b/src/features/tech-log/contracts/studio/canonical-source.json index deabcbd..f7546ea 100644 --- a/src/features/tech-log/contracts/studio/canonical-source.json +++ b/src/features/tech-log/contracts/studio/canonical-source.json @@ -1,8 +1,8 @@ { "packageId": "@tech-log/studio-contract", "version": "3.1.0", - "digest": "sha256:2236a17064a81ae7e0c358fbc0756c8d89a5bdd7a2dfba36efffae0a448624b1", - "sourceRevision": "617eb6a", + "digest": "sha256:7e1ee18f7e6a6cb1750dd0baec28d975fb3b535116d8dfb57c17ae16ee8d2be8", + "sourceRevision": "5942a2e", "operationIds": [ "getStudioSession", "getStudioDashboard", diff --git a/src/features/tech-log/contracts/studio/studio-api.openapi.yaml b/src/features/tech-log/contracts/studio/studio-api.openapi.yaml index 3841d23..0aa48d4 100644 --- a/src/features/tech-log/contracts/studio/studio-api.openapi.yaml +++ b/src/features/tech-log/contracts/studio/studio-api.openapi.yaml @@ -917,7 +917,7 @@ components: oneOf: - { type: string, const: "" } - { type: string, minLength: 3, maxLength: 100, pattern: "^[a-z0-9]+(?:-[a-z0-9]+)*$" } - summary: { type: string, maxLength: 600 } + summary: { type: string, maxLength: 2000 } topicId: { type: [string, "null"], format: uuid } projectId: type: [string, "null"] @@ -1280,7 +1280,7 @@ components: kind: { $ref: "#/components/schemas/RecordKind" } slug: { type: string, minLength: 3, maxLength: 100, pattern: "^[a-z0-9]+(?:-[a-z0-9]+)*$" } title: { type: string, minLength: 1, maxLength: 120 } - summary: { type: string, maxLength: 600 } + summary: { type: string, maxLength: 2000 } publicPath: { type: string, minLength: 1, maxLength: 500 } topic: { $ref: "#/components/schemas/DisplayTarget" } project: diff --git a/src/features/tech-log/presentation/public/components/public-document-header.tsx b/src/features/tech-log/presentation/public/components/public-document-header.tsx index 55b28c0..b26eecf 100644 --- a/src/features/tech-log/presentation/public/components/public-document-header.tsx +++ b/src/features/tech-log/presentation/public/components/public-document-header.tsx @@ -2,6 +2,7 @@ import { Link } from "react-router-dom"; import type { PublicRecord } from "../../../application/ports/public-content-queries.ts"; import type { components } from "../../../contracts/studio/generated.ts"; +import { PlainText } from "../../shared/public-render/inline-renderer.tsx"; const kindLabels = { CASE: "Case", @@ -33,7 +34,8 @@ export function PublicDocumentHeader({ record }: { record: PublicRecord }) {

{record.title}

-

{record.summary}

+ {/* 요약은 여러 문단일 수 있다 — 그대로 넣으면 줄바꿈이 사라져 한 덩어리로 읽힌다. */} +

</p> <dl> <div> <dt>유형</dt> diff --git a/src/features/tech-log/presentation/studio/components/common-document-fields.tsx b/src/features/tech-log/presentation/studio/components/common-document-fields.tsx index 7795de6..6903216 100644 --- a/src/features/tech-log/presentation/studio/components/common-document-fields.tsx +++ b/src/features/tech-log/presentation/studio/components/common-document-fields.tsx @@ -9,7 +9,7 @@ type CatalogEntry = components["schemas"]["CatalogEntry"]; * 요약이 들어갈 수 있는 최대 길이. 계약 `WorkingCopyInputBase.summary` 와 같은 값이어야 한다 — * 여기가 더 크면 다 쓰고 나서 저장할 때 거절당하고, 더 작으면 쓸 수 있는 자리를 못 쓴다. */ -const SUMMARY_MAX = 600; +const SUMMARY_MAX = 2000; /** 이 화면이 자기 칸 아래에 보여 줄 수 있는 경로. 나머지는 게시 버튼 옆에 남는다. */ export const COMMON_FIELD_PATHS = [ diff --git a/src/features/tech-log/presentation/styles/globals.css b/src/features/tech-log/presentation/styles/globals.css index 0bc0f65..dd0b860 100644 --- a/src/features/tech-log/presentation/styles/globals.css +++ b/src/features/tech-log/presentation/styles/globals.css @@ -2391,6 +2391,16 @@ dialog::backdrop { .record-kind { padding-top: 3px; color: var(--faint); font-family: "IBM Plex Mono", monospace; font-size: 11px; text-transform: uppercase; } .public-record-list strong { display: block; font-size: 18px; font-weight: 630; letter-spacing: -0.02em; } .public-record-list p { max-width: 700px; margin: 7px 0 6px; color: var(--muted); font-size: 14px; line-height: 1.62; } + +/* + 목록의 요약은 세 줄에서 자른다. 요약은 여러 문단이 될 수 있는데(상한 2000자) 목록에 통째로 + 펼치면 한 항목이 화면을 덮어 목록이 목록이 아니게 된다. 전문은 문서를 열면 나온다. + 잘리는 것은 보이는 것뿐이고, 읽어 주는 기계에는 전문이 그대로 남는다. +*/ +.public-record-list p, +.search-results p, +.focus-summary p, +.latest-copy > p:not(.latest-mobile-meta) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; } .record-context { color: var(--faint); font-size: 11px; } .public-record-list time { color: var(--faint); font-family: "IBM Plex Mono", monospace; font-size: 10px; text-align: right; } .public-empty-state { margin: 0; padding: 64px 0; border-bottom: 1px solid var(--line); color: var(--muted); text-align: center; } diff --git a/tests/component/inline-line-breaks.test.tsx b/tests/component/inline-line-breaks.test.tsx index 7dc635a..7406895 100644 --- a/tests/component/inline-line-breaks.test.tsx +++ b/tests/component/inline-line-breaks.test.tsx @@ -1,8 +1,12 @@ // @vitest-environment jsdom import { render } from "@testing-library/react"; +import { MemoryRouter } from "react-router-dom"; import { describe, expect, it } from "vitest"; +import { PublicDocumentHeader } from "../../src/features/tech-log/presentation/public/components/public-document-header.tsx"; +import type { QuestionRecord } from "../../src/features/tech-log/application/ports/public-content-queries.ts"; + import { InlineRenderer, PlainText, @@ -53,3 +57,42 @@ describe("Markdown 을 거치지 않는 평문 칸", () => { expect(container.querySelectorAll("br")).toHaveLength(0); }); }); + +/** + * 문서 머리말의 요약. 상한이 2000자가 되면서 요약은 한 문장이 아니라 여러 문단이 되었고, + * 여기만 `PlainText` 를 거치지 않아 그 문단들이 한 덩어리로 이어져 보였다. + */ +describe("문서 머리말의 요약", () => { + const record: QuestionRecord = { + kind: "QUESTION", + slug: "session-store-boundary", + title: "세션 저장소 경계", + summary: "Mediator와 BFF는 서로 다른 저장소를 쓴다.\n둘 다 메모리에 있다.\n\n인스턴스를 늘리면 설계가 필요하다.", + path: "/questions/session-store-boundary", + topic: "인증", + topicSlug: "auth", + projectSlug: "keycloak", + projectTitle: "Keycloak", + publishedAt: "2026-08-29T00:00:00Z", + publishedLabel: "2026.08.29", + visibility: "PUBLIC", + relations: [], + questionStatus: "OPEN", + facts: [], + assumptions: [], + unknowns: [], + constraints: [], + options: [], + nextValidation: "", + }; + + it("작성자가 나눈 문단을 지킨다", () => { + const { container } = render( + <MemoryRouter> + <PublicDocumentHeader record={record} /> + </MemoryRouter>, + ); + // 줄바꿈 셋(빈 줄 포함) → <br> 셋. 그대로 넣으면 0개가 되어 한 줄로 읽힌다. + expect(container.querySelectorAll(".public-document-header > p br")).toHaveLength(3); + }); +}); diff --git a/tests/features/tech-log/studio-editor-smoke.test.tsx b/tests/features/tech-log/studio-editor-smoke.test.tsx index 2f321ee..ac1fd34 100644 --- a/tests/features/tech-log/studio-editor-smoke.test.tsx +++ b/tests/features/tech-log/studio-editor-smoke.test.tsx @@ -246,18 +246,18 @@ describe("TechLog Studio document editor", () => { 계약 WorkingCopyInputBase.summary 와 같은 값이어야 한다. 300 이던 시절 이 칸은 문장 중간에서 말없이 입력을 멈췄고, 쓰는 사람에게는 키보드가 고장 난 것처럼 보였다. */ - expect(summary).toHaveAttribute("maxlength", "600"); + expect(summary).toHaveAttribute("maxlength", "2000"); fireEvent.change(summary, { target: { value: "가".repeat(412) } }); - expect(screen.getByText("412 / 600")).toBeInTheDocument(); + expect(screen.getByText("412 / 2000")).toBeInTheDocument(); expect( - screen.queryByText(/600자까지 모두 썼습니다/), + screen.queryByText(/2000자까지 모두 썼습니다/), ).not.toBeInTheDocument(); - fireEvent.change(summary, { target: { value: "가".repeat(600) } }); - expect(screen.getByText("600 / 600")).toBeInTheDocument(); + fireEvent.change(summary, { target: { value: "가".repeat(2000) } }); + expect(screen.getByText("2000 / 2000")).toBeInTheDocument(); // 한계에 닿았을 때만 알린다 — 글자마다 읽어 주면 받아쓰기가 된다. - expect(screen.getByText(/600자까지 모두 썼습니다/)).toBeInTheDocument(); + expect(screen.getByText(/2000자까지 모두 썼습니다/)).toBeInTheDocument(); // 글자 수는 칸의 이름에 섞이지 않아야 한다. 섞이면 이름이 타자마다 바뀐다. expect(screen.getByLabelText("요약")).toBe(summary);