From 361650246367a1464b794cbd84015476257bfadd Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Tue, 1 Sep 2026 17:01:36 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=A3=BC=EC=A0=9C=EC=9D=98=20=EB=85=BC?= =?UTF-8?q?=EC=A7=80=EC=99=80=20=EC=B6=95=EC=9D=84=20Studio=20=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=93=B8=20=EC=88=98=20=EC=9E=88=EA=B2=8C=20?= =?UTF-8?q?=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 「주제·프로젝트」 화면은 주제를 만들고 지울 수만 있었다. 이름과 slug 말고는 쓸 자리가 없어, 주제가 답하는 질문(논지)도 축의 이름도 어디에도 적을 수 없었다 — 공개 주제 화면이 그 둘을 읽는데 쓸 곳이 없으니 늘 비어 있었다. 주제 편집 화면을 프로젝트 편집기와 같은 자리·같은 클래스로 둔다. 축(variant)은 주제 안의 접근/구조 하나다. 인증 경계라면 SPA·BFF·Mediator 가 각각 하나고, 각자 만들어 보고 무엇을 알게 됐는지가 다르다. 비교표가 읽는 것은 요약이 아니라 그 결론이라, 두 칸을 따로 둔다 — 기록의 요약 첫 줄을 잘라 쓰면 안 되는 자리다. 프로젝트에도 논지 칸을 둔다. 목적은 시작할 때 쓰는 글이고 논지는 끝나고 쓰는 글이다. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_011nAjrqNHGPNngN4aUbcyvJ --- .../adapters/http/http-management-gateway.ts | 10 + .../application/ports/management-gateway.ts | 13 + .../tech-log/contracts/management/contract.ts | 1 + .../contracts/tech-log-route-contract.ts | 1 + .../studio/components/project-editor.tsx | 18 + .../studio/components/taxonomy-manager.tsx | 15 +- .../studio/components/topic-editor.tsx | 426 ++++++++++++++++++ .../studio/pages/topic-edit-page.tsx | 5 + .../presentation/tech-log-route-runtime.tsx | 7 + .../features/tech-log/route-contract.test.ts | 4 +- 10 files changed, 498 insertions(+), 2 deletions(-) create mode 100644 src/features/tech-log/presentation/studio/components/topic-editor.tsx create mode 100644 src/features/tech-log/presentation/studio/pages/topic-edit-page.tsx diff --git a/src/features/tech-log/adapters/http/http-management-gateway.ts b/src/features/tech-log/adapters/http/http-management-gateway.ts index 520cbe4..43313bb 100644 --- a/src/features/tech-log/adapters/http/http-management-gateway.ts +++ b/src/features/tech-log/adapters/http/http-management-gateway.ts @@ -15,6 +15,7 @@ import type { ReleaseIndexPage, ReleaseUpdateRequest, TopicEdit, + TopicVariantEdit, } from "../../contracts/management/contract.ts"; import type { DeletableDocumentKind, @@ -77,6 +78,15 @@ export function createHttpManagementGateway( listTopics: () => run("listStudioTopics", {}), createTopic: (input: TopicEdit) => run("createTopic", input), updateTopic: (id: string, body: TopicEdit) => run("updateTopic", { id, body }), + listTopicVariants: (topicId: string) => + run("listTopicVariants", { id: topicId }), + createTopicVariant: (topicId: string, body: TopicVariantEdit) => + run("createTopicVariant", { id: topicId, body }), + updateTopicVariant: (topicId: string, variantId: string, body: TopicVariantEdit) => + run("updateTopicVariant", { id: topicId, variantId, body }), + deleteTopicVariant: async (topicId: string, variantId: string, expectedVersion: number) => { + await run("deleteTopicVariant", { id: topicId, variantId, expectedVersion }); + }, deleteTopic: async (id: string, expectedVersion: number) => { await run("deleteTopic", { id, expectedVersion }); }, diff --git a/src/features/tech-log/application/ports/management-gateway.ts b/src/features/tech-log/application/ports/management-gateway.ts index 6f411ab..0196fcf 100644 --- a/src/features/tech-log/application/ports/management-gateway.ts +++ b/src/features/tech-log/application/ports/management-gateway.ts @@ -15,6 +15,7 @@ import type { ReleaseIndexPage, ReleaseUpdateRequest, TopicEdit, + TopicVariantEdit, } from "../../contracts/management/contract.ts"; /** @@ -32,6 +33,18 @@ export type ManagementGateway = Readonly<{ createTopic(input: TopicEdit): Promise; updateTopic(id: string, body: TopicEdit): Promise; deleteTopic(id: string, expectedVersion: number): Promise; + /* + 주제 안의 축. 「구조」「조회 전략」처럼 주제마다 이름이 다른 축 하나가 접근 하나고, 기록은 + 거기에 걸린다. 아무 축에도 걸리지 않은 기록은 그 주제의 공통 기록이다. + */ + listTopicVariants(topicId: string): Promise; + createTopicVariant(topicId: string, body: TopicVariantEdit): Promise; + updateTopicVariant( + topicId: string, + variantId: string, + body: TopicVariantEdit, + ): Promise; + deleteTopicVariant(topicId: string, variantId: string, expectedVersion: number): Promise; listProjects(page?: number, size?: number): Promise; /* 홈 「지금 집중하는 것」 편집기가 쓰는 둘. 질문 항목은 `primaryProject` 를 들고 오므로 그것으로 diff --git a/src/features/tech-log/contracts/management/contract.ts b/src/features/tech-log/contracts/management/contract.ts index 7743689..5f916bc 100644 --- a/src/features/tech-log/contracts/management/contract.ts +++ b/src/features/tech-log/contracts/management/contract.ts @@ -3,6 +3,7 @@ import type { components } from "./generated.ts"; type Schemas = components["schemas"]; export type TopicEdit = Schemas["TopicEdit"]; +export type TopicVariantEdit = Schemas["TopicVariantEdit"]; export type ProjectEditResponse = Schemas["ProjectEditResponse"]; export type ProjectIndexItem = Schemas["ProjectIndexItem"]; export type ProjectIndexPage = Schemas["ProjectIndexPage"]; diff --git a/src/features/tech-log/contracts/tech-log-route-contract.ts b/src/features/tech-log/contracts/tech-log-route-contract.ts index 2512be6..08c510b 100644 --- a/src/features/tech-log/contracts/tech-log-route-contract.ts +++ b/src/features/tech-log/contracts/tech-log-route-contract.ts @@ -56,6 +56,7 @@ const TECH_LOG_ROUTE_SPECS = [ defineSpec({ routeId: "TECH_LOG_STUDIO_ASSETS", path: "/studio/assets", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "Asset", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_STUDIO_TAXONOMY", path: "/studio/taxonomy", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "주제와 프로젝트", navigationLabel: "주제·프로젝트", navigationOrder: 40 }), defineSpec({ routeId: "TECH_LOG_STUDIO_PROJECT_EDIT", path: "/studio/projects/:id", layoutGroup: "STUDIO", paramsSchema: "TechLogDocumentIdParams", searchSchema: null, title: "프로젝트 편집", navigationLabel: null, navigationOrder: null }), + defineSpec({ routeId: "TECH_LOG_STUDIO_TOPIC_EDIT", path: "/studio/topics/:id", layoutGroup: "STUDIO", paramsSchema: "TechLogDocumentIdParams", searchSchema: null, title: "주제 편집", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_STUDIO_RELEASES", path: "/studio/releases", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "릴리즈", navigationLabel: "릴리즈", navigationOrder: 50 }), defineSpec({ routeId: "TECH_LOG_STUDIO_RELEASE_EDIT", path: "/studio/releases/:id", layoutGroup: "STUDIO", paramsSchema: "TechLogDocumentIdParams", searchSchema: null, title: "릴리즈 편집", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_STUDIO_NOT_FOUND", path: "/studio/*", layoutGroup: "STUDIO", paramsSchema: "TechLogStudioSplat", searchSchema: null, title: "Studio 화면을 찾을 수 없습니다", navigationLabel: null, navigationOrder: null }), diff --git a/src/features/tech-log/presentation/studio/components/project-editor.tsx b/src/features/tech-log/presentation/studio/components/project-editor.tsx index d4489aa..b87c561 100644 --- a/src/features/tech-log/presentation/studio/components/project-editor.tsx +++ b/src/features/tech-log/presentation/studio/components/project-editor.tsx @@ -66,6 +66,7 @@ type Draft = { name: string; slug: string; oneLinePurpose: string; + thesis: string; purposeMarkdown: string; boundaryMarkdown: string; systemOverviewMarkdown: string; @@ -81,6 +82,7 @@ function toDraft(project: ProjectEditResponse): Draft { name: project.name, slug: project.slug ?? "", oneLinePurpose: project.oneLinePurpose ?? "", + thesis: project.thesis ?? "", purposeMarkdown: project.purposeMarkdown ?? "", boundaryMarkdown: project.boundaryMarkdown ?? "", systemOverviewMarkdown: project.systemOverviewMarkdown ?? "", @@ -175,6 +177,7 @@ export function ProjectEditor() { name: draft.name.trim(), slug: draft.slug.trim() || slugFromName(draft.name), oneLinePurpose: draft.oneLinePurpose, + thesis: draft.thesis, purposeMarkdown: draft.purposeMarkdown, boundaryMarkdown: draft.boundaryMarkdown, systemOverviewMarkdown: draft.systemOverviewMarkdown, @@ -300,6 +303,21 @@ export function ProjectEditor() { onChange={(event) => update({ oneLinePurpose: event.currentTarget.value })} /> + {/* + 목적은 시작할 때 쓰는 글이고 논지는 끝나고 쓰는 글이다. 담을 칸이 없어 공개 + 화면은 목적을 대신 보여 줬고, 그래서 프로젝트 화면에는 늘 시작할 때의 말만 + 남았다. + */} +