feat: 홈이 무엇을 견줬는지 먼저 말한다
홈은 「무엇을 만들었나」로 시작했다. 30초 안에 알아야 할 것은 무엇을 견줬고 무엇이 남았나인데, 그 답은 주제 화면까지 들어가야 있었다. 가장 많이 다룬 주제 하나를 앞에 세우고 축마다 무엇을 알게 됐는지를 나란히 둔다 — 요약을 쓰면 무엇인가만 말하고 무엇을 알게 됐는지는 말하지 않으므로 결론 칸을 읽는다. 종류별 입구에는 개념이 아예 없었고, 문서 머리말의 종류 링크는 삼항의 마지막 else 를 타 개념 문서에서 `/projects` 로 갔다. `/explore/concepts` 는 처음부터 열려 있었는데 그리로 가는 길이 세 화면 어디에도 없었다. 대응을 표 하나로 모은다. 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
4da6d77c43
commit
604ded5720
@@ -1,6 +1,9 @@
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
import type { PublicContentQueries } from "../../../application/ports/public-content-queries.ts";
|
||||
import type {
|
||||
PublicContentQueries,
|
||||
PublicTopicDetail,
|
||||
} from "../../../application/ports/public-content-queries.ts";
|
||||
import { publicSiteConfig } from "../../../contracts/public-site-config.ts";
|
||||
import { normalizeFocus } from "../../../domain/public/focus-state.ts";
|
||||
import { useRouteInput } from "../../../../../presentation/routes/route-input.tsx";
|
||||
@@ -11,7 +14,10 @@ import {
|
||||
LatestIndex,
|
||||
type LatestEntry,
|
||||
} from "../components/latest-index.tsx";
|
||||
import { DOCUMENT_KIND_LABELS } from "../../shared/document-kind-labels.ts";
|
||||
import {
|
||||
DOCUMENT_KIND_LABELS,
|
||||
EXPLORE_KIND_PATHS,
|
||||
} from "../../shared/document-kind-labels.ts";
|
||||
|
||||
/*
|
||||
종류별 입구. 예전에는 여기가 "이 낱말은 이런 뜻입니다" 하는 범례였고, 그 낱말을 쓰는 목록은
|
||||
@@ -22,21 +28,10 @@ import { DOCUMENT_KIND_LABELS } from "../../shared/document-kind-labels.ts";
|
||||
어디에도 없는 여섯 번째 표기가 생겨 있었다.
|
||||
*/
|
||||
const exploreEntries = [
|
||||
{
|
||||
kind: "CASE",
|
||||
description: "무엇을 해보고 무엇을 확인했는지",
|
||||
path: "/explore/cases",
|
||||
},
|
||||
{
|
||||
kind: "REFERENCE",
|
||||
description: "다음에 같은 판단을 할 때 볼 것",
|
||||
path: "/explore/references",
|
||||
},
|
||||
{
|
||||
kind: "QUESTION",
|
||||
description: "아직 답하지 못한 것과 다음 검증",
|
||||
path: "/explore/questions",
|
||||
},
|
||||
{ kind: "CASE", description: "무엇을 해보고 무엇을 확인했는지" },
|
||||
{ kind: "CONCEPT", description: "안에서 실제로 무슨 일이 일어나는지" },
|
||||
{ kind: "REFERENCE", description: "다음에 같은 판단을 할 때 볼 것" },
|
||||
{ kind: "QUESTION", description: "아직 답하지 못한 것과 다음 검증" },
|
||||
] as const;
|
||||
|
||||
function optionalString(value: unknown): string | undefined {
|
||||
@@ -122,20 +117,41 @@ function dateLabel(isoTimestamp: string): string {
|
||||
).padStart(2, "0")}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 홈이 앞에 세울 주제 하나.
|
||||
*
|
||||
* <p>가장 많이 다룬 주제를 고른다 — 기록이 가장 많이 쌓인 곳이 이 기록의 중심이고, 그 주제
|
||||
* 안에서 무엇을 견줬는지가 방문자가 30초 안에 알아야 할 것이다. 축을 쓰지 않는 주제라면
|
||||
* 견줄 것이 없으므로 이 구역을 그리지 않는다.
|
||||
*
|
||||
* <p>요청은 둘이다(목록 하나 + 상세 하나). 주제마다 상세를 부르면 주제 수만큼 늘어난다 —
|
||||
* 홈의 최근 기록이 프로젝트마다 요청을 보내던 시절에 겪은 것과 같은 모양이다.
|
||||
*/
|
||||
async function getFeaturedTopic(
|
||||
publicContent: PublicContentQueries,
|
||||
): Promise<PublicTopicDetail | null> {
|
||||
const topics = await publicContent.listTopics();
|
||||
const first = topics[0];
|
||||
if (!first) return null;
|
||||
const detail = await publicContent.getTopicDetail(first.slug);
|
||||
return detail && detail.variants.length > 1 ? detail : null;
|
||||
}
|
||||
|
||||
export function HomePage() {
|
||||
const { search } = useRouteInput<"TECH_LOG_HOME">();
|
||||
const requestedKey = optionalString(search.focus);
|
||||
const requestedState = optionalString(search.state);
|
||||
const view = usePublicContent(["tech-log", "home"], async (queries) => {
|
||||
const [focusItems, latestEntries] = await Promise.all([
|
||||
const [focusItems, latestEntries, featuredTopic] = await Promise.all([
|
||||
queries.getHomeFocusItems(),
|
||||
getLatestEntries(queries),
|
||||
getFeaturedTopic(queries),
|
||||
]);
|
||||
return { focusItems, latestEntries };
|
||||
return { focusItems, latestEntries, featuredTopic };
|
||||
});
|
||||
if (!view.ready) return view.fallback;
|
||||
|
||||
const { focusItems, latestEntries } = view.data;
|
||||
const { focusItems, latestEntries, featuredTopic } = view.data;
|
||||
const availableFocusItems = requestedState === "focus-empty" ? [] : focusItems;
|
||||
const normalizedKey = normalizeFocus(
|
||||
requestedKey,
|
||||
@@ -172,6 +188,33 @@ export function HomePage() {
|
||||
</section>
|
||||
) : null}
|
||||
|
||||
{/*
|
||||
30초 안에 알아야 할 것은 「무엇을 만들었나」가 아니라 「무엇을 견줬고 무엇이 남았나」다.
|
||||
축마다 만들어 보고 무엇을 알게 됐는지(결론)를 나란히 둔다 — 요약을 쓰면 무엇인가만
|
||||
말하고 무엇을 알게 됐는지는 말하지 않는다.
|
||||
*/}
|
||||
{featuredTopic ? (
|
||||
<section className="shell home-comparison" aria-labelledby="home-comparison-title">
|
||||
<p className="section-kicker">
|
||||
{featuredTopic.variantLabel.trim() || "Comparison"}
|
||||
</p>
|
||||
<h2 id="home-comparison-title">
|
||||
<Link to={`/topics/${featuredTopic.slug}`}>{featuredTopic.name}</Link>
|
||||
{" — 무엇을 견줬나"}
|
||||
</h2>
|
||||
<ul>
|
||||
{featuredTopic.variants.map((variant) => (
|
||||
<li key={variant.slug}>
|
||||
<Link to={variant.path}>
|
||||
<strong>{variant.title}</strong>
|
||||
<p>{variant.conclusion || variant.summary}</p>
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
) : null}
|
||||
|
||||
<LatestIndex
|
||||
entries={requestedState === "latest-empty" ? [] : latestEntries}
|
||||
status={requestedState === "latest-error" ? "error" : "ready"}
|
||||
@@ -187,7 +230,7 @@ export function HomePage() {
|
||||
<ul className="explore-list">
|
||||
{exploreEntries.map((entry) => (
|
||||
<li key={entry.kind}>
|
||||
<Link to={entry.path}>
|
||||
<Link to={EXPLORE_KIND_PATHS[entry.kind]}>
|
||||
<span>{entry.description}</span>
|
||||
<strong>{DOCUMENT_KIND_LABELS[entry.kind]}</strong>
|
||||
<span aria-hidden="true">↗</span>
|
||||
|
||||
@@ -39,3 +39,21 @@ export const DOCUMENT_KIND_STATES: Record<RecordKind, "CONFIRMED" | "SETTLED" |
|
||||
PROJECT_DECISION: "SETTLED",
|
||||
QUESTION: "OPEN",
|
||||
};
|
||||
|
||||
/**
|
||||
* 종류별 목록으로 가는 주소.
|
||||
*
|
||||
* <p>이 대응이 세 화면에 흩어져 있었고 셋 다 개념을 빠뜨렸다 — 홈의 「종류별로 읽기」에는 개념이
|
||||
* 아예 없었고, 문서 머리말의 종류 링크는 삼항의 마지막 else 를 타 개념 문서에서 `/projects` 로
|
||||
* 갔다. `/explore/concepts` 는 처음부터 열려 있었는데 그리로 가는 길이 없었다.
|
||||
*
|
||||
* <p>결정은 프로젝트 안에서만 읽히므로 자기 목록이 없다. 그 자리를 `/projects` 로 두는 것은
|
||||
* 빠뜨린 것이 아니라 그렇게 정한 것이고, 표에 적혀 있으니 다음 사람이 구분할 수 있다.
|
||||
*/
|
||||
export const EXPLORE_KIND_PATHS: Record<RecordKind, string> = {
|
||||
CASE: "/explore/cases",
|
||||
CONCEPT: "/explore/concepts",
|
||||
REFERENCE: "/explore/references",
|
||||
QUESTION: "/explore/questions",
|
||||
PROJECT_DECISION: "/projects",
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
PublicDocumentRelations,
|
||||
type PublicRelation,
|
||||
} from "./public-document-relations.tsx";
|
||||
import { DOCUMENT_KIND_LABELS } from "../document-kind-labels.ts";
|
||||
import { DOCUMENT_KIND_LABELS, EXPLORE_KIND_PATHS } from "../document-kind-labels.ts";
|
||||
import { useDocumentMetadata } from "../use-document-metadata.ts";
|
||||
|
||||
type PublicRenderModel = components["schemas"]["PublicRenderModel"];
|
||||
@@ -50,10 +50,7 @@ function publishedLabel(
|
||||
}
|
||||
|
||||
function explorePath(kind: PublicRenderModelBase["kind"]) {
|
||||
if (kind === "CASE") return "/explore/cases";
|
||||
if (kind === "REFERENCE") return "/explore/references";
|
||||
if (kind === "QUESTION") return "/explore/questions";
|
||||
return "/projects";
|
||||
return EXPLORE_KIND_PATHS[kind];
|
||||
}
|
||||
|
||||
function TargetLink({
|
||||
@@ -168,7 +165,7 @@ function CaseDocument({
|
||||
>
|
||||
<header className="shell case-header">
|
||||
<nav className="case-breadcrumb" aria-label="문서 경로">
|
||||
<Link to="/explore/cases">{DOCUMENT_KIND_LABELS.CASE}</Link>
|
||||
<Link to={EXPLORE_KIND_PATHS.CASE}>{DOCUMENT_KIND_LABELS.CASE}</Link>
|
||||
<span aria-hidden="true">/</span>
|
||||
<TargetLink target={model.topic} />
|
||||
{model.project ? (
|
||||
|
||||
@@ -2920,3 +2920,65 @@ textarea.studio-control { min-height: 118px; resize: vertical; line-height: 1.65
|
||||
.explore-topic-group .public-result-heading h3 a:hover {
|
||||
color: var(--signal);
|
||||
}
|
||||
|
||||
/*
|
||||
홈의 축 비교. 표가 아니라 목록이다 — 축이 둘이든 넷이든 같은 배치로 읽히고, 좁은 화면에서
|
||||
가로로 밀리지 않는다. 주제 화면의 같은 구역과 규칙을 맞춘다.
|
||||
*/
|
||||
.home-comparison {
|
||||
margin-top: 96px;
|
||||
}
|
||||
|
||||
.home-comparison h2 {
|
||||
margin: 10px 0 24px;
|
||||
font-size: 30px;
|
||||
letter-spacing: -0.035em;
|
||||
}
|
||||
|
||||
.home-comparison h2 a:hover {
|
||||
color: var(--signal);
|
||||
}
|
||||
|
||||
.home-comparison ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
border-top: 1px solid var(--line-strong);
|
||||
}
|
||||
|
||||
.home-comparison li {
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
|
||||
.home-comparison a {
|
||||
display: grid;
|
||||
grid-template-columns: 200px minmax(0, 1fr);
|
||||
gap: 24px;
|
||||
align-items: baseline;
|
||||
padding: 27px 2px 28px;
|
||||
}
|
||||
|
||||
.home-comparison strong {
|
||||
color: var(--ink);
|
||||
font-size: 16px;
|
||||
font-weight: 620;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.home-comparison p {
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
font-size: 14px;
|
||||
line-height: 1.65;
|
||||
}
|
||||
|
||||
.home-comparison a:hover strong {
|
||||
color: var(--signal);
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.home-comparison a {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
gap: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user