feat: 축에 자기 화면을 준다
주제 화면의 네 줄(SPA·Mediator·BFF·Forward-Auth)은 링크인데 눌러도 아무 일이 없었다. 축의 주소를 주제 화면 안의 앵커로 잡아 두어서, 정작 주제 화면에서는 그 링크가 자기 자신을 가리켰다 — 주소만 바뀌고 화면은 그대로였다. 축에 화면을 준다. 결론을 먼저 두고 그 아래 그 축에 걸린 기록만 모은다. 목록 조회에 `variant` 필터를 더해 `record_variant` 로 거른다 — 축 slug 는 주제 안에서만 유일하므로 주제까지 함께 맞춘다. 정적 어댑터는 축으로 거르면 빈 목록을 준다. 축은 사람이 Studio 에서 거는 값이라 픽스처가 지어낼 수 없고, 없는 것을 있는 척하면 이 어댑터로 그린 화면이 서버로 바꿨을 때 달라진다. `RecordFilters` 가 포트와 정적 어댑터에 따로 있어, 포트에 필터가 늘어도 이쪽은 모르는 상태가 됐다 — 메서드 매개변수가 bivariant 라 `satisfies` 가 잡지 못한다. 하나로 합친다. 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
344dadb17a
commit
67a549173d
Binary file not shown.
|
After Width: | Height: | Size: 54 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 156 KiB |
@@ -38,28 +38,28 @@
|
|||||||
},
|
},
|
||||||
"contractSet": {
|
"contractSet": {
|
||||||
"setAlgorithm": "CA_CONTRACT_SET_V1",
|
"setAlgorithm": "CA_CONTRACT_SET_V1",
|
||||||
"setDigest": "sha256:6547e98a79ff5e09afeac849036d559481fc8abc6e232a2b5ce5c9841a071a25",
|
"setDigest": "sha256:cb8c02d87ac373d46de335091e435400ae1374002da9a446ee203b02c1dd58ec",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"packageId": "@tech-log/management-contract",
|
"packageId": "@tech-log/management-contract",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"digest": "sha256:61f8360cfb2e638c5d8c5557434b564e39cea517464c33cedcd1c5bf39a58aa8",
|
"digest": "sha256:61f8360cfb2e638c5d8c5557434b564e39cea517464c33cedcd1c5bf39a58aa8",
|
||||||
"runtimeProtocolVersion": 1,
|
"runtimeProtocolVersion": 1,
|
||||||
"sourceRevision": "a58ad30"
|
"sourceRevision": "b93d62a"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"packageId": "@tech-log/public-contract",
|
"packageId": "@tech-log/public-contract",
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"digest": "sha256:a964914040740a1223c33b5aeaf7724a8a0c78d91063bf3f1b7d7594c314a395",
|
"digest": "sha256:10b922715a4149f2dcf4d5925fb1d3e3e820a6d14d9e4a91d7a325027684280d",
|
||||||
"runtimeProtocolVersion": 1,
|
"runtimeProtocolVersion": 1,
|
||||||
"sourceRevision": "a58ad30"
|
"sourceRevision": "b93d62a"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"packageId": "@tech-log/studio-contract",
|
"packageId": "@tech-log/studio-contract",
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"digest": "sha256:d2bfbe0a12136f131ccb8c42f8868108ba8d0f0182b347f9b815316c343a970c",
|
"digest": "sha256:d2bfbe0a12136f131ccb8c42f8868108ba8d0f0182b347f9b815316c343a970c",
|
||||||
"runtimeProtocolVersion": 1,
|
"runtimeProtocolVersion": 1,
|
||||||
"sourceRevision": "a58ad30"
|
"sourceRevision": "b93d62a"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ export type RouteCodecId =
|
|||||||
| "ReferenceResourceListQuery"
|
| "ReferenceResourceListQuery"
|
||||||
| "TechLogExploreKindParams"
|
| "TechLogExploreKindParams"
|
||||||
| "TechLogSlugParams"
|
| "TechLogSlugParams"
|
||||||
|
| "TechLogTopicVariantParams"
|
||||||
| "TechLogVersionParams"
|
| "TechLogVersionParams"
|
||||||
| "TechLogDocumentIdParams"
|
| "TechLogDocumentIdParams"
|
||||||
| "TechLogPublicationEventIdParams"
|
| "TechLogPublicationEventIdParams"
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ export function createHttpPublicContentGateway(
|
|||||||
const wantsKnowledge = !filters.kind || filters.kind !== "QUESTION";
|
const wantsKnowledge = !filters.kind || filters.kind !== "QUESTION";
|
||||||
const query = {
|
const query = {
|
||||||
...(filters.topic ? { topic: filters.topic } : {}),
|
...(filters.topic ? { topic: filters.topic } : {}),
|
||||||
|
...(filters.variant ? { variant: filters.variant } : {}),
|
||||||
...(filters.project ? { project: filters.project } : {}),
|
...(filters.project ? { project: filters.project } : {}),
|
||||||
};
|
};
|
||||||
const [knowledge, questions] = await Promise.all([
|
const [knowledge, questions] = await Promise.all([
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ import type {
|
|||||||
PublicContentQueries,
|
PublicContentQueries,
|
||||||
PublicTopic,
|
PublicTopic,
|
||||||
PublicTopicDetail,
|
PublicTopicDetail,
|
||||||
|
RecordFilters,
|
||||||
} from "../../application/ports/public-content-queries.ts";
|
} from "../../application/ports/public-content-queries.ts";
|
||||||
|
|
||||||
export type RecordFilters = {
|
/*
|
||||||
kind?: RecordKind;
|
포트의 것을 그대로 쓴다. 여기 따로 적어 두었더니 포트에 필터가 하나 늘 때 이쪽만 모르는
|
||||||
topic?: string;
|
상태가 됐고, `satisfies` 는 메서드 매개변수가 bivariant 라 그것을 잡지 못했다.
|
||||||
project?: string;
|
*/
|
||||||
openQuestionsOnly?: boolean;
|
export type { RecordFilters };
|
||||||
};
|
|
||||||
|
|
||||||
export type SearchablePublicEntity = {
|
export type SearchablePublicEntity = {
|
||||||
contentType: RecordKind | "PROJECT" | "RELEASE";
|
contentType: RecordKind | "PROJECT" | "RELEASE";
|
||||||
@@ -62,6 +62,12 @@ export function listRecords(filters: RecordFilters = {}): PublicRecord[] {
|
|||||||
.toLocaleLowerCase("ko-KR");
|
.toLocaleLowerCase("ko-KR");
|
||||||
|
|
||||||
return publicRecords
|
return publicRecords
|
||||||
|
/*
|
||||||
|
정적 자료에는 축이 없다 — 사람이 Studio 에서 거는 값이라 픽스처가 지어낼 수 없다. 축으로
|
||||||
|
걸러 달라는 요청은 아무것도 고르지 않는 것으로 답한다. 없는 것을 있는 척하면 이 어댑터로
|
||||||
|
그린 화면이 서버로 바꿨을 때 달라진다.
|
||||||
|
*/
|
||||||
|
.filter(() => !filters.variant)
|
||||||
.filter((record) => !filters.kind || record.kind === filters.kind)
|
.filter((record) => !filters.kind || record.kind === filters.kind)
|
||||||
.filter(
|
.filter(
|
||||||
(record) =>
|
(record) =>
|
||||||
|
|||||||
@@ -267,6 +267,8 @@ export type HomeFocusItem = {
|
|||||||
export type RecordFilters = {
|
export type RecordFilters = {
|
||||||
kind?: RecordKind;
|
kind?: RecordKind;
|
||||||
topic?: string;
|
topic?: string;
|
||||||
|
/** 주제 안의 축. 주제 안에서만 유일하므로 `topic` 과 함께 준다. */
|
||||||
|
variant?: string;
|
||||||
project?: string;
|
project?: string;
|
||||||
openQuestionsOnly?: boolean;
|
openQuestionsOnly?: boolean;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"packageId": "@tech-log/management-contract",
|
"packageId": "@tech-log/management-contract",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"digest": "sha256:61f8360cfb2e638c5d8c5557434b564e39cea517464c33cedcd1c5bf39a58aa8",
|
"digest": "sha256:61f8360cfb2e638c5d8c5557434b564e39cea517464c33cedcd1c5bf39a58aa8",
|
||||||
"sourceRevision": "a58ad30",
|
"sourceRevision": "b93d62a",
|
||||||
"operationIds": [
|
"operationIds": [
|
||||||
"createCaseDraft",
|
"createCaseDraft",
|
||||||
"getCaseForEdit",
|
"getCaseForEdit",
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"packageId": "@tech-log/public-contract",
|
"packageId": "@tech-log/public-contract",
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"digest": "sha256:a964914040740a1223c33b5aeaf7724a8a0c78d91063bf3f1b7d7594c314a395",
|
"digest": "sha256:10b922715a4149f2dcf4d5925fb1d3e3e820a6d14d9e4a91d7a325027684280d",
|
||||||
"sourceRevision": "a58ad30",
|
"sourceRevision": "b93d62a",
|
||||||
"operationIds": [
|
"operationIds": [
|
||||||
"getPublicSite",
|
"getPublicSite",
|
||||||
"getPublicHome",
|
"getPublicHome",
|
||||||
|
|||||||
@@ -564,8 +564,9 @@ export interface components {
|
|||||||
TopicVariantSummary: {
|
TopicVariantSummary: {
|
||||||
slug: string;
|
slug: string;
|
||||||
title: string;
|
title: string;
|
||||||
/** @description 이 축이 주제 화면에서 사는 자리(`/topics/{주제}#{축}`). 축은 주제 화면 안의 한 줄이지
|
/** @description 이 축의 공개 주소(`/topics/{주제}/{축}`). 그 축에 걸린 기록만 모아 보여 준다.
|
||||||
* 따로 선 화면이 아니다 — 자기 화면을 갖게 되면 그때 이 값이 바뀐다.
|
* 한동안 주제 화면 안의 앵커였는데, 주제 화면에서는 그 링크가 자기 자신을 가리켜
|
||||||
|
* 눌러도 아무 일이 없었다.
|
||||||
* */
|
* */
|
||||||
path: string;
|
path: string;
|
||||||
summary?: string;
|
summary?: string;
|
||||||
@@ -1108,6 +1109,10 @@ export interface operations {
|
|||||||
query?: {
|
query?: {
|
||||||
type?: "CASE" | "REFERENCE" | "CONCEPT";
|
type?: "CASE" | "REFERENCE" | "CONCEPT";
|
||||||
topic?: string;
|
topic?: string;
|
||||||
|
/** @description 주제 안의 축 slug. 그 축에 걸린 기록만 남긴다. `topic` 과 함께 준다 — 축 slug 는
|
||||||
|
* 주제 안에서만 유일하다.
|
||||||
|
* */
|
||||||
|
variant?: string;
|
||||||
project?: string;
|
project?: string;
|
||||||
tag?: string;
|
tag?: string;
|
||||||
year?: number;
|
year?: number;
|
||||||
@@ -1155,6 +1160,10 @@ export interface operations {
|
|||||||
query?: {
|
query?: {
|
||||||
status?: "OPEN" | "INVESTIGATING" | "PAUSED" | "RESOLVED";
|
status?: "OPEN" | "INVESTIGATING" | "PAUSED" | "RESOLVED";
|
||||||
topic?: string;
|
topic?: string;
|
||||||
|
/** @description 주제 안의 축 slug. 그 축에 걸린 기록만 남긴다. `topic` 과 함께 준다 — 축 slug 는
|
||||||
|
* 주제 안에서만 유일하다.
|
||||||
|
* */
|
||||||
|
variant?: string;
|
||||||
project?: string;
|
project?: string;
|
||||||
tag?: string;
|
tag?: string;
|
||||||
sort?: "UPDATED_DESC" | "OPENED_DESC" | "RESOLVED_DESC";
|
sort?: "UPDATED_DESC" | "OPENED_DESC" | "RESOLVED_DESC";
|
||||||
|
|||||||
@@ -119,6 +119,13 @@ paths:
|
|||||||
in: query
|
in: query
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
- name: variant
|
||||||
|
in: query
|
||||||
|
description: |
|
||||||
|
주제 안의 축 slug. 그 축에 걸린 기록만 남긴다. `topic` 과 함께 준다 — 축 slug 는
|
||||||
|
주제 안에서만 유일하다.
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
- name: project
|
- name: project
|
||||||
in: query
|
in: query
|
||||||
schema:
|
schema:
|
||||||
@@ -200,6 +207,13 @@ paths:
|
|||||||
in: query
|
in: query
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
- name: variant
|
||||||
|
in: query
|
||||||
|
description: |
|
||||||
|
주제 안의 축 slug. 그 축에 걸린 기록만 남긴다. `topic` 과 함께 준다 — 축 slug 는
|
||||||
|
주제 안에서만 유일하다.
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
- name: project
|
- name: project
|
||||||
in: query
|
in: query
|
||||||
schema:
|
schema:
|
||||||
@@ -1291,8 +1305,9 @@ components:
|
|||||||
path:
|
path:
|
||||||
type: string
|
type: string
|
||||||
description: |
|
description: |
|
||||||
이 축이 주제 화면에서 사는 자리(`/topics/{주제}#{축}`). 축은 주제 화면 안의 한 줄이지
|
이 축의 공개 주소(`/topics/{주제}/{축}`). 그 축에 걸린 기록만 모아 보여 준다.
|
||||||
따로 선 화면이 아니다 — 자기 화면을 갖게 되면 그때 이 값이 바뀐다.
|
한동안 주제 화면 안의 앵커였는데, 주제 화면에서는 그 링크가 자기 자신을 가리켜
|
||||||
|
눌러도 아무 일이 없었다.
|
||||||
summary:
|
summary:
|
||||||
type: string
|
type: string
|
||||||
conclusion:
|
conclusion:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"packageId": "@tech-log/studio-contract",
|
"packageId": "@tech-log/studio-contract",
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"digest": "sha256:d2bfbe0a12136f131ccb8c42f8868108ba8d0f0182b347f9b815316c343a970c",
|
"digest": "sha256:d2bfbe0a12136f131ccb8c42f8868108ba8d0f0182b347f9b815316c343a970c",
|
||||||
"sourceRevision": "a58ad30",
|
"sourceRevision": "b93d62a",
|
||||||
"operationIds": [
|
"operationIds": [
|
||||||
"getStudioSession",
|
"getStudioSession",
|
||||||
"getStudioDashboard",
|
"getStudioDashboard",
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ const HTTP_CONTRACTS = Object.freeze([
|
|||||||
const value = input as unknown as Readonly<{
|
const value = input as unknown as Readonly<{
|
||||||
type?: string;
|
type?: string;
|
||||||
topic?: string;
|
topic?: string;
|
||||||
|
variant?: string;
|
||||||
project?: string;
|
project?: string;
|
||||||
page?: number;
|
page?: number;
|
||||||
size?: number;
|
size?: number;
|
||||||
@@ -108,6 +109,7 @@ const HTTP_CONTRACTS = Object.freeze([
|
|||||||
const value = input as unknown as Readonly<{
|
const value = input as unknown as Readonly<{
|
||||||
status?: string;
|
status?: string;
|
||||||
topic?: string;
|
topic?: string;
|
||||||
|
variant?: string;
|
||||||
project?: string;
|
project?: string;
|
||||||
page?: number;
|
page?: number;
|
||||||
size?: number;
|
size?: number;
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ const TECH_LOG_ROUTE_SPECS = [
|
|||||||
defineSpec({ routeId: "TECH_LOG_CONCEPT", path: "/concepts/:slug", layoutGroup: "PUBLIC", paramsSchema: "TechLogSlugParams", searchSchema: null, title: "개념", 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_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_TOPIC", path: "/topics/:slug", layoutGroup: "PUBLIC", paramsSchema: "TechLogSlugParams", searchSchema: null, title: "Topic", navigationLabel: null, navigationOrder: null }),
|
||||||
|
defineSpec({ routeId: "TECH_LOG_TOPIC_VARIANT", path: "/topics/:slug/:variant", layoutGroup: "PUBLIC", paramsSchema: "TechLogTopicVariantParams", 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 }),
|
defineSpec({ routeId: "TECH_LOG_PROJECTS", path: "/projects", layoutGroup: "PUBLIC", paramsSchema: null, searchSchema: null, title: "프로젝트", navigationLabel: "프로젝트", navigationOrder: 20 }),
|
||||||
defineSpec({ routeId: "TECH_LOG_PROJECT", path: "/projects/:slug", layoutGroup: "PUBLIC", paramsSchema: "TechLogSlugParams", searchSchema: null, title: "프로젝트", navigationLabel: null, navigationOrder: null }),
|
defineSpec({ routeId: "TECH_LOG_PROJECT", path: "/projects/:slug", layoutGroup: "PUBLIC", paramsSchema: "TechLogSlugParams", searchSchema: null, title: "프로젝트", navigationLabel: null, navigationOrder: null }),
|
||||||
defineSpec({ routeId: "TECH_LOG_PROJECT_RECORDS", path: "/projects/:slug/records", layoutGroup: "PUBLIC", paramsSchema: "TechLogSlugParams", searchSchema: null, title: "프로젝트 기록", navigationLabel: null, navigationOrder: null }),
|
defineSpec({ routeId: "TECH_LOG_PROJECT_RECORDS", path: "/projects/:slug/records", layoutGroup: "PUBLIC", paramsSchema: "TechLogSlugParams", searchSchema: null, title: "프로젝트 기록", navigationLabel: null, navigationOrder: null }),
|
||||||
|
|||||||
@@ -111,11 +111,7 @@ export function TopicPage() {
|
|||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
{topic.variants.map((variant) => (
|
{topic.variants.map((variant) => (
|
||||||
/*
|
<li key={variant.slug}>
|
||||||
축의 주소(`/topics/{주제}#{축}`)가 실제로 가리키는 자리다. 다른 화면에서 이
|
|
||||||
축을 걸면 여기로 온다 — 앵커가 없으면 그 링크는 주제 화면 맨 위에 떨어진다.
|
|
||||||
*/
|
|
||||||
<li key={variant.slug} id={variant.slug}>
|
|
||||||
<a href={variant.path}>
|
<a href={variant.path}>
|
||||||
<strong>{variant.title}</strong>
|
<strong>{variant.title}</strong>
|
||||||
{/*
|
{/*
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
|
import type { PublicRecord } from "../../../application/ports/public-content-queries.ts";
|
||||||
|
import {
|
||||||
|
RegisteredNotFoundRoute,
|
||||||
|
useRouteInput,
|
||||||
|
} from "../../../../../presentation/routes/route-input.tsx";
|
||||||
|
import { ProseText } from "../../shared/public-render/prose-text.tsx";
|
||||||
|
import { PublicRecordList } from "../components/public-record-list.tsx";
|
||||||
|
import { usePublicContent } from "../use-public-content.tsx";
|
||||||
|
|
||||||
|
/** 나열 순서. 주제 화면과 같다 — 원리 → 확인한 기록 → 기준 → 아직 모르는 것. */
|
||||||
|
const READING_ORDER: ReadonlyArray<PublicRecord["kind"]> = [
|
||||||
|
"CONCEPT",
|
||||||
|
"CASE",
|
||||||
|
"REFERENCE",
|
||||||
|
"QUESTION",
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 주제 안의 축 하나.
|
||||||
|
*
|
||||||
|
* <p>축은 한동안 주소가 주제 화면 안의 앵커였다. 그래서 주제 화면에서는 그 링크가 자기 자신을
|
||||||
|
* 가리켰고, 눌러도 아무 일이 없었다 — 주소는 바뀌는데 화면은 그대로였다.
|
||||||
|
*
|
||||||
|
* <p>이 화면이 답하는 것은 「이 접근에서 무엇을 알게 됐고, 그 근거가 어디 있나」다. 결론을 먼저
|
||||||
|
* 두고 그 아래 그 축에 걸린 기록만 모은다.
|
||||||
|
*/
|
||||||
|
export function TopicVariantPage() {
|
||||||
|
const { params } = useRouteInput<"TECH_LOG_TOPIC_VARIANT">();
|
||||||
|
const topicSlug = typeof params.slug === "string" ? params.slug : "";
|
||||||
|
const variantSlug = typeof params.variant === "string" ? params.variant : "";
|
||||||
|
const view = usePublicContent(
|
||||||
|
["tech-log", "topic", topicSlug, "variant", variantSlug],
|
||||||
|
async (queries) => ({
|
||||||
|
topic: await queries.getTopicDetail(topicSlug),
|
||||||
|
records: await queries.listRecords({ topic: topicSlug, variant: variantSlug }),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
if (!view.ready) return view.fallback;
|
||||||
|
|
||||||
|
const { topic, records } = view.data;
|
||||||
|
const variant = topic?.variants.find((entry) => entry.slug === variantSlug);
|
||||||
|
if (!topic || !variant) return <RegisteredNotFoundRoute />;
|
||||||
|
|
||||||
|
const axisLabel = topic.variantLabel.trim() || "접근";
|
||||||
|
const ordered = [...records].sort(
|
||||||
|
(left, right) => READING_ORDER.indexOf(left.kind) - READING_ORDER.indexOf(right.kind),
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<main id="main-content" className="shell public-index-page topic-hub">
|
||||||
|
<header className="public-page-header">
|
||||||
|
<nav aria-label="문서 경로">
|
||||||
|
<Link to="/explore">탐색</Link>
|
||||||
|
<span aria-hidden="true">/</span>
|
||||||
|
<Link to={`/topics/${topic.slug}`}>{topic.name}</Link>
|
||||||
|
</nav>
|
||||||
|
<p className="section-kicker">{axisLabel}</p>
|
||||||
|
<h1>{variant.title}</h1>
|
||||||
|
{/*
|
||||||
|
결론이 이 축의 값어치다. 요약은 이것이 무엇인가만 말하므로, 결론이 있으면 그쪽을 먼저
|
||||||
|
보이고 요약은 그 아래 한 줄로 남긴다.
|
||||||
|
*/}
|
||||||
|
<ProseText text={variant.conclusion || variant.summary} />
|
||||||
|
</header>
|
||||||
|
|
||||||
|
{variant.conclusion && variant.summary ? (
|
||||||
|
<p className="topic-variants-note">{variant.summary}</p>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
<div className="public-result-heading">
|
||||||
|
<h2>{`이 ${axisLabel}의 기록`}</h2>
|
||||||
|
<p>{`${ordered.length}개`}</p>
|
||||||
|
</div>
|
||||||
|
<PublicRecordList
|
||||||
|
records={ordered}
|
||||||
|
emptyMessage={`아직 이 ${axisLabel}에 걸린 기록이 없습니다.`}
|
||||||
|
/>
|
||||||
|
</main>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -18,6 +18,10 @@ const nonEmptyParams = <Key extends string>(key: Key) =>
|
|||||||
export const TECH_LOG_ROUTE_CODECS = Object.freeze({
|
export const TECH_LOG_ROUTE_CODECS = Object.freeze({
|
||||||
TechLogExploreKindParams: nonEmptyParams("kind"),
|
TechLogExploreKindParams: nonEmptyParams("kind"),
|
||||||
TechLogSlugParams: nonEmptyParams("slug"),
|
TechLogSlugParams: nonEmptyParams("slug"),
|
||||||
|
/* 축은 주제 안에서만 유일하다 — 주소도 주제를 앞에 달고 다닌다. */
|
||||||
|
TechLogTopicVariantParams: z
|
||||||
|
.object({ slug: z.string().min(1), variant: z.string().min(1) })
|
||||||
|
.strict(),
|
||||||
TechLogVersionParams: nonEmptyParams("version"),
|
TechLogVersionParams: nonEmptyParams("version"),
|
||||||
TechLogDocumentIdParams: nonEmptyParams("id"),
|
TechLogDocumentIdParams: nonEmptyParams("id"),
|
||||||
TechLogPublicationEventIdParams: nonEmptyParams("publicationEventId"),
|
TechLogPublicationEventIdParams: nonEmptyParams("publicationEventId"),
|
||||||
|
|||||||
@@ -86,6 +86,13 @@ export const TECH_LOG_ROUTE_RUNTIME = Object.freeze({
|
|||||||
"TECH_LOG_TOPIC",
|
"TECH_LOG_TOPIC",
|
||||||
routeModule(() => import("./public/pages/topic-page.tsx"), "TopicPage"),
|
routeModule(() => import("./public/pages/topic-page.tsx"), "TopicPage"),
|
||||||
),
|
),
|
||||||
|
TECH_LOG_TOPIC_VARIANT: runtime(
|
||||||
|
"TECH_LOG_TOPIC_VARIANT",
|
||||||
|
routeModule(
|
||||||
|
() => import("./public/pages/topic-variant-page.tsx"),
|
||||||
|
"TopicVariantPage",
|
||||||
|
),
|
||||||
|
),
|
||||||
TECH_LOG_PROJECTS: runtime(
|
TECH_LOG_PROJECTS: runtime(
|
||||||
"TECH_LOG_PROJECTS",
|
"TECH_LOG_PROJECTS",
|
||||||
routeModule(
|
routeModule(
|
||||||
|
|||||||
@@ -20,6 +20,13 @@ const expectedRoutes = [
|
|||||||
["TECH_LOG_CONCEPT", "/concepts/:slug", "PUBLIC", "TechLogSlugParams", null],
|
["TECH_LOG_CONCEPT", "/concepts/:slug", "PUBLIC", "TechLogSlugParams", null],
|
||||||
["TECH_LOG_QUESTION", "/questions/:slug", "PUBLIC", "TechLogSlugParams", null],
|
["TECH_LOG_QUESTION", "/questions/:slug", "PUBLIC", "TechLogSlugParams", null],
|
||||||
["TECH_LOG_TOPIC", "/topics/:slug", "PUBLIC", "TechLogSlugParams", null],
|
["TECH_LOG_TOPIC", "/topics/:slug", "PUBLIC", "TechLogSlugParams", null],
|
||||||
|
[
|
||||||
|
"TECH_LOG_TOPIC_VARIANT",
|
||||||
|
"/topics/:slug/:variant",
|
||||||
|
"PUBLIC",
|
||||||
|
"TechLogTopicVariantParams",
|
||||||
|
null,
|
||||||
|
],
|
||||||
["TECH_LOG_PROJECTS", "/projects", "PUBLIC", null, null],
|
["TECH_LOG_PROJECTS", "/projects", "PUBLIC", null, null],
|
||||||
["TECH_LOG_PROJECT", "/projects/:slug", "PUBLIC", "TechLogSlugParams", null],
|
["TECH_LOG_PROJECT", "/projects/:slug", "PUBLIC", "TechLogSlugParams", null],
|
||||||
["TECH_LOG_PROJECT_RECORDS", "/projects/:slug/records", "PUBLIC", "TechLogSlugParams", null],
|
["TECH_LOG_PROJECT_RECORDS", "/projects/:slug/records", "PUBLIC", "TechLogSlugParams", null],
|
||||||
@@ -57,6 +64,7 @@ const expectedTitles = {
|
|||||||
TECH_LOG_REFERENCE: "Reference",
|
TECH_LOG_REFERENCE: "Reference",
|
||||||
TECH_LOG_QUESTION: "Open Question",
|
TECH_LOG_QUESTION: "Open Question",
|
||||||
TECH_LOG_TOPIC: "Topic",
|
TECH_LOG_TOPIC: "Topic",
|
||||||
|
TECH_LOG_TOPIC_VARIANT: "Topic",
|
||||||
TECH_LOG_PROJECTS: "프로젝트",
|
TECH_LOG_PROJECTS: "프로젝트",
|
||||||
TECH_LOG_PROJECT: "프로젝트",
|
TECH_LOG_PROJECT: "프로젝트",
|
||||||
TECH_LOG_PROJECT_RECORDS: "프로젝트 기록",
|
TECH_LOG_PROJECT_RECORDS: "프로젝트 기록",
|
||||||
@@ -86,7 +94,7 @@ const expectedTitles = {
|
|||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
describe("TechLog route boundary contract", () => {
|
describe("TechLog route boundary contract", () => {
|
||||||
it("freezes the standalone 32-route inventory before runtime installation", () => {
|
it("freezes the standalone 33-route inventory before runtime installation", () => {
|
||||||
expect(
|
expect(
|
||||||
Object.values(TECH_LOG_ROUTE_REGISTRY).map((definition) => [
|
Object.values(TECH_LOG_ROUTE_REGISTRY).map((definition) => [
|
||||||
definition.routeId,
|
definition.routeId,
|
||||||
@@ -160,7 +168,7 @@ describe("TechLog route boundary contract", () => {
|
|||||||
for (const locale of ["ko-KR", "en-US"] as const) {
|
for (const locale of ["ko-KR", "en-US"] as const) {
|
||||||
const catalog: Readonly<Record<string, string>> =
|
const catalog: Readonly<Record<string, string>> =
|
||||||
TECH_LOG_MESSAGE_CATALOGS[locale];
|
TECH_LOG_MESSAGE_CATALOGS[locale];
|
||||||
expect(Object.keys(catalog)).toHaveLength(68);
|
expect(Object.keys(catalog)).toHaveLength(70);
|
||||||
for (const [routeId, title] of Object.entries(expectedTitles)) {
|
for (const [routeId, title] of Object.entries(expectedTitles)) {
|
||||||
expect(catalog[`route.${routeId}.title`]).toBe(title);
|
expect(catalog[`route.${routeId}.title`]).toBe(title);
|
||||||
expect(catalog[`route.${routeId}.navigation`]).toBe(title);
|
expect(catalog[`route.${routeId}.navigation`]).toBe(title);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ const techLogRouteChunks = Object.freeze({
|
|||||||
"/public/pages/concept-page.tsx": "route-tech-log-concept",
|
"/public/pages/concept-page.tsx": "route-tech-log-concept",
|
||||||
"/public/pages/question-page.tsx": "route-tech-log-question",
|
"/public/pages/question-page.tsx": "route-tech-log-question",
|
||||||
"/public/pages/topic-page.tsx": "route-tech-log-topic",
|
"/public/pages/topic-page.tsx": "route-tech-log-topic",
|
||||||
|
"/public/pages/topic-variant-page.tsx": "route-tech-log-topic-variant",
|
||||||
"/public/pages/projects-page.tsx": "route-tech-log-projects",
|
"/public/pages/projects-page.tsx": "route-tech-log-projects",
|
||||||
"/public/pages/project-overview-page.tsx": "route-tech-log-project",
|
"/public/pages/project-overview-page.tsx": "route-tech-log-project",
|
||||||
"/public/pages/project-records-page.tsx": "route-tech-log-project-records",
|
"/public/pages/project-records-page.tsx": "route-tech-log-project-records",
|
||||||
|
|||||||
Reference in New Issue
Block a user