diff --git a/src/contracts/route-runtime-contract.ts b/src/contracts/route-runtime-contract.ts index 495d1ac..874c479 100644 --- a/src/contracts/route-runtime-contract.ts +++ b/src/contracts/route-runtime-contract.ts @@ -14,7 +14,9 @@ export type RouteCodecId = | "TechLogExploreSearch" | "TechLogExploreKindSearch" | "TechLogSearchQuery" - | "TechLogCaseStateSearch"; + | "TechLogCaseStateSearch" + | "TechLogStudioDocumentsSearch" + | "TechLogStudioPublicationsSearch"; export type RouteRuntimeDefinition = Readonly<{ routeId: string; moduleId: string; diff --git a/src/features/tech-log/application/ports/studio-gateway.ts b/src/features/tech-log/application/ports/studio-gateway.ts index 57125e1..f2cf2dd 100644 --- a/src/features/tech-log/application/ports/studio-gateway.ts +++ b/src/features/tech-log/application/ports/studio-gateway.ts @@ -1,5 +1,6 @@ import type { CatalogPage, CreateDocumentInput, CreatePreviewCommand, DocumentPage, + RecordKind, PublicationPage, PublicationSnapshot, PublicPreview, PublishDocumentCommand, PreviewDetail, PublishResult, SaveDocumentCommand, StudioDashboard, UnpublishCommand, ValidationReport, ValidateDocumentCommand, WorkingCopy, WorkingCopyDetail, @@ -8,7 +9,12 @@ import type { export type RequestOptions = { signal?: AbortSignal }; export type IdempotentOptions = RequestOptions & { idempotencyKey: string }; export type ListDocumentsQuery = { - q?: string; kind?: "CASE" | "REFERENCE" | "QUESTION" | "PROJECT_DECISION"; + /* + 종류는 계약의 `RecordKind` 를 그대로 쓴다. 여기 손으로 적어 두었던 동안 개념과 환경 구성이 + 빠져 있었고, 작업본 목록의 종류 필터는 그 둘을 아예 고를 수 없었다 — 손으로 나열한 목록에 + 새 종류를 빠뜨리는 일이 이 저장소에서 반복됐다. + */ + q?: string; kind?: RecordKind; publicationStatus?: "NEVER_PUBLISHED" | "PUBLISHED" | "UNPUBLISHED"; nextAction?: "CONTINUE_EDITING" | "VALIDATE" | "FIX_VALIDATION" | "CREATE_PREVIEW" | "PUBLISH" | "NONE"; projectId?: string; sort?: "UPDATED_DESC" | "UPDATED_ASC" | "TITLE_ASC"; 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 c2b11fb..5388f28 100644 --- a/src/features/tech-log/contracts/tech-log-route-contract.ts +++ b/src/features/tech-log/contracts/tech-log-route-contract.ts @@ -48,13 +48,13 @@ const TECH_LOG_ROUTE_SPECS = [ defineSpec({ routeId: "TECH_LOG_PROFILE", path: "/profile", layoutGroup: "PUBLIC", paramsSchema: null, searchSchema: null, title: "프로필", navigationLabel: "프로필", navigationOrder: 40 }), defineSpec({ routeId: "TECH_LOG_SEARCH", path: "/search", layoutGroup: "PUBLIC", paramsSchema: null, searchSchema: "TechLogSearchQuery", title: "검색", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_STUDIO_HOME", path: "/studio", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "TechLog Studio", navigationLabel: null, navigationOrder: null }), - defineSpec({ routeId: "TECH_LOG_STUDIO_DOCUMENTS", path: "/studio/documents", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "작업본", navigationLabel: "작업본", navigationOrder: 10 }), + defineSpec({ routeId: "TECH_LOG_STUDIO_DOCUMENTS", path: "/studio/documents", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: "TechLogStudioDocumentsSearch", title: "작업본", navigationLabel: "작업본", navigationOrder: 10 }), defineSpec({ routeId: "TECH_LOG_STUDIO_DOCUMENT_NEW", path: "/studio/documents/new", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "새 문서", navigationLabel: "새 문서", navigationOrder: 30 }), defineSpec({ routeId: "TECH_LOG_STUDIO_DOCUMENT_EDIT", path: "/studio/documents/:id/edit", layoutGroup: "STUDIO", paramsSchema: "TechLogDocumentIdParams", searchSchema: null, title: "문서 편집", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_STUDIO_DOCUMENT_VALIDATION", path: "/studio/documents/:id/validation", layoutGroup: "STUDIO", paramsSchema: "TechLogDocumentIdParams", searchSchema: null, title: "문서 검증", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_STUDIO_DOCUMENT_PREVIEW", path: "/studio/documents/:id/preview", layoutGroup: "STUDIO", paramsSchema: "TechLogDocumentIdParams", searchSchema: null, title: "Public Preview", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_STUDIO_DOCUMENT_PUBLISH", path: "/studio/documents/:id/publish", layoutGroup: "STUDIO", paramsSchema: "TechLogDocumentIdParams", searchSchema: null, title: "게시", navigationLabel: null, navigationOrder: null }), - defineSpec({ routeId: "TECH_LOG_STUDIO_PUBLICATIONS", path: "/studio/publications", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "게시 기록", navigationLabel: "게시 기록", navigationOrder: 20 }), + defineSpec({ routeId: "TECH_LOG_STUDIO_PUBLICATIONS", path: "/studio/publications", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: "TechLogStudioPublicationsSearch", title: "게시 기록", navigationLabel: "게시 기록", navigationOrder: 20 }), defineSpec({ routeId: "TECH_LOG_STUDIO_PUBLICATION_PREVIEW", path: "/studio/publications/:publicationEventId/preview", layoutGroup: "STUDIO", paramsSchema: "TechLogPublicationEventIdParams", searchSchema: null, title: "게시 Snapshot", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_STUDIO_ASSETS", path: "/studio/assets", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "Asset", navigationLabel: "Asset", navigationOrder: 45 }), defineSpec({ routeId: "TECH_LOG_STUDIO_TAXONOMY", path: "/studio/taxonomy", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "주제와 프로젝트", navigationLabel: "주제·프로젝트", navigationOrder: 40 }), @@ -139,6 +139,16 @@ export const TECH_LOG_ROUTE_SCHEMA_REGISTRY = Object.freeze({ "route-search", "STRIP_UNKNOWN", ), + TechLogStudioDocumentsSearch: routeSchema( + "TechLogStudioDocumentsSearch", + "route-search", + "STRIP_UNKNOWN", + ), + TechLogStudioPublicationsSearch: routeSchema( + "TechLogStudioPublicationsSearch", + "route-search", + "STRIP_UNKNOWN", + ), }); function chunkId(routeId: TechLogRouteId): string { diff --git a/src/features/tech-log/presentation/public/components/home-topic-tabs.tsx b/src/features/tech-log/presentation/public/components/home-topic-tabs.tsx index 21aa120..b832cb1 100644 --- a/src/features/tech-log/presentation/public/components/home-topic-tabs.tsx +++ b/src/features/tech-log/presentation/public/components/home-topic-tabs.tsx @@ -77,7 +77,30 @@ export function HomeTopicTabs({ if (!active) return null; const detail = details[active.slug]; - const axisLabel = (detail?.variantLabel ?? active.variantLabel).trim(); + /* + 축을 쓰는 주제는 축끼리 견주고, 아직 쓰지 않는 주제는 그 주제의 기록을 세운다. + + 예전에는 축이 둘 이상인 주제만 탭이 됐고 나머지는 목록 아래 한 줄짜리 링크로 갔다. 축은 + 주제가 자라면서 생기는 것이지 기록이 없다는 뜻이 아니다 — 축이 없다고 이름을 숨길 이유가 + 없다. + */ + const rows: ReadonlyArray<{ path: string; title: string; line: string }> = detail + ? detail.variants.length > 1 + ? detail.variants.map((variant) => ({ + path: variant.path, + title: variant.title, + line: variant.conclusion || variant.summary, + })) + : detail.featuredCases.map((record) => ({ + path: record.path, + title: record.title, + line: record.summary || record.note, + })) + : []; + const comparing = (detail?.variants.length ?? 0) > 1; + const axisLabel = comparing + ? (detail?.variantLabel ?? active.variantLabel).trim() + : "기록"; const multiple = topics.length > 1; return ( @@ -103,7 +126,12 @@ export function HomeTopicTabs({ type="button" role={multiple ? "tab" : undefined} aria-selected={multiple ? selected : undefined} - aria-controls="home-topic-panel" + /* + 패널은 하나뿐이라 고른 탭만 그것을 가리킨다. 탭 전부가 같은 패널을 가리키면 + 고르지 않은 탭이 "내가 저 패널을 연다" 고 말하면서 패널은 다른 탭의 이름을 + 달고 있게 된다 — 화면 읽기 프로그램에게 서로 어긋난 두 문장이다. + */ + aria-controls={selected ? "home-topic-panel" : undefined} tabIndex={multiple && !selected ? -1 : 0} onClick={() => select(topic.slug)} onKeyDown={onKeyDown} @@ -136,21 +164,25 @@ export function HomeTopicTabs({ {`${active.name} 전체 보기`} - {detail ? ( + {detail && rows.length > 0 ? (
{variant.conclusion || variant.summary}
+{row.line}
+ {`${active.name}에는 아직 공개된 기록이 없습니다.`} +
) : ({failedSlug === active.slug diff --git a/src/features/tech-log/presentation/public/pages/home-page.tsx b/src/features/tech-log/presentation/public/pages/home-page.tsx index 95dbf05..df37639 100644 --- a/src/features/tech-log/presentation/public/pages/home-page.tsx +++ b/src/features/tech-log/presentation/public/pages/home-page.tsx @@ -140,20 +140,28 @@ function dateLabel(isoTimestamp: string): string { */ async function getTopics(publicContent: PublicContentQueries) { const topics = await publicContent.listTopics(); - // 목록의 순서는 서버가 정한다. 「가장 많이 다룬」은 여기서 직접 골라야 하는 것이고, - // 첫 항목을 쓰면 기록 3편짜리 주제가 18편짜리를 제치고 홈에 오른다. - const comparable = [...topics] - .filter((topic) => topic.variantCount > 1) - .sort((left, right) => right.recordCount - left.recordCount); - const first = comparable[0]; + /* + 주제는 전부 탭에 오른다. + + 한때 축이 둘 이상인 주제만 탭이 되고 나머지는 목록 아래 「다른 주제 N개 보기」 한 줄로 + 갔다. 그 줄은 없애려던 바로 그 줄이다 — 읽는 사람은 비교표를 다 읽고 나서야 다른 주제가 + 있다는 것을 알았고, 대개 거기까지 가지 않았다. + + 기록이 아직 없는 주제도 세운다. 주제를 만든다는 것은 앞으로 그것을 쓰겠다는 선언이고, + 그 선언이 홈에 먼저 서 있는 편이 이 사이트가 무엇을 다루는지 말해 준다. 대신 그 탭을 + 누르면 「아직 공개된 기록이 없습니다」라고 분명히 말한다 — 빈 목록으로 두지 않는다. + + 순서는 기록이 많은 것부터다. 서버가 주는 순서를 그대로 쓰면 기록 3편짜리가 18편짜리를 + 제치고 홈의 첫 화면에 오른다. + */ + const ordered = [...topics].sort((left, right) => right.recordCount - left.recordCount); + const first = ordered[0]; const firstDetail = first ? await publicContent.getTopicDetail(first.slug) : undefined; return { - /** 탭 하나씩. 축이 둘 이상이어야 견줄 것이 있다. */ - tabs: comparable, + /** 탭 하나씩. 주제 전부다. */ + tabs: ordered, /** 처음 열려 있을 주제. 이것만 미리 받는다. */ - firstDetail: firstDetail && firstDetail.variants.length > 1 ? firstDetail : undefined, - /** 축이 없어 탭이 되지 못한 주제 수. 있으면 주제 목록으로 가는 길을 남긴다. */ - remaining: topics.length - comparable.length, + firstDetail, }; } @@ -195,6 +203,27 @@ export function HomePage() {
{publicSiteConfig.identityStatement}
+ {/* + 30초 안에 알아야 할 것은 「무엇을 만들었나」가 아니라 「무엇을 견줬고 무엇이 남았나」다. + 축마다 만들어 보고 무엇을 알게 됐는지(결론)를 나란히 둔다 — 요약을 쓰면 무엇인가만 + 말하고 무엇을 알게 됐는지는 말하지 않는다. + + 이 구역이 첫 화면에 온다. 예전에는 제품명 한 줄과 일반적인 문장이 상단 300px 을 쓰고 + 그 아래 130px 이 빈 공간이었으며, 이 사이트에서 다른 데서 얻을 수 없는 유일한 것 — + 네 구조를 나란히 견주는 표 — 이 y≈600 에 11px 회색으로 묻혀 있었다. 스크롤할 이유를 + 주는 것이 그 표다. + + 제목 자리에는 주제 이름들이 탭으로 선다. 「구조별로 알게 된 것」 한 줄이 서 있던 동안 + 홈이 펴 두는 주제는 하나였고, 나머지로 가는 길은 목록 밑 작은 글씨 한 줄뿐이었다 — + 무엇이 더 있는지는 다 읽고 나서야 알 수 있었다. 이름을 나란히 세우면 목록을 읽기 + 전에 먼저 보인다. + */} + {topics.firstDetail ? ( +@@ -208,32 +237,6 @@ export function HomePage() {
- {`다른 주제 ${topics.remaining}개 보기`} -
- ) : null} -{project.currentGoal}
+ {project.currentGoal ?{project.currentGoal}
: null} diff --git a/src/features/tech-log/presentation/public/pages/project-overview-page.tsx b/src/features/tech-log/presentation/public/pages/project-overview-page.tsx index 3dde488..55873ac 100644 --- a/src/features/tech-log/presentation/public/pages/project-overview-page.tsx +++ b/src/features/tech-log/presentation/public/pages/project-overview-page.tsx @@ -1,4 +1,5 @@ import { Link } from "react-router-dom"; +import { projectStageLabel } from "../../shared/project-phase-labels.ts"; import { RegisteredNotFoundRoute, @@ -50,16 +51,21 @@ export function ProjectOverviewPage() {{project.summary}
-이 표가 없던 동안 공개 화면은 `DESIGN` 이라는 낱말을 그대로 그렸다. 한국어 화면의 영어 + * 단어였고, 같은 프로젝트를 Studio 는 「설계」로 불렀다 — 두 화면이 서로 다른 말을 했다. + * + *
Studio 와 공개 화면이 다루는 값 자체가 다르다. Studio 는 저장하는 단계 일곱을 그대로
+ * 쓰고(`project_phase_check`), 공개 조회는 그것을 둘로 접어 준다. 그래서 표도 둘이다 —
+ * 하나로 합치면 없는 값을 화면에 노출하거나 저장이 제약에서 터진다.
+ */
+export const PROJECT_PHASE_LABELS: Record `Record
@@ -374,7 +476,7 @@ export function DocumentList() {
- 이 화면의 작업본은 현재 Studio 세션에서만 유지됩니다. 세션이 끝나면 사라집니다.
-
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 3f0438e..28b920f 100644
--- a/src/features/tech-log/presentation/studio/components/project-editor.tsx
+++ b/src/features/tech-log/presentation/studio/components/project-editor.tsx
@@ -1,4 +1,5 @@
import { useCallback, useEffect, useState, type FormEvent } from "react";
+import { PROJECT_PHASE_LABELS } from "../../shared/project-phase-labels.ts";
import type { components } from "../../../contracts/studio/generated.ts";
import type {
@@ -21,15 +22,7 @@ function routeId(value: unknown): string {
}
/** `project_phase_check` 와 같은 집합이다 — 화면이 더 많은 값을 보여 주면 저장이 제약에서 터진다. */
-const PHASES = [
- { value: "RESEARCH", label: "조사" },
- { value: "DESIGN", label: "설계" },
- { value: "IMPLEMENTATION", label: "구현" },
- { value: "VERIFICATION", label: "검증" },
- { value: "MAINTENANCE", label: "유지" },
- { value: "PAUSED", label: "중단" },
- { value: "COMPLETED", label: "완료" },
-] as const;
+const PHASES = Object.entries(PROJECT_PHASE_LABELS).map(([value, label]) => ({ value, label }));
/** `project_activity_activity_type_check` 와 같은 집합이다. */
const ACTIVITY_TYPES = [
diff --git a/src/features/tech-log/presentation/studio/components/publication-list.tsx b/src/features/tech-log/presentation/studio/components/publication-list.tsx
index 9194ee7..0db14f5 100644
--- a/src/features/tech-log/presentation/studio/components/publication-list.tsx
+++ b/src/features/tech-log/presentation/studio/components/publication-list.tsx
@@ -1,4 +1,5 @@
-import { useEffect, useRef, useState, type FormEvent } from "react";
+import { type FormEvent, useEffect, useMemo, useRef, useState } from "react";
+import { useSearchParams } from "react-router-dom";
import {
isStudioGatewayError,
@@ -47,14 +48,43 @@ function snapshotHref(item: PublicationListItem) {
return null;
}
+/** 이벤트 필터가 받는 값. 주소에서 온 문자열을 이 목록으로 좁힌다. */
+const EVENT_TYPES = Object.freeze(["PUBLISHED", "REPUBLISHED", "UNPUBLISHED"] as const);
+
export function PublicationList({
classes: styles = defaultPublicationFlowClasses,
}: { classes?: PublicationFlowClasses } = {}) {
const studio = useStudio();
- const [query, setQuery] = useState 세 구역이 각각 ~150px 를 차지하면서 "없습니다" 를 말하고 있었다. 대시보드는 지금 무엇을
+ * 해야 하는지 보여 주는 자리인데, 화면의 절반이 할 일이 없다는 말이었다. 셋 다 비면 그
+ * 사실은 아래 「최근 게시」가 대신 말한다.
+ */
function WorkSection({
title,
items,
@@ -52,6 +59,7 @@ function WorkSection({
href: string;
empty: string;
}>) {
+ if (items.length === 0) return null;
return (
새 CSS 를 만들지 않는다. 작업본 목록이 쓰는 클래스만 재사용하므로 이 화면은 Studio 의
* 나머지와 같은 간격·타이포·색을 그대로 따른다.
*/
-/** 공개 프로젝트 화면과 같은 말을 쓴다 — 두 화면이 다른 낱말을 쓰면 같은 것인지 알기 어렵다. */
-const phaseLabel: Record최근 게시
@@ -205,6 +219,12 @@ export function StudioDashboard() {
)}