diff --git a/src/features/tech-log/adapters/static/public-content.ts b/src/features/tech-log/adapters/static/public-content.ts index 270bd52..f811f37 100644 --- a/src/features/tech-log/adapters/static/public-content.ts +++ b/src/features/tech-log/adapters/static/public-content.ts @@ -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"], diff --git a/src/features/tech-log/presentation/public/pages/profile-page.tsx b/src/features/tech-log/presentation/public/pages/profile-page.tsx index 70c94c4..1c52357 100644 --- a/src/features/tech-log/presentation/public/pages/profile-page.tsx +++ b/src/features/tech-log/presentation/public/pages/profile-page.tsx @@ -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() {

Principles

-

기록을 운영하는 원칙

+

기록을 쓰는 방식

    {principles.map((principle, index) => ( diff --git a/src/features/tech-log/presentation/studio/components/home-focus-editor.tsx b/src/features/tech-log/presentation/studio/components/home-focus-editor.tsx index ba54226..b181b5a 100644 --- a/src/features/tech-log/presentation/studio/components/home-focus-editor.tsx +++ b/src/features/tech-log/presentation/studio/components/home-focus-editor.tsx @@ -10,6 +10,19 @@ import { GuardedStudioLink } from "./guarded-studio-link.tsx"; import { useStudio } from "../use-studio.ts"; +/** + * 고른 프로젝트의 slug. + * + *

    질문 목록은 프로젝트를 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() { {questions.length === 0 ? ( - {choicesFailed + {questionsFailed ? "열린 질문을 불러오지 못했습니다. 새로고침해 주세요." : projectId ? "이 프로젝트에 열린 질문이 없습니다." @@ -261,7 +287,7 @@ export function HomeFocusEditor() { {decisions.length === 0 ? ( - {choicesFailed + {decisionsFailed ? "결정을 불러오지 못했습니다. 새로고침해 주세요." : projectId ? "이 프로젝트에 결정이 없습니다." diff --git a/tests/features/tech-log/public-index-screens.test.tsx b/tests/features/tech-log/public-index-screens.test.tsx index 55c1e77..d9cbdd2 100644 --- a/tests/features/tech-log/public-index-screens.test.tsx +++ b/tests/features/tech-log/public-index-screens.test.tsx @@ -394,9 +394,9 @@ describe("TechLog release and profile screens", () => { heading.textContent, ), ).toEqual([ - "관찰한 사실과 판단을 나눕니다", - "결론보다 경계를 남깁니다", - "프로젝트 맥락으로 다시 연결합니다", + "확인한 것과 확인하지 않은 것", + "결론이 서는 조건", + "주제와 프로젝트로 되짚는 길", ]); expect( Array.from(container.querySelectorAll(".profile-projects a"), (link) => diff --git a/topics-list.png b/topics-list.png new file mode 100644 index 0000000..6b73dbc Binary files /dev/null and b/topics-list.png differ