fix: Studio 리뷰 지적을 반영하고 죽은 머리말 컴포넌트를 걷어낸다
에디터 칸 이름을 공개 화면과 맞춘다. 목적→이 기준을 쓰는 이유, 규칙→판단 기준, 적용 조건→적용할 때, 예외→예외와 주의, 사실→확인한 사실, 미지수→남은 미지수, 선택지→검토한 선택지. 쓰는 사람이 지금 채우는 칸이 공개 화면 어디로 가는지 외우지 않아도 된다. 대시보드의 세 칸이 같은 목록을 세 번 반복했다. 「검증과 미리보기」와 「게시 준비」가 「이어서 작성」을 걸러 낸 부분집합인데 「이어서 작성」은 전체를 그대로 그렸기 때문이다 — 모든 문서가 같은 단계면 세 칸이 겹친다. 각 문서는 지금 서 있는 구간 한 곳에만 나온다. 릴리스에서 「상태 공개 · 공개일 2026-08-22」 옆에 「아직 공개하지 않음」이 같이 나왔다. 경로가 비었다고 미공개는 아니다 — 공개 여부는 상태가 말한다. 행에서 눈에 띄는 단 하나가 되돌릴 수 없는 동작이었다. 편집을 같은 격의 버튼으로 올리고, 삭제는 danger 로 낮추고, 격자에 자리를 만들어 다음 줄로 떨어지지 않게 한다. 게시 기록이 이미 그 모양이었다. 주제·프로젝트는 「다음: 내용 편집」을 안내하면서 그 줄의 버튼은 게시 취소와 삭제뿐이었다. 공개 프로젝트 화면이 비어 있던 이유가 여기다. 죽은 코드였던 PublicDocumentHeader 를 걷어낸다. 화면을 실제로 그리는 것은 PublicRecordRenderer 이고 그 컴포넌트는 아무도 부르지 않았다 — 어제 이 컴포넌트에 줄바꿈을 고쳐 넣었지만 화면에는 닿지 않았다. 그 자리를 지키던 가드도 진짜로 그려지는 쪽으로 옮긴다. 탭 제목과 설명에 문서를 반영한다. 공개 문서가 전부 "Reference · Tech Log" 였고 설명은 모든 화면이 "Tech Log frontend" 하나였다. 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
ca1fc92e6d
commit
82e992d066
@@ -4,8 +4,7 @@ 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 { PublicRecordRenderer } from "../../src/features/tech-log/presentation/shared/public-render/public-record-renderer.tsx";
|
||||
|
||||
import {
|
||||
InlineRenderer,
|
||||
@@ -60,46 +59,48 @@ describe("Markdown 을 거치지 않는 평문 칸", () => {
|
||||
|
||||
/**
|
||||
* 문서 머리말의 요약. 상한이 2000자가 되면서 요약은 한 문장이 아니라 여러 문단이 되었고,
|
||||
* 여기만 `PlainText` 를 거치지 않아 그 문단들이 한 덩어리로 이어져 보였다.
|
||||
* 예전에는 빈 줄까지 <br> 로 나가 문단 사이 여백이 없었다.
|
||||
*
|
||||
* <p>이 가드는 한동안 엉뚱한 것을 지키고 있었다 — `PublicDocumentHeader` 라는 컴포넌트를 세웠는데
|
||||
* 화면을 실제로 그리는 것은 `PublicRecordRenderer` 였고, 그 컴포넌트는 아무도 부르지 않는 죽은
|
||||
* 코드였다. 지금은 진짜로 그려지는 쪽을 본다.
|
||||
*/
|
||||
describe("문서 머리말의 요약", () => {
|
||||
const record: QuestionRecord = {
|
||||
const model = {
|
||||
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",
|
||||
publicPath: "/questions/session-store-boundary",
|
||||
topic: { label: "인증", publicPath: "/explore?topic=auth" },
|
||||
project: { label: "Keycloak", publicPath: "/projects/keycloak" },
|
||||
relations: [],
|
||||
questionStatus: "OPEN",
|
||||
renderContext: { generatedAt: "2026-08-31T00:00:00Z", dependencyRevision: "r1" },
|
||||
status: "OPEN",
|
||||
facts: [],
|
||||
assumptions: [],
|
||||
unknowns: [],
|
||||
constraints: [],
|
||||
options: [],
|
||||
nextValidation: "",
|
||||
};
|
||||
resolution: null,
|
||||
} as never;
|
||||
|
||||
it("빈 줄은 문단으로, 문단 안 줄바꿈은 줄바꿈으로 그린다", () => {
|
||||
const { container } = render(
|
||||
<MemoryRouter>
|
||||
<PublicDocumentHeader record={record} />
|
||||
<PublicRecordRenderer
|
||||
model={model}
|
||||
resolvePublishedLabel={() => undefined}
|
||||
resolveEvidenceAsset={() => {
|
||||
throw new Error("이 문서에는 도식이 없다");
|
||||
}}
|
||||
/>
|
||||
</MemoryRouter>,
|
||||
);
|
||||
/*
|
||||
요약은 "두 줄 + 빈 줄 + 한 줄" 이다. 예전에는 셋 다 <br> 로 나가서 문단 사이 여백이
|
||||
없었다. 지금은 빈 줄이 문단을 가르고, 문단 안의 줄바꿈만 <br> 로 남는다.
|
||||
*/
|
||||
const paragraphs = container.querySelectorAll(".public-document-header p");
|
||||
expect(paragraphs).toHaveLength(2);
|
||||
expect(container.querySelectorAll(".public-document-header p br")).toHaveLength(1);
|
||||
// 그대로 넣으면 문단 하나에 <br> 0개가 되어 전부 한 덩어리로 읽힌다.
|
||||
expect(paragraphs[0]).toHaveTextContent("둘 다 메모리에 있다.");
|
||||
expect(paragraphs[1]).toHaveTextContent("인스턴스를 늘리면 설계가 필요하다.");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user