fix: 홈의 종류 배지도 목록과 같은 배지로 만든다
최근 기록의 종류 자리만 따로 굵은 검정으로 칠해 두어, 배지에 상태 구분(확인한 것·정리한 것·아직 모르는 것)이 생긴 뒤에도 홈에서는 넷이 똑같이 보였다. 같은 `.record-kind` 를 쓰게 하고 그 자리의 override 를 걷어낸다. 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
db83228992
commit
ffdeaa1e83
@@ -4,6 +4,11 @@ import { cardSummary } from "../../../domain/content-format/card-summary.ts";
|
|||||||
export type LatestEntry = {
|
export type LatestEntry = {
|
||||||
id: string;
|
id: string;
|
||||||
typeLabel: string;
|
typeLabel: string;
|
||||||
|
/**
|
||||||
|
* 지식의 상태. 목록의 종류 배지가 이 값으로 갈린다 — 확인한 것, 정리한 것, 아직 모르는 것.
|
||||||
|
* 기록이 아닌 줄(프로젝트 활동)은 상태가 없으므로 비어 온다.
|
||||||
|
*/
|
||||||
|
typeState?: "CONFIRMED" | "SETTLED" | "OPEN";
|
||||||
title: string;
|
title: string;
|
||||||
summary: string;
|
summary: string;
|
||||||
date: string;
|
date: string;
|
||||||
@@ -51,7 +56,9 @@ export function LatestIndex({
|
|||||||
<li key={entry.id}>
|
<li key={entry.id}>
|
||||||
<Link className="latest-row" to={entry.path}>
|
<Link className="latest-row" to={entry.path}>
|
||||||
<div className="latest-time">
|
<div className="latest-time">
|
||||||
<span>{entry.typeLabel}</span>
|
<span className="record-kind" data-state={entry.typeState}>
|
||||||
|
{entry.typeLabel}
|
||||||
|
</span>
|
||||||
<time dateTime={entry.dateTime}>{entry.date}</time>
|
<time dateTime={entry.dateTime}>{entry.date}</time>
|
||||||
</div>
|
</div>
|
||||||
<div className="latest-copy">
|
<div className="latest-copy">
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
} from "../components/latest-index.tsx";
|
} from "../components/latest-index.tsx";
|
||||||
import {
|
import {
|
||||||
DOCUMENT_KIND_LABELS,
|
DOCUMENT_KIND_LABELS,
|
||||||
|
DOCUMENT_KIND_STATES,
|
||||||
EXPLORE_KIND_PATHS,
|
EXPLORE_KIND_PATHS,
|
||||||
} from "../../shared/document-kind-labels.ts";
|
} from "../../shared/document-kind-labels.ts";
|
||||||
|
|
||||||
@@ -64,6 +65,13 @@ const NOT_A_RECORD_LABELS: Readonly<Record<string, string>> = {
|
|||||||
PROJECT_ACTIVITY: "프로젝트 활동",
|
PROJECT_ACTIVITY: "프로젝트 활동",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** 기록이 아닌 줄은 상태가 없다 — 프로젝트 활동은 지식이 아니라 일어난 일이다. */
|
||||||
|
function latestTypeState(entryType: string) {
|
||||||
|
return entryType in DOCUMENT_KIND_STATES
|
||||||
|
? DOCUMENT_KIND_STATES[entryType as keyof typeof DOCUMENT_KIND_STATES]
|
||||||
|
: undefined;
|
||||||
|
}
|
||||||
|
|
||||||
function latestTypeLabel(entryType: string): string {
|
function latestTypeLabel(entryType: string): string {
|
||||||
if (entryType in DOCUMENT_KIND_LABELS) {
|
if (entryType in DOCUMENT_KIND_LABELS) {
|
||||||
return DOCUMENT_KIND_LABELS[entryType as keyof typeof DOCUMENT_KIND_LABELS];
|
return DOCUMENT_KIND_LABELS[entryType as keyof typeof DOCUMENT_KIND_LABELS];
|
||||||
@@ -80,6 +88,7 @@ async function getLatestEntries(
|
|||||||
id: entry.id,
|
id: entry.id,
|
||||||
// 목록의 다른 이름들과 같은 자리에 놓이므로 표기도 같은 규칙을 쓴다 — 대문자에 공백.
|
// 목록의 다른 이름들과 같은 자리에 놓이므로 표기도 같은 규칙을 쓴다 — 대문자에 공백.
|
||||||
typeLabel: latestTypeLabel(entry.entryType),
|
typeLabel: latestTypeLabel(entry.entryType),
|
||||||
|
typeState: latestTypeState(entry.entryType),
|
||||||
title: entry.title,
|
title: entry.title,
|
||||||
summary: entry.summary,
|
summary: entry.summary,
|
||||||
date: dateLabel(entry.publishedAt),
|
date: dateLabel(entry.publishedAt),
|
||||||
|
|||||||
@@ -570,9 +570,12 @@ a {
|
|||||||
letter-spacing: 0.01em;
|
letter-spacing: 0.01em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.latest-time span {
|
/*
|
||||||
color: var(--ink);
|
최근 기록의 종류 배지도 목록과 같은 `.record-kind` 다. 예전에는 이 자리만 따로 굵은 검정으로
|
||||||
font-weight: 650;
|
칠해 두어, 배지에 상태 구분이 생긴 뒤에도 홈만 넷이 똑같이 보였다.
|
||||||
|
*/
|
||||||
|
.latest-time .record-kind {
|
||||||
|
padding-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.latest-copy h3 {
|
.latest-copy h3 {
|
||||||
|
|||||||
Reference in New Issue
Block a user