feat: read the profile's topics from Studio, and add working-copy deletion

Two things an author could not control from Studio.

The profile's "주요 관심 주제" was four strings in the JSX. Creating or removing
a topic in Studio changed nothing, and correcting the list meant a rebuild and
a redeploy. It now renders the published topic list. The old literal opened
with "Backend Architecture", which no record in the catalogue actually carries
— the profile was advertising a topic that did not exist, and nothing could
have caught that while the list lived in the markup.

The working-copy list gained a delete control. It routes by kind because the
contract and the storage both do: Case and Reference share one table split by
type, Question is its own. Decision has no delete — its lifecycle is accept,
reject, supersede, which records what happened rather than erasing it — so the
control does not appear for it.

The list summary carries no version, so deletion reads the working copy first
and uses the version it finds. A stale version from a list left open should
fail as a conflict, not delete whatever is there now.
This commit is contained in:
DongHyeonka
2026-08-21 13:30:37 +09:00
parent ab8c6c14db
commit c5e8735041
15 changed files with 296 additions and 92 deletions
@@ -11,7 +11,7 @@ import type {
} from "../../contracts/management/contract.ts";
/**
* 주제·프로젝트·릴리즈 관리 표면.
* 주제·프로젝트·릴리즈·작업본 삭제 관리 표면.
*
* <p>Studio 게이트웨이와 같은 실패 규약이다 — 실패는 던지고, 화면이 잡는다. MOCK 대응물을 두지
* 않는 것도 의도다: 이 표면은 백엔드가 없으면 존재할 이유가 없고, 픽스처를 만들면 실제로는 만들
@@ -34,4 +34,10 @@ export type ManagementGateway = Readonly<{
deleteRelease(id: string, expectedVersion: number): Promise<void>;
publishRelease(id: string, expectedVersion: number): Promise<PublishResponse>;
archiveRelease(id: string, expectedVersion: number): Promise<ReleaseEditResponse>;
/**
* 작업본 삭제. 종류마다 다른 endpoint 인 것은 계약의 모양이자 저장 구조다 — Case 와 Reference
* 는 한 테이블을 나눠 쓰고 Question 은 다른 테이블이다. Decision 은 계약에 삭제가 없다:
* 그쪽 수명주기는 수락·기각·대체이고, 그건 지우는 것이 아니라 무슨 일이 있었는지 남기는 것이다.
*/
deleteDocument(kind: "CASE" | "REFERENCE" | "QUESTION", id: string, expectedVersion: number): Promise<void>;
}>;
@@ -132,6 +132,13 @@ export type Release = {
related: ReadonlyArray<{ title: string; path: string }>;
};
/** 계약 `TopicSummary`. 목록에 필요한 만큼만 옮긴다. */
export type PublicTopic = {
name: string;
slug: string;
recordCount: number;
};
export type FocusKey = "current" | "question" | "decision";
export type HomeFocusItem = {
@@ -190,6 +197,11 @@ export type PublicContentQueries = Readonly<{
getProjectRecords(projectSlug: string): Promise<PublicRecord[]>;
getProjectDecisions(projectSlug: string): Promise<ProjectDecision[]>;
getProjectActivity(projectSlug: string): Promise<ProjectActivity[]>;
/**
* 공개된 주제 목록. 프로필의 "주요 관심 주제"가 이 값을 그린다 — 그 목록은 코드에 박혀
* 있었고, Studio 에서 주제를 만들어도 바뀌지 않았다.
*/
listTopics(): Promise<PublicTopic[]>;
getHomeFocusItems(): Promise<HomeFocusItem[]>;
searchPublicContent(query: string): Promise<SearchablePublicEntity[]>;
}>;