fix: 요약을 2000자까지 쓰고, 목록과 머리말이 그 길이를 견디게 한다
600 은 「아래 저장 경로가 이미 600 이니 거기 맞추자」는 판단이었지 실제로 쓰는 글의 길이를 본 것이 아니었다. 요약은 여러 문단이다. 길어진 요약이 드러낸 두 가지를 함께 고친다. 목록: 최근 기록·탐색·검색·홈 초점은 요약을 통째로 그렸다. 2000자면 한 항목이 화면을 덮어 목록이 목록이 아니게 된다. 세 줄에서 자른다 — 전문은 문서를 열면 나온다. 머리말: `public-document-header` 만 `PlainText` 를 거치지 않고 요약을 그대로 넣고 있었다. 작성자가 나눈 문단이 전부 한 덩어리로 이어졌다. 판단 결정 요약에서 고쳤던 것과 같은 결함이고, 이 자리를 빠뜨렸다. 되돌리면 <br> 가 3개에서 0개가 되어 가드가 깨지는 것을 확인했다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011nAjrqNHGPNngN4aUbcyvJ
This commit is contained in:
co-authored by
Claude Opus 5
parent
8fce8ea69c
commit
4e486aac59
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user