feat: 기록을 축에 걸고, 탐색을 주제로 묶는다
기록↔축 연결을 저장할 경로가 없었다. `record_variant` 는 공개 조회가 읽기만 할 뿐 아무도 쓰지 않았고, 계약의 `variantIds` 도 어디에도 닿지 않았다. 관계와 같은 「통째 교체」 방식으로 세 저장소(문서·질문·결정)에 배선한다 — 클라이언트가 보낸 배열이 곧 최종 상태이고, diff 를 뜨면 순서 재배열과 삭제를 구분하지 못한다. 문서 편집기에서 고른 주제의 축을 체크박스로 고른다. 축은 주제 안에서만 뜻이 있으므로 카탈로그에 섞지 않고 따로 읽는다. 아무 축에도 걸지 않아도 되고, 그 경우 이 기록은 그 주제의 공통 기록이 된다 — 빈 줄이 곧 「공통」이라 따로 표시하지 않는다. 탐색은 `type=CONCEPT` 을 조용히 버리고 있었다. 필터 폼은 개념을 고를 수 있게 하는데 화면 쪽 목록에는 개념이 없어서, 고르면 주소만 바뀌고 아무것도 걸리지 않았다. 목록을 손으로 적지 않고 `Record<RecordKind, …>` 에서 뽑아 컴파일러가 잡게 한다. 그리고 탐색을 주제로 묶는다. 게시 순서 한 줄로는 무엇이 있는지는 보여도 무엇에 대한 것들인지가 보이지 않아, 스무 편이 넘어가면 목록이 아니라 더미가 된다. 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
3616502463
commit
4da6d77c43
@@ -1,5 +1,6 @@
|
||||
import type { components } from "../../../contracts/studio/generated.ts";
|
||||
import type { Asset } from "../../../contracts/studio/contract.ts";
|
||||
import type { TopicVariantEdit } from "../../../contracts/management/contract.ts";
|
||||
import type { DocumentEditorController } from "./document-editor-controller.ts";
|
||||
import { CASE_FIELD_PATHS, CaseFields } from "./case-fields.tsx";
|
||||
import { CONCEPT_FIELD_PATHS, ConceptFields } from "./concept-fields.tsx";
|
||||
@@ -16,12 +17,15 @@ type CatalogEntry = components["schemas"]["CatalogEntry"];
|
||||
export function DocumentEditor({
|
||||
controller,
|
||||
catalog,
|
||||
variants,
|
||||
assets,
|
||||
onAssetsObserved,
|
||||
onAssetUploaded,
|
||||
}: {
|
||||
controller: DocumentEditorController;
|
||||
catalog: CatalogEntry[];
|
||||
/** 고른 주제의 축. 주제를 고르지 않았거나 축을 쓰지 않는 주제면 빈 목록이다. */
|
||||
variants: readonly TopicVariantEdit[];
|
||||
/** Owned by `DocumentEditorScreen` so the CASE editor's Picker/Upload and Instant Preview share one list. */
|
||||
assets: readonly Asset[];
|
||||
onAssetsObserved: (assets: readonly Asset[]) => void;
|
||||
@@ -68,7 +72,7 @@ export function DocumentEditor({
|
||||
<h1 id="studio-edit-title">문서 편집</h1>
|
||||
<p>{controller.draft.title || "제목 없는 작업본"}</p>
|
||||
</header>
|
||||
<CommonDocumentFields draft={controller.draft} topics={topics} projects={projects} relations={relations} issues={issues} onUpdate={controller.update} />
|
||||
<CommonDocumentFields draft={controller.draft} topics={topics} projects={projects} relations={relations} variants={variants} issues={issues} onUpdate={controller.update} />
|
||||
{controller.draft.kind === "CASE"
|
||||
? <CaseFields draft={controller.draft} issues={issues} onChange={controller.replace} onAssetsObserved={onAssetsObserved} onAssetUploaded={onAssetUploaded} />
|
||||
: controller.draft.kind === "CONCEPT"
|
||||
|
||||
Reference in New Issue
Block a user