diff --git a/artifacts/tests/a11y-manual/TECH_LOG_CONCEPT.md b/artifacts/tests/a11y-manual/TECH_LOG_CONCEPT.md new file mode 100644 index 0000000..e0e81d5 --- /dev/null +++ b/artifacts/tests/a11y-manual/TECH_LOG_CONCEPT.md @@ -0,0 +1,18 @@ +# TECH_LOG_CONCEPT accessibility review + +Status: pending-manual-review +Route ID: TECH_LOG_CONCEPT +Release ID: +Reviewer: +Reviewed at: +Signature: +Attestation: pending +M1 Keyboard: pending +M2 Visible focus: pending +M3 Route focus: pending +M4 Modal focus: pending +M5 Error association: pending +M6 Color signal: pending +M7 Reduced motion: pending +Screen reader: pending +Notes: Human review pending; automated evidence does not replace signed keyboard, focus, and screen-reader review. diff --git a/config/ci/gates.json b/config/ci/gates.json index 7629081..9dc9033 100644 --- a/config/ci/gates.json +++ b/config/ci/gates.json @@ -1070,6 +1070,12 @@ "schemaId": "markdown", "production": "source-controlled" }, + { + "id": "artifact-artifacts-tests-a11y-manual-TECH-LOG-CONCEPT-md", + "path": "artifacts/tests/a11y-manual/TECH_LOG_CONCEPT.md", + "schemaId": "markdown", + "production": "source-controlled" + }, { "id": "artifact-artifacts-tests-a11y-manual-TECH-LOG-QUESTION-md", "path": "artifacts/tests/a11y-manual/TECH_LOG_QUESTION.md", @@ -1952,6 +1958,7 @@ "artifact-artifacts-tests-a11y-manual-TECH-LOG-EXPLORE-KIND-md", "artifact-artifacts-tests-a11y-manual-TECH-LOG-CASE-md", "artifact-artifacts-tests-a11y-manual-TECH-LOG-REFERENCE-md", + "artifact-artifacts-tests-a11y-manual-TECH-LOG-CONCEPT-md", "artifact-artifacts-tests-a11y-manual-TECH-LOG-QUESTION-md", "artifact-artifacts-tests-a11y-manual-TECH-LOG-TOPIC-md", "artifact-artifacts-tests-a11y-manual-TECH-LOG-PROJECTS-md", diff --git a/scripts/contracts/ci-gates.ts b/scripts/contracts/ci-gates.ts index 1751c61..fff1243 100644 --- a/scripts/contracts/ci-gates.ts +++ b/scripts/contracts/ci-gates.ts @@ -444,6 +444,9 @@ export type LoadCiGateContractOptions = Readonly<{ }>; const CANONICAL_GATE_SHAPE_SHA256 = + // 개념(CONCEPT) 문서 종류: FE-GATE-009 가 TECH_LOG_CONCEPT 수동 접근성 증거를 얻어 다시 계산했다. + // 같은 방법으로 — 옛 gates.json 에서 이전 상수 fb138e7c… 를 먼저 재현해 계산이 맞는지 + // 확인한 뒤 새 파일을 해싱했다. // Template merge. Both sides carried a digest of their own gate set; neither // describes the merged one. Recomputed from the merged config/ci/gates.json. // Task 11: recomputed again after FE-GATE-009 gained the @@ -473,7 +476,7 @@ const CANONICAL_GATE_SHAPE_SHA256 = // 이 값을 만든 계산이 상수가 고정될 때 쓰인 그 계산임을 확인했다. // 릴리즈 편집 화면: 같은 방법으로 다시 계산했다. f9e7e521… 을 이전 gates.json 에서 먼저 // 재현했다. - "fb138e7c51fdf969f755cd8ff32cf627f1750b966d212c33ee996c8c578db0e3"; + "87a22f686ab8f80bd333811102b338e283dc6d25a114011d34f74ca554c58f2d"; function canonicalGateShapeSha256(gates: CiGateContract["gates"]): string { const normalized = gates.map( @@ -533,8 +536,10 @@ function canonicalAuthorityBaselineFailures(contract: CiGateContract): string[] // read those fields stop rendering blanks. // The release edit route followed: the editor used to open below the release // list, so editing meant scrolling past every release to reach it. - if (contract.artifacts.length !== 134) { - failures.push(`artifact authority baseline must contain exactly 134 artifacts; received ${contract.artifacts.length}`); + // 개념(CONCEPT) 문서 종류가 `/concepts/:slug` 를 더했다 — 설치된 라우트마다 수동 접근성 증거를 + // 하나씩 갖는 규칙이 그대로 적용된다. + if (contract.artifacts.length !== 135) { + failures.push(`artifact authority baseline must contain exactly 135 artifacts; received ${contract.artifacts.length}`); } if (contract.stages.length !== 5) { failures.push(`stage authority baseline must contain exactly 5 stages; received ${contract.stages.length}`); 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 24e04f5..a48940b 100644 --- a/src/features/tech-log/contracts/tech-log-route-contract.ts +++ b/src/features/tech-log/contracts/tech-log-route-contract.ts @@ -27,6 +27,7 @@ const TECH_LOG_ROUTE_SPECS = [ defineSpec({ routeId: "TECH_LOG_EXPLORE_KIND", path: "/explore/:kind", layoutGroup: "PUBLIC", paramsSchema: "TechLogExploreKindParams", searchSchema: "TechLogExploreKindSearch", title: "유형별 탐색", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_CASE", path: "/cases/:slug", layoutGroup: "PUBLIC", paramsSchema: "TechLogSlugParams", searchSchema: "TechLogCaseStateSearch", title: "Case", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_REFERENCE", path: "/references/:slug", layoutGroup: "PUBLIC", paramsSchema: "TechLogSlugParams", searchSchema: null, title: "Reference", navigationLabel: null, navigationOrder: null }), + defineSpec({ routeId: "TECH_LOG_CONCEPT", path: "/concepts/:slug", layoutGroup: "PUBLIC", paramsSchema: "TechLogSlugParams", searchSchema: null, title: "개념", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_QUESTION", path: "/questions/:slug", layoutGroup: "PUBLIC", paramsSchema: "TechLogSlugParams", searchSchema: null, title: "Open Question", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_TOPIC", path: "/topics/:slug", layoutGroup: "PUBLIC", paramsSchema: "TechLogSlugParams", searchSchema: null, title: "Topic", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_PROJECTS", path: "/projects", layoutGroup: "PUBLIC", paramsSchema: null, searchSchema: null, title: "프로젝트", navigationLabel: "프로젝트", navigationOrder: 20 }), diff --git a/src/features/tech-log/presentation/public/components/concept-document-page.tsx b/src/features/tech-log/presentation/public/components/concept-document-page.tsx new file mode 100644 index 0000000..83d91c2 --- /dev/null +++ b/src/features/tech-log/presentation/public/components/concept-document-page.tsx @@ -0,0 +1,81 @@ +import type { ConceptRecord } from "../../../application/ports/public-content-queries.ts"; +import { + parseCaseContent, + type CaseAuthoringBlock, +} from "../../../domain/content-format/parse-case-content.ts"; +import { resolveCaseEvidenceAssets } from "../../../domain/content-format/project-public-render-model.ts"; +import { PublicRecordRenderer } from "../../shared/public-render/public-record-renderer.tsx"; +import { publicRenderModelBase } from "./public-document-header.tsx"; + +/** + * 개념의 본문은 Case 와 같은 파서를 탄다 — `##` 소제목이 목차가 되고 `:::evidence` 가 도식을 + * 끌어온다. 아키텍처를 설명하는 글에 그림이 붙는 길이 그것뿐이다. + * + *

본문이 지원하지 않는 문법을 담고 있으면 화면 전체를 잃는 대신 빈 블록으로 돌아간다. + * 읽는 사람에게는 덜 정확한 화면이 빈 화면보다 낫다 — Case 가 쓰는 것과 같은 판단이다. + */ +function conceptBodyBlocks(record: ConceptRecord): CaseAuthoringBlock[] { + if (!record.content.trim()) return []; + try { + return parseCaseContent(record.content); + } catch { + return []; + } +} + +export function ConceptDocumentPage({ record }: { record: ConceptRecord }) { + /* + 본문은 evidence 를 key 로만 가리키고 `/media/{assetId}` 는 UUID 로만 서빙하므로, 계약이 함께 + 준 `bodyAssets` 로 key 를 주소로 바꾼다. 대응이 없는 key 는 그 블록을 지운다 — 해석기가 + 던지면 문서 전체가 사라지고, 남겨 두면 주소 없는 그림 자리가 남는다. + */ + const assetsByKey = new Map( + record.bodyAssets.map((asset) => [asset.assetKey, asset]), + ); + const blocks = conceptBodyBlocks(record).filter( + (block) => block.type !== "EVIDENCE_FIGURE" || assetsByKey.has(block.key), + ); + + const model = resolveCaseEvidenceAssets( + { + ...publicRenderModelBase(record), + kind: "CONCEPT", + basisVersion: record.basisVersion, + bodyBlocks: blocks, + }, + (key) => { + const asset = assetsByKey.get(key); + // 위에서 이미 걸렀다 — 여기 닿으면 필터와 해석기가 어긋난 것이다. + if (!asset) throw new Error(`concept evidence asset not found: ${key}`); + return { + assetId: asset.assetId, + assetKey: asset.assetKey, + mediaType: asset.contentType, + publicPath: asset.url, + width: asset.width, + height: asset.height, + decorative: asset.decorative, + }; + }, + ); + + return ( + { + const asset = assetsByKey.get(key); + if (!asset) throw new Error(`concept evidence asset not found: ${key}`); + return { + src: asset.url, + width: asset.width ?? 0, + height: asset.height ?? 0, + triggerLabel: `${asset.altText || asset.assetKey} 크게 보기`, + dialogLabel: asset.altText || asset.assetKey, + }; + }} + resolvePublishedLabel={(path) => + path === record.path ? record.publishedLabel : undefined + } + /> + ); +} diff --git a/src/features/tech-log/presentation/public/components/explore-filter-form.tsx b/src/features/tech-log/presentation/public/components/explore-filter-form.tsx index 611fc35..11df860 100644 --- a/src/features/tech-log/presentation/public/components/explore-filter-form.tsx +++ b/src/features/tech-log/presentation/public/components/explore-filter-form.tsx @@ -94,7 +94,7 @@ export function ExploreFilterForm({ onSubmit={submit} > {showType ? ( - + ) : null} diff --git a/src/features/tech-log/presentation/public/pages/concept-page.tsx b/src/features/tech-log/presentation/public/pages/concept-page.tsx new file mode 100644 index 0000000..89ab642 --- /dev/null +++ b/src/features/tech-log/presentation/public/pages/concept-page.tsx @@ -0,0 +1,29 @@ +import { + RegisteredNotFoundRoute, + useRouteInput, +} from "../../../../../presentation/routes/route-input.tsx"; +import { ConceptDocumentPage } from "../components/concept-document-page.tsx"; +import { usePublicContent } from "../use-public-content.tsx"; + +function optionalString(value: unknown): string | undefined { + return typeof value === "string" ? value : undefined; +} + +export function ConceptPage() { + const { params } = useRouteInput<"TECH_LOG_CONCEPT">(); + const slug = optionalString(params.slug); + const view = usePublicContent( + ["tech-log", "concept", slug], + async (queries) => ({ + record: slug ? await queries.getRecord("CONCEPT", slug) : undefined, + }), + ); + if (!view.ready) return view.fallback; + + const { record } = view.data; + return record ? ( + + ) : ( + + ); +} diff --git a/src/features/tech-log/presentation/public/pages/explore-kind-page.tsx b/src/features/tech-log/presentation/public/pages/explore-kind-page.tsx index 980e2de..accc137 100644 --- a/src/features/tech-log/presentation/public/pages/explore-kind-page.tsx +++ b/src/features/tech-log/presentation/public/pages/explore-kind-page.tsx @@ -12,6 +12,7 @@ const kinds = { cases: { kind: "CASE", title: "Case", description: "문제를 재현하고 관찰한 값에서 설계 결론까지 따라갑니다." }, references: { kind: "REFERENCE", title: "Reference", description: "다시 확인할 수 있는 기술 기준과 적용 범위를 정리합니다." }, questions: { kind: "QUESTION", title: "Open Question", description: "확인한 사실과 미지수, 다음 검증을 공개적으로 추적합니다." }, + concepts: { kind: "CONCEPT", title: "개념", description: "개념의 내부 동작과 아키텍처를 처음부터 풀어 씁니다." }, } as const; function optionalString(value: unknown): string | undefined { @@ -19,7 +20,12 @@ function optionalString(value: unknown): string | undefined { } function getKindConfig(value: string | undefined) { - if (value === "cases" || value === "references" || value === "questions") { + if ( + value === "cases" || + value === "references" || + value === "questions" || + value === "concepts" + ) { return kinds[value]; } return undefined; diff --git a/src/features/tech-log/presentation/tech-log-route-runtime.tsx b/src/features/tech-log/presentation/tech-log-route-runtime.tsx index 1954e3f..2c3c703 100644 --- a/src/features/tech-log/presentation/tech-log-route-runtime.tsx +++ b/src/features/tech-log/presentation/tech-log-route-runtime.tsx @@ -68,6 +68,13 @@ export const TECH_LOG_ROUTE_RUNTIME = Object.freeze({ "ReferencePage", ), ), + TECH_LOG_CONCEPT: runtime( + "TECH_LOG_CONCEPT", + routeModule( + () => import("./public/pages/concept-page.tsx"), + "ConceptPage", + ), + ), TECH_LOG_QUESTION: runtime( "TECH_LOG_QUESTION", routeModule( diff --git a/tests/features/tech-log/route-contract.test.ts b/tests/features/tech-log/route-contract.test.ts index 7e9fd7f..d4b6b83 100644 --- a/tests/features/tech-log/route-contract.test.ts +++ b/tests/features/tech-log/route-contract.test.ts @@ -17,6 +17,7 @@ const expectedRoutes = [ ["TECH_LOG_EXPLORE_KIND", "/explore/:kind", "PUBLIC", "TechLogExploreKindParams", "TechLogExploreKindSearch"], ["TECH_LOG_CASE", "/cases/:slug", "PUBLIC", "TechLogSlugParams", "TechLogCaseStateSearch"], ["TECH_LOG_REFERENCE", "/references/:slug", "PUBLIC", "TechLogSlugParams", null], + ["TECH_LOG_CONCEPT", "/concepts/:slug", "PUBLIC", "TechLogSlugParams", null], ["TECH_LOG_QUESTION", "/questions/:slug", "PUBLIC", "TechLogSlugParams", null], ["TECH_LOG_TOPIC", "/topics/:slug", "PUBLIC", "TechLogSlugParams", null], ["TECH_LOG_PROJECTS", "/projects", "PUBLIC", null, null], @@ -51,6 +52,7 @@ const expectedTitles = { TECH_LOG_EXPLORE: "탐색", TECH_LOG_EXPLORE_KIND: "유형별 탐색", TECH_LOG_CASE: "Case", + TECH_LOG_CONCEPT: "개념", TECH_LOG_REFERENCE: "Reference", TECH_LOG_QUESTION: "Open Question", TECH_LOG_TOPIC: "Topic", @@ -82,7 +84,7 @@ const expectedTitles = { } as const; describe("TechLog route boundary contract", () => { - it("freezes the standalone 31-route inventory before runtime installation", () => { + it("freezes the standalone 32-route inventory before runtime installation", () => { expect( Object.values(TECH_LOG_ROUTE_REGISTRY).map((definition) => [ definition.routeId, @@ -157,7 +159,7 @@ describe("TechLog route boundary contract", () => { for (const locale of ["ko-KR", "en-US"] as const) { const catalog: Readonly> = TECH_LOG_MESSAGE_CATALOGS[locale]; - expect(Object.keys(catalog)).toHaveLength(64); + expect(Object.keys(catalog)).toHaveLength(66); for (const [routeId, title] of Object.entries(expectedTitles)) { expect(catalog[`route.${routeId}.title`]).toBe(title); expect(catalog[`route.${routeId}.navigation`]).toBe(title); diff --git a/tests/unit/ci-workflow-generation.test.ts b/tests/unit/ci-workflow-generation.test.ts index 2bcbe17..e5984e1 100644 --- a/tests/unit/ci-workflow-generation.test.ts +++ b/tests/unit/ci-workflow-generation.test.ts @@ -200,8 +200,8 @@ describe("CI gate contract", () => { // than taking either side's number. // Task 11 added TECH_LOG_STUDIO_ASSETS's manual accessibility evidence. // Alignment follow-up item 2 added the TechLog junit report. - expect(contract.gates.reduce((total, gate) => total + gate.evidenceArtifactIds.length, 0)).toBe(113); - expect(contract.artifacts).toHaveLength(134); + expect(contract.gates.reduce((total, gate) => total + gate.evidenceArtifactIds.length, 0)).toBe(114); + expect(contract.artifacts).toHaveLength(135); expect(contract.stages).toHaveLength(5); expect(contract.retention.classes).toHaveLength(5); expect(index.gates.get("FE-GATE-015")?.commandIds).toHaveLength(2); diff --git a/tests/unit/task3-selective-integration.test.ts b/tests/unit/task3-selective-integration.test.ts index 6b1edfa..172a023 100644 --- a/tests/unit/task3-selective-integration.test.ts +++ b/tests/unit/task3-selective-integration.test.ts @@ -192,7 +192,7 @@ describe("selective Task 3 contract closure", () => { expect(canonical.gates).toHaveLength(27); expect(canonical.commands).toHaveLength(85); expect(canonical.gates.reduce((sum, gate) => sum + gate.commandIds.length, 0)).toBe(97); - expect(canonical.artifacts).toHaveLength(134); + expect(canonical.artifacts).toHaveLength(135); expect(canonical.stages).toHaveLength(5); expect(canonical.retention.classes).toHaveLength(5); diff --git a/tests/unit/tech-log-serving-contract.test.ts b/tests/unit/tech-log-serving-contract.test.ts index e6a4db6..048bc36 100644 --- a/tests/unit/tech-log-serving-contract.test.ts +++ b/tests/unit/tech-log-serving-contract.test.ts @@ -19,6 +19,7 @@ describe("TechLog production serving contract", () => { expect(contract.publicSpaPathPatterns).toEqual([ "^/$", "^/cases/[^/]+$", + "^/concepts/[^/]+$", "^/explore$", "^/explore/[^/]+$", "^/profile$", diff --git a/vite.config.ts b/vite.config.ts index ba91fcf..e202e45 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -10,6 +10,7 @@ const techLogRouteChunks = Object.freeze({ "/public/pages/explore-kind-page.tsx": "route-tech-log-explore-kind", "/public/pages/case-page.tsx": "route-tech-log-case", "/public/pages/reference-page.tsx": "route-tech-log-reference", + "/public/pages/concept-page.tsx": "route-tech-log-concept", "/public/pages/question-page.tsx": "route-tech-log-question", "/public/pages/topic-page.tsx": "route-tech-log-topic", "/public/pages/projects-page.tsx": "route-tech-log-projects",