fix: 편집기의 결정 목록을 살리고, 프로필 원칙을 이 기록의 말로 고친다
결정 조회가 500 이었다. `project_decision.consequences` 를 문자열 배열로 알고 읽었는데
실제로는 `{id, text, order}` 객체의 배열이다 — 작업본 저장 경로가 그렇게 쓰고, 그것을 읽는
`StudioJson.orderedTextFromJson` 이 이미 있었는데 보지 않고 새로 썼다.
그리고 한 칸의 실패가 옆 칸을 끌고 내려갔다. 편집기가 질문과 결정을 `Promise.all` 로 묶어
읽어서, 결정만 터지는데 멀쩡히 오던 질문 목록까지 「불러오지 못했습니다」가 됐다. 둘을
따로 읽는다.
프로젝트를 가려내는 slug 는 `publication.canonicalPath` 에서 나오는데 그 값은 게시된 적이
있어야 채워진다. 게시 전 프로젝트에서는 거르지 않는다 — 잘못 거르면 있는 질문이 사라져
보인다.
프로필의 원칙 세 줄은 「섞지 않습니다」·「함께 기록합니다」·「흩어지지 않게」처럼 무엇을
하는지 말하지 않는 동사로 끝나 있었다. 이 기록의 다른 글은 그렇게 쓰지 않는다 — Case 의
소제목은 「이 구조에서 감수한 것」처럼 무엇인지를 명사로 짚는다. 제목을 그 명사형으로,
설명을 이 사이트가 실제로 하는 일로 바꾼다.
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
aca4f189d1
commit
6e784eded4
@@ -847,16 +847,16 @@ export const profile: Profile = {
|
||||
introduction: "문제를 재현하고 검증해 운영 가능한 설계로 연결합니다.",
|
||||
principles: [
|
||||
{
|
||||
title: "관찰한 사실과 판단을 나눕니다",
|
||||
description: "측정값, 문서 근거, 아직 확인하지 못한 가정을 같은 문장에 섞지 않습니다.",
|
||||
title: "확인한 것과 확인하지 않은 것",
|
||||
description: "잰 값, 문서에서 읽은 것, 아직 확인하지 못한 가정을 각각 다른 칸에 적습니다.",
|
||||
},
|
||||
{
|
||||
title: "결론보다 경계를 남깁니다",
|
||||
description: "어떤 조건에서 선택했고 어디까지 적용할 수 있는지 함께 기록합니다.",
|
||||
title: "결론이 서는 조건",
|
||||
description: "어떤 환경에서 나온 결론인지, 어디까지 적용되는지를 결론과 같은 자리에 적습니다.",
|
||||
},
|
||||
{
|
||||
title: "프로젝트 맥락으로 다시 연결합니다",
|
||||
description: "검증 기록과 적용 기준, 열린 질문, 설계 결정이 따로 흩어지지 않게 실제 작업과 연결합니다.",
|
||||
title: "주제와 프로젝트로 되짚는 길",
|
||||
description: "기록마다 주제와 프로젝트를 답니다. 주제에서는 접근을 나눠 견주고, 프로젝트에서는 결정의 순서로 읽습니다.",
|
||||
},
|
||||
],
|
||||
currentProjectSlugs: ["backend-skeleton", "auth-lab"],
|
||||
|
||||
@@ -5,21 +5,30 @@ import { publicSiteConfig } from "../../../contracts/public-site-config.ts";
|
||||
import { usePublicContent } from "../use-public-content.tsx";
|
||||
import { useApplication } from "../../../../../presentation/providers/application-provider.tsx";
|
||||
|
||||
/*
|
||||
이 세 줄은 「섞지 않습니다」·「함께 기록합니다」·「흩어지지 않게」처럼 무엇을 하는지 말하지
|
||||
않는 동사로 끝나 있었다. 이 기록의 다른 글은 그렇게 쓰지 않는다 — Case 의 소제목은
|
||||
「이 구조에서 감수한 것」·「브라우저에 실제로 남는 것」처럼 무엇인지를 명사로 짚는다.
|
||||
|
||||
그래서 제목은 그 명사형으로, 설명은 이 사이트가 실제로 하는 일로 바꾼다. 문서에 사실·가정·
|
||||
미지수 칸이 따로 있고, 결론 옆에 적용 범위가 있고, 기록마다 주제와 프로젝트가 달린다 —
|
||||
셋 다 지어낸 다짐이 아니라 화면에 있는 것이다.
|
||||
*/
|
||||
const principles = [
|
||||
{
|
||||
title: "관찰한 사실과 판단을 나눕니다",
|
||||
title: "확인한 것과 확인하지 않은 것",
|
||||
description:
|
||||
"측정값, 문서 근거, 아직 확인하지 못한 가정을 같은 문장에 섞지 않습니다.",
|
||||
"잰 값, 문서에서 읽은 것, 아직 확인하지 못한 가정을 각각 다른 칸에 적습니다.",
|
||||
},
|
||||
{
|
||||
title: "결론보다 경계를 남깁니다",
|
||||
title: "결론이 서는 조건",
|
||||
description:
|
||||
"어떤 조건에서 선택했고 어디까지 적용할 수 있는지 함께 기록합니다.",
|
||||
"어떤 환경에서 나온 결론인지, 어디까지 적용되는지를 결론과 같은 자리에 적습니다.",
|
||||
},
|
||||
{
|
||||
title: "프로젝트 맥락으로 다시 연결합니다",
|
||||
title: "주제와 프로젝트로 되짚는 길",
|
||||
description:
|
||||
"검증 기록과 적용 기준, 열린 질문, 설계 결정이 따로 흩어지지 않게 실제 작업과 연결합니다.",
|
||||
"기록마다 주제와 프로젝트를 답니다. 주제에서는 접근을 나눠 견주고, 프로젝트에서는 결정의 순서로 읽습니다.",
|
||||
},
|
||||
] as const;
|
||||
|
||||
@@ -58,7 +67,7 @@ export function ProfilePage() {
|
||||
<section className="profile-principles" aria-labelledby="principles-title">
|
||||
<div>
|
||||
<p className="section-kicker">Principles</p>
|
||||
<h2 id="principles-title">기록을 운영하는 원칙</h2>
|
||||
<h2 id="principles-title">기록을 쓰는 방식</h2>
|
||||
</div>
|
||||
<ol>
|
||||
{principles.map((principle, index) => (
|
||||
|
||||
@@ -10,6 +10,19 @@ import { GuardedStudioLink } from "./guarded-studio-link.tsx";
|
||||
import { useStudio } from "../use-studio.ts";
|
||||
|
||||
|
||||
/**
|
||||
* 고른 프로젝트의 slug.
|
||||
*
|
||||
* <p>질문 목록은 프로젝트를 slug 로만 알려 준다(계약의 `ProjectSummary` 에 id 가 없다). 그래서
|
||||
* 고른 프로젝트에서 slug 를 얻어야 하는데, 목록 항목이 주는 것은 `publication.canonicalPath` 뿐이고
|
||||
* 그것은 게시된 적이 있어야 채워진다 — 아직 게시하지 않은 프로젝트를 고르면 걸러 낼 수가 없다.
|
||||
* 그때는 거르지 않는다; 잘못 거르면 있는 질문이 사라져 보인다.
|
||||
*/
|
||||
function projectSlug(projects: readonly ProjectIndexItem[], projectId: string) {
|
||||
const path = projects.find((project) => project.id === projectId)?.publication.canonicalPath;
|
||||
return path?.split("/").filter(Boolean).pop();
|
||||
}
|
||||
|
||||
/**
|
||||
* 공개 홈의 "지금 집중하는 것" 을 정하는 화면.
|
||||
*
|
||||
@@ -33,7 +46,8 @@ export function HomeFocusEditor() {
|
||||
const [decisionId, setDecisionId] = useState("");
|
||||
const [projectQuestions, setProjectQuestions] = useState<{ id: string; label: string }[]>([]);
|
||||
/** 고를 목록을 못 읽었다. 「없다」와 구분해야 작성자가 자기 글이 사라진 줄 알지 않는다. */
|
||||
const [choicesFailed, setChoicesFailed] = useState(false);
|
||||
const [questionsFailed, setQuestionsFailed] = useState(false);
|
||||
const [decisionsFailed, setDecisionsFailed] = useState(false);
|
||||
const [projectDecisions, setProjectDecisions] = useState<{ id: string; label: string }[]>([]);
|
||||
const [pending, setPending] = useState(false);
|
||||
const [error, setError] = useState("");
|
||||
@@ -80,35 +94,32 @@ export function HomeFocusEditor() {
|
||||
if (!projectId) {
|
||||
setProjectQuestions([]);
|
||||
setProjectDecisions([]);
|
||||
setQuestionsFailed(false);
|
||||
setDecisionsFailed(false);
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}
|
||||
/*
|
||||
둘을 따로 읽는다. `Promise.all` 로 묶었더니 결정 쪽이 500 을 내는 동안 질문까지 함께
|
||||
실패로 처리돼, 멀쩡히 오던 질문 목록도 「불러오지 못했습니다」가 됐다 — 한 칸의 실패가
|
||||
옆 칸을 끌고 내려가지 않게 한다.
|
||||
*/
|
||||
void (async () => {
|
||||
try {
|
||||
const [questionPage, decisionList] = await Promise.all([
|
||||
managementGateway.listQuestions(0, 100),
|
||||
managementGateway.listProjectDecisions(projectId),
|
||||
]);
|
||||
const questionPage = await managementGateway.listQuestions(0, 100);
|
||||
if (cancelled) return;
|
||||
/*
|
||||
질문 항목은 프로젝트를 slug 로 알려 준다(계약의 `ProjectSummary` 에는 id 가 없다).
|
||||
그래서 고른 프로젝트의 slug 와 맞춘다.
|
||||
*/
|
||||
const chosenSlug = projects
|
||||
.find((project) => project.id === projectId)
|
||||
?.publication.canonicalPath?.split("/")
|
||||
.filter(Boolean)
|
||||
.pop();
|
||||
const chosenSlug = projectSlug(projects, projectId);
|
||||
setProjectQuestions(
|
||||
(questionPage.items ?? [])
|
||||
.filter((item) => !chosenSlug || item.primaryProject?.slug === chosenSlug)
|
||||
.map((item) => ({ id: item.id, label: item.question })),
|
||||
);
|
||||
setProjectDecisions(
|
||||
decisionList.map((item) => ({ id: item.id, label: item.statement })),
|
||||
);
|
||||
setChoicesFailed(false);
|
||||
setQuestionsFailed(false);
|
||||
} catch {
|
||||
/*
|
||||
못 읽은 것과 없는 것은 다르다. 예전에는 둘 다 빈 배열이 되어 화면이 「이 프로젝트에
|
||||
@@ -117,8 +128,23 @@ export function HomeFocusEditor() {
|
||||
*/
|
||||
if (!cancelled) {
|
||||
setProjectQuestions([]);
|
||||
setQuestionsFailed(true);
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
void (async () => {
|
||||
try {
|
||||
const decisionList = await managementGateway.listProjectDecisions(projectId);
|
||||
if (cancelled) return;
|
||||
setProjectDecisions(
|
||||
decisionList.map((item) => ({ id: item.id, label: item.statement })),
|
||||
);
|
||||
setDecisionsFailed(false);
|
||||
} catch {
|
||||
if (!cancelled) {
|
||||
setProjectDecisions([]);
|
||||
setChoicesFailed(true);
|
||||
setDecisionsFailed(true);
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -236,7 +262,7 @@ export function HomeFocusEditor() {
|
||||
</select>
|
||||
{questions.length === 0 ? (
|
||||
<small>
|
||||
{choicesFailed
|
||||
{questionsFailed
|
||||
? "열린 질문을 불러오지 못했습니다. 새로고침해 주세요."
|
||||
: projectId
|
||||
? "이 프로젝트에 열린 질문이 없습니다."
|
||||
@@ -261,7 +287,7 @@ export function HomeFocusEditor() {
|
||||
</select>
|
||||
{decisions.length === 0 ? (
|
||||
<small>
|
||||
{choicesFailed
|
||||
{decisionsFailed
|
||||
? "결정을 불러오지 못했습니다. 새로고침해 주세요."
|
||||
: projectId
|
||||
? "이 프로젝트에 결정이 없습니다."
|
||||
|
||||
@@ -394,9 +394,9 @@ describe("TechLog release and profile screens", () => {
|
||||
heading.textContent,
|
||||
),
|
||||
).toEqual([
|
||||
"관찰한 사실과 판단을 나눕니다",
|
||||
"결론보다 경계를 남깁니다",
|
||||
"프로젝트 맥락으로 다시 연결합니다",
|
||||
"확인한 것과 확인하지 않은 것",
|
||||
"결론이 서는 조건",
|
||||
"주제와 프로젝트로 되짚는 길",
|
||||
]);
|
||||
expect(
|
||||
Array.from(container.querySelectorAll(".profile-projects a"), (link) =>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 57 KiB |
Reference in New Issue
Block a user