fix: 결정 문서가 작성자가 채운 칸을 그대로 보여 준다
공개 결정 화면에 네 가지가 어긋나 있었다 — 제목 자리에 결정문 전문이 나오고, 요약이 아예 없고, 줄바꿈이 전부 접히고, 영향과 근거 기록이 늘 비어 있었다. 원인은 하나로 모인다. 결정에는 상세 endpoint 가 없다 — 공개 주소가 목록 위의 앵커다. 그런데 계약의 목록 항목에 title·summary·consequences·evidence 가 없어서, 프론트는 statement 를 제목 자리에도 쓰고 영향은 빈 배열로 고정해 두고 있었다. DB 에는 작성자가 쓴 값이 그대로 들어 있었다 — 제목, 여러 줄 요약, 영향 4건. 근거는 두 자리에서 온다. `sourceQuestion`/`sourceCase` 는 결정 하나가 원천 하나를 지목하던 예전 모양이고 지금 작성자는 관계로 여러 개를 건다. 둘을 합치되 같은 경로는 한 번만 싣는다. 줄바꿈은 별개 원인이다. 이 칸들은 Markdown 을 거치지 않고 텍스트 노드로 들어가는데 이 화면만 `PlainText` 를 쓰지 않고 값을 그대로 넣고 있었다. 글자만 확인하는 테스트로는 접힘이 보이지 않으므로, 두 줄짜리 픽스처를 두고 `<br>` 이 남는지 요소로 묻는다 — 되돌리면 빨개진다. 즉시 미리보기도 같은 구조로 맞췄다. 미리보기와 공개가 다르게 그리면 무엇을 믿을지 알 수 없다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0189NzCryfeqDzS81EWidnBx
This commit is contained in:
co-authored by
Claude Opus 5
parent
3b6ba64c08
commit
31afb4d800
@@ -4,6 +4,7 @@ import {
|
||||
RegisteredNotFoundRoute,
|
||||
useRouteInput,
|
||||
} from "../../../../../presentation/routes/route-input.tsx";
|
||||
import { PlainText } from "../../shared/public-render/inline-renderer.tsx";
|
||||
import { ProjectPageHeader } from "../components/project-page-header.tsx";
|
||||
import { usePublicContent } from "../use-public-content.tsx";
|
||||
|
||||
@@ -28,6 +29,11 @@ export function ProjectDecisionsPage() {
|
||||
{decisions.map((decision) => (
|
||||
<li key={decision.id}>
|
||||
<article id={decision.id}>
|
||||
{/*
|
||||
작성자가 나눠 쓴 줄은 그대로 나눠 보여야 한다. 이 칸들은 Markdown 을 거치지 않고
|
||||
텍스트 노드로 들어가므로, HTML 이 줄바꿈을 공백으로 접어 여러 문단이 한 줄로
|
||||
이어져 보였다. `PlainText` 가 그 자리를 지킨다.
|
||||
*/}
|
||||
<header>
|
||||
<div>
|
||||
<span>{decision.status}</span>
|
||||
@@ -36,29 +42,43 @@ export function ProjectDecisionsPage() {
|
||||
</time>
|
||||
</div>
|
||||
<h2>{decision.title}</h2>
|
||||
<p>{decision.statement}</p>
|
||||
{decision.summary ? (
|
||||
<p><PlainText text={decision.summary} /></p>
|
||||
) : null}
|
||||
</header>
|
||||
<section>
|
||||
<h3>결정</h3>
|
||||
<p><PlainText text={decision.statement} /></p>
|
||||
</section>
|
||||
<section>
|
||||
<h3>판단 이유</h3>
|
||||
<p>{decision.rationale}</p>
|
||||
<p><PlainText text={decision.rationale} /></p>
|
||||
</section>
|
||||
<section>
|
||||
<h3>영향</h3>
|
||||
<ul>
|
||||
{decision.consequences.map((item) => (
|
||||
<li key={item}>{item}</li>
|
||||
))}
|
||||
</ul>
|
||||
{decision.consequences.length ? (
|
||||
<ul>
|
||||
{decision.consequences.map((item) => (
|
||||
<li key={item}><PlainText text={item} /></li>
|
||||
))}
|
||||
</ul>
|
||||
) : (
|
||||
<p>남긴 영향이 없습니다.</p>
|
||||
)}
|
||||
</section>
|
||||
<section>
|
||||
<h3>근거 기록</h3>
|
||||
<ul>
|
||||
{decision.evidence.map((item) => (
|
||||
<li key={item.path}>
|
||||
<Link to={item.path}>{item.title}</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
{decision.evidence.length ? (
|
||||
<ul>
|
||||
{decision.evidence.map((item) => (
|
||||
<li key={item.path}>
|
||||
<Link to={item.path}>{item.title}</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
) : (
|
||||
<p>연결한 근거 기록이 없습니다.</p>
|
||||
)}
|
||||
</section>
|
||||
</article>
|
||||
</li>
|
||||
|
||||
@@ -523,15 +523,21 @@ function ProjectDecisionDocument({
|
||||
)}
|
||||
</div>
|
||||
<h2>{model.title}</h2>
|
||||
<p><PlainText text={model.statement} /></p>
|
||||
{model.summary ? (
|
||||
<p><PlainText text={model.summary} /></p>
|
||||
) : null}
|
||||
</header>
|
||||
<section>
|
||||
<h3>결정</h3>
|
||||
<p><PlainText text={model.statement} /></p>
|
||||
</section>
|
||||
<section>
|
||||
<h3>판단 이유</h3>
|
||||
<p><PlainText text={model.rationale} /></p>
|
||||
</section>
|
||||
<section>
|
||||
<h3>영향</h3>
|
||||
<OrderedItems items={model.consequences} />
|
||||
<OrderedItems items={model.consequences} empty="남긴 영향이 없습니다." />
|
||||
</section>
|
||||
<section>
|
||||
<h3>근거 기록</h3>
|
||||
|
||||
Reference in New Issue
Block a user