feat: Studio 가 보고 대신 다음 한 걸음을 먼저 보여 준다
탐색 여섯 자리가 같은 무게로 늘어서 있었다. 「작업본」과 「릴리즈」가 같은 크기로 나란하면 어디부터 봐야 하는지를 화면이 말해 주지 않는다. 글을 쓰는 일·구조를 손보는 일·자료를 관리하는 일·내보내는 일 넷으로 묶는다. 이름과 순서는 계약이 갖고 있으므로 여기서는 묶음만 정하고, 표가 `Record` 라 탐색 항목이 늘면 컴파일러가 잡는다. 대시보드는 숫자 넷과 목록 셋으로 무엇이 얼마나 있는지를 보고했다. 작성자가 이 화면을 여는 이유는 보고를 읽으려는 것이 아니라 하던 일을 이어서 하려는 것인데, 그 다음 한 걸음은 세 목록 중 어딘가에 같은 크기로 섞여 있었다. 가장 최근에 손댄 것 하나를 맨 위에 세우고 그 작업본의 다음 화면으로 바로 보낸다. 작업본 목록의 「삭제」는 61줄에서 61번 반복돼 이 화면의 기본 동작처럼 보였다. 한 겹 안으로 넣는다. 계약이 주고 있었지만 화면이 쓰지 않던 `hasUnpublishedChanges` 도 드러낸다 — 작성자는 "이미 게시했는데 고친 게 아직 안 나갔다"를 목록에서 알 수 없었다. 다음 할 일의 이름과 갈 곳을 한 벌로 모았다. 대시보드와 목록이 각자 표를 들고 있었다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015c8cBFUaVr7KLVUx6ujz7D
This commit is contained in:
co-authored by
Claude Opus 5
parent
d255089571
commit
9545860605
@@ -11,6 +11,7 @@ import { useStudio } from "../use-studio.ts";
|
||||
import { GuardedStudioLink } from "./guarded-studio-link.tsx";
|
||||
import { StudioPagination } from "./studio-pagination.tsx";
|
||||
import { DOCUMENT_KIND_LABELS } from "../../shared/document-kind-labels.ts";
|
||||
import { NEXT_ACTION_LABELS, nextActionHref } from "../next-action.ts";
|
||||
|
||||
type RecordKind = components["schemas"]["RecordKind"];
|
||||
|
||||
@@ -48,29 +49,7 @@ const publicationLabel = {
|
||||
PUBLISHED: "게시 중",
|
||||
UNPUBLISHED: "게시 취소",
|
||||
} as const;
|
||||
const nextLabel = {
|
||||
CONTINUE_EDITING: "작성 계속",
|
||||
VALIDATE: "검증하기",
|
||||
FIX_VALIDATION: "오류 수정",
|
||||
CREATE_PREVIEW: "미리보기",
|
||||
PUBLISH: "게시하기",
|
||||
NONE: "완료",
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* 다음 단계는 이름만 있고 갈 곳이 없었다. 작성자는 편집 → 검증 → 미리보기 → 게시를 순서대로
|
||||
* 밟아야만 게시 화면에 닿을 수 있었고, 그 경로 어디에도 "게시" 라는 말이 먼저 보이지 않아
|
||||
* 게시하는 방법을 알기 어려웠다. 서버가 이미 다음 할 일을 알려 주므로, 그 말을 그대로 링크로
|
||||
* 만든다.
|
||||
*/
|
||||
const nextHref = {
|
||||
CONTINUE_EDITING: "edit",
|
||||
VALIDATE: "validation",
|
||||
FIX_VALIDATION: "edit",
|
||||
CREATE_PREVIEW: "preview",
|
||||
PUBLISH: "publish",
|
||||
NONE: "",
|
||||
} as const;
|
||||
|
||||
function isAbortError(error: unknown): boolean {
|
||||
return error instanceof DOMException && error.name === "AbortError";
|
||||
@@ -416,17 +395,26 @@ export function DocumentList() {
|
||||
<div>
|
||||
<dt>다음</dt>
|
||||
<dd>
|
||||
{nextHref[item.nextAction] ? (
|
||||
<GuardedStudioLink
|
||||
href={`/studio/documents/${item.id}/${nextHref[item.nextAction]}`}
|
||||
>
|
||||
{nextLabel[item.nextAction]}
|
||||
{nextActionHref(item.id, item.nextAction) ? (
|
||||
<GuardedStudioLink href={nextActionHref(item.id, item.nextAction)!}>
|
||||
{NEXT_ACTION_LABELS[item.nextAction]}
|
||||
</GuardedStudioLink>
|
||||
) : (
|
||||
nextLabel[item.nextAction]
|
||||
NEXT_ACTION_LABELS[item.nextAction]
|
||||
)}
|
||||
</dd>
|
||||
</div>
|
||||
{/*
|
||||
게시본과 작업본이 갈라져 있다는 사실. 계약이 처음부터 주고 있었는데 화면이
|
||||
쓰지 않아, 작성자는 "이미 게시했는데 고친 게 아직 안 나갔다"를 목록에서
|
||||
알 수 없었다.
|
||||
*/}
|
||||
{item.hasUnpublishedChanges ? (
|
||||
<div>
|
||||
<dt>변경</dt>
|
||||
<dd className="studio-unpublished-mark">게시 뒤 수정됨</dd>
|
||||
</div>
|
||||
) : null}
|
||||
<div>
|
||||
<dt>수정</dt>
|
||||
<dd>
|
||||
@@ -440,7 +428,9 @@ export function DocumentList() {
|
||||
</dl>
|
||||
{/*
|
||||
편집은 제목 링크였고 삭제만 버튼이라, 행에서 눈에 띄는 단 하나가 되돌릴 수
|
||||
없는 동작이었다. 편집을 같은 격의 버튼으로 올리고 삭제는 그 옆에 둔다.
|
||||
없는 동작이었다. 편집을 같은 격의 버튼으로 올리고, 삭제는 한 겹 안으로
|
||||
넣는다 — 61줄짜리 목록에서 「삭제」가 61번 반복되면 그것이 이 화면의 기본
|
||||
동작처럼 보인다.
|
||||
*/}
|
||||
<div className="studio-row-actions">
|
||||
<GuardedStudioLink
|
||||
@@ -449,17 +439,24 @@ export function DocumentList() {
|
||||
>
|
||||
편집
|
||||
</GuardedStudioLink>
|
||||
<button
|
||||
className="studio-secondary-button studio-danger-button"
|
||||
type="button"
|
||||
disabled={deletingId !== null}
|
||||
onClick={() => {
|
||||
setDeleteError("");
|
||||
setPendingDelete(item);
|
||||
}}
|
||||
>
|
||||
삭제
|
||||
</button>
|
||||
<details className="studio-row-overflow">
|
||||
<summary aria-label={`${item.title || "제목 없는 작업본"} 추가 동작`}>
|
||||
⋯
|
||||
</summary>
|
||||
<div>
|
||||
<button
|
||||
className="studio-secondary-button studio-danger-button"
|
||||
type="button"
|
||||
disabled={deletingId !== null}
|
||||
onClick={() => {
|
||||
setDeleteError("");
|
||||
setPendingDelete(item);
|
||||
}}
|
||||
>
|
||||
삭제
|
||||
</button>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
</article>
|
||||
))}
|
||||
|
||||
@@ -6,17 +6,49 @@ import { useStudio } from "../use-studio.ts";
|
||||
import { GuardedStudioLink } from "./guarded-studio-link.tsx";
|
||||
import { HomeFocusEditor } from "./home-focus-editor.tsx";
|
||||
import { DOCUMENT_KIND_LABELS } from "../../shared/document-kind-labels.ts";
|
||||
import { NEXT_ACTION_LABELS, nextActionHref } from "../next-action.ts";
|
||||
|
||||
type DocumentSummary = components["schemas"]["DocumentSummary"];
|
||||
|
||||
const actionLabel = {
|
||||
CONTINUE_EDITING: "작성 계속",
|
||||
VALIDATE: "검증하기",
|
||||
FIX_VALIDATION: "오류 수정",
|
||||
CREATE_PREVIEW: "미리보기 만들기",
|
||||
PUBLISH: "게시하기",
|
||||
NONE: "게시 완료",
|
||||
} as const;
|
||||
const actionLabel = NEXT_ACTION_LABELS;
|
||||
|
||||
/**
|
||||
* 지금 이어서 할 일 하나.
|
||||
*
|
||||
* <p>대시보드는 숫자 넷과 목록 셋으로 "무엇이 얼마나 있는지" 를 보고하고 있었다. 보고는
|
||||
* 필요하지만 작성자가 이 화면을 여는 이유는 보고를 읽으려는 것이 아니라 <em>하던 일을 이어서
|
||||
* 하려는</em> 것이다. 그런데 그 다음 한 걸음은 세 목록 중 어딘가에 같은 크기로 섞여 있었다.
|
||||
*
|
||||
* <p>가장 최근에 손댄 것 하나를 맨 위에 세우고, 그 작업본의 다음 화면으로 바로 보낸다.
|
||||
*/
|
||||
function ContinueWorking({ item }: Readonly<{ item: DocumentSummary }>) {
|
||||
const href = nextActionHref(item.id, item.nextAction);
|
||||
return (
|
||||
<section className="studio-continue" aria-labelledby="studio-continue-title">
|
||||
<p className="studio-eyebrow" id="studio-continue-title">
|
||||
이어서 하기
|
||||
</p>
|
||||
<h2>
|
||||
<GuardedStudioLink href={`/studio/documents/${item.id}/edit`}>
|
||||
{item.title || "제목 없는 작업본"}
|
||||
</GuardedStudioLink>
|
||||
</h2>
|
||||
<p className="studio-continue-where">
|
||||
{[DOCUMENT_KIND_LABELS[item.kind], item.project?.label ?? "프로젝트 미지정"].join(" · ")}
|
||||
</p>
|
||||
<p className="studio-continue-state">
|
||||
{`마지막 수정 ${new Date(item.updatedAt).toLocaleDateString("ko-KR", {
|
||||
timeZone: "Asia/Seoul",
|
||||
})} · 다음 할 일 ${NEXT_ACTION_LABELS[item.nextAction]}`}
|
||||
</p>
|
||||
{href ? (
|
||||
<GuardedStudioLink className="studio-primary-action" href={href}>
|
||||
{NEXT_ACTION_LABELS[item.nextAction]}
|
||||
</GuardedStudioLink>
|
||||
) : null}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
function WorkRow({ item }: Readonly<{ item: DocumentSummary }>) {
|
||||
return (
|
||||
@@ -114,6 +146,13 @@ export function StudioDashboard() {
|
||||
const writingItems = continueWriting.filter(
|
||||
(item) => !VALIDATION_ACTIONS.includes(item.nextAction) && !readyIds.has(item.id),
|
||||
);
|
||||
/*
|
||||
이어서 할 것 하나. 아직 할 일이 남은 작업본 중 가장 최근에 손댄 것이다 — 「완료」는 더
|
||||
이어서 할 것이 없으므로 뺀다.
|
||||
*/
|
||||
const continueItem = [...continueWriting]
|
||||
.filter((item) => item.nextAction !== "NONE")
|
||||
.sort((left, right) => right.updatedAt.localeCompare(left.updatedAt))[0];
|
||||
|
||||
return (
|
||||
<div className="studio-page studio-dashboard-page">
|
||||
@@ -146,6 +185,10 @@ export function StudioDashboard() {
|
||||
위 내비게이션으로 돌아가 다시 눌러야 했다 — 대시보드가 세어 준 것과 그것을 볼 수
|
||||
있는 곳이 이어져 있지 않았다.
|
||||
*/}
|
||||
{/*
|
||||
보고보다 이어서 하기가 먼저다. 가장 최근에 손댄 작업본 하나를 맨 위에 세운다.
|
||||
*/}
|
||||
{continueItem ? <ContinueWorking item={continueItem} /> : null}
|
||||
<section className="studio-summary-grid" aria-label="Studio 요약">
|
||||
<GuardedStudioLink href="/studio/documents">
|
||||
<span>전체 작업본</span>
|
||||
|
||||
@@ -21,9 +21,31 @@ const activeRules: Readonly<Record<string, (path: string) => boolean>> =
|
||||
TECH_LOG_STUDIO_DOCUMENT_NEW: (path) => path === "/studio/documents/new",
|
||||
});
|
||||
|
||||
/**
|
||||
* 어느 일에 속한 화면인가.
|
||||
*
|
||||
* <p>여섯 자리가 같은 무게로 늘어서 있었다. 「작업본」과 「릴리즈」가 같은 크기로 나란하면
|
||||
* 어디부터 봐야 하는지를 화면이 말해 주지 않는다 — 정보 구조가 평평해 보이는 것이 그 때문이다.
|
||||
*
|
||||
* <p>글을 쓰는 일, 구조를 손보는 일, 자료를 관리하는 일, 내보내는 일 넷으로 묶는다. 계약이
|
||||
* 이름과 순서를 갖고 있으므로 여기서는 묶음만 정한다 — `Record<…>` 라 계약에 탐색 항목이
|
||||
* 늘면 컴파일러가 빈 자리를 잡는다.
|
||||
*/
|
||||
const GROUP_OF: Record<string, "작업" | "구조" | "자료" | "게시"> = {
|
||||
TECH_LOG_STUDIO_DOCUMENTS: "작업",
|
||||
TECH_LOG_STUDIO_DOCUMENT_NEW: "작업",
|
||||
TECH_LOG_STUDIO_TAXONOMY: "구조",
|
||||
TECH_LOG_STUDIO_ASSETS: "자료",
|
||||
TECH_LOG_STUDIO_PUBLICATIONS: "게시",
|
||||
TECH_LOG_STUDIO_RELEASES: "게시",
|
||||
};
|
||||
|
||||
const GROUP_ORDER = ["작업", "구조", "자료", "게시"] as const;
|
||||
|
||||
const navigation = techLogNavigation("STUDIO").map((entry) => ({
|
||||
href: entry.path,
|
||||
label: entry.label,
|
||||
group: GROUP_OF[entry.routeId] ?? "작업",
|
||||
active: activeRules[entry.routeId] ?? ((path: string) => path === entry.path),
|
||||
}));
|
||||
|
||||
@@ -33,17 +55,28 @@ function StudioNavigation({
|
||||
}: Readonly<{ currentPath: string; label: string }>) {
|
||||
return (
|
||||
<nav aria-label={label}>
|
||||
{navigation.map((item) => (
|
||||
<GuardedStudioLink
|
||||
key={item.href}
|
||||
href={item.href}
|
||||
aria-current={item.active(currentPath) ? "page" : undefined}
|
||||
>
|
||||
{item.label}
|
||||
</GuardedStudioLink>
|
||||
))}
|
||||
<a href="/">공개 사이트 보기</a>
|
||||
<StudioSessionAction />
|
||||
{GROUP_ORDER.map((group) => {
|
||||
const items = navigation.filter((item) => item.group === group);
|
||||
if (items.length === 0) return null;
|
||||
return (
|
||||
<span className="studio-nav-group" key={group}>
|
||||
<span className="studio-nav-group-label">{group}</span>
|
||||
{items.map((item) => (
|
||||
<GuardedStudioLink
|
||||
key={item.href}
|
||||
href={item.href}
|
||||
aria-current={item.active(currentPath) ? "page" : undefined}
|
||||
>
|
||||
{item.label}
|
||||
</GuardedStudioLink>
|
||||
))}
|
||||
</span>
|
||||
);
|
||||
})}
|
||||
<span className="studio-nav-group studio-nav-group--tail">
|
||||
<a href="/">공개 사이트 보기</a>
|
||||
<StudioSessionAction />
|
||||
</span>
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
import type { components } from "../../contracts/studio/generated.ts";
|
||||
|
||||
type NextAction = components["schemas"]["DocumentSummary"]["nextAction"];
|
||||
|
||||
/**
|
||||
* 서버가 알려 주는 "다음에 할 일" 의 이름과 갈 곳.
|
||||
*
|
||||
* <p>이름만 있고 갈 곳이 없던 동안 작성자는 편집 → 검증 → 미리보기 → 게시를 순서대로 밟아야만
|
||||
* 게시 화면에 닿을 수 있었고, 그 경로 어디에도 「게시」라는 말이 먼저 보이지 않아 게시하는
|
||||
* 방법을 알기 어려웠다.
|
||||
*
|
||||
* <p>표가 대시보드와 목록 두 곳에 따로 있었다. `Record<NextAction, …>` 한 벌로 모은다 — 상태가
|
||||
* 늘면 컴파일러가 빈 자리를 잡고, 두 화면이 같은 상태를 다른 이름으로 부르는 일도 없어진다.
|
||||
*/
|
||||
export const NEXT_ACTION_LABELS: Record<NextAction, string> = {
|
||||
CONTINUE_EDITING: "작성 계속",
|
||||
VALIDATE: "검증하기",
|
||||
FIX_VALIDATION: "오류 수정",
|
||||
CREATE_PREVIEW: "미리보기",
|
||||
PUBLISH: "게시하기",
|
||||
NONE: "완료",
|
||||
};
|
||||
|
||||
/** 작업본 주소 뒤에 붙는 조각. 빈 문자열이면 더 갈 곳이 없다는 뜻이다. */
|
||||
export const NEXT_ACTION_STEP: Record<NextAction, string> = {
|
||||
CONTINUE_EDITING: "edit",
|
||||
VALIDATE: "validation",
|
||||
FIX_VALIDATION: "edit",
|
||||
CREATE_PREVIEW: "preview",
|
||||
PUBLISH: "publish",
|
||||
NONE: "",
|
||||
};
|
||||
|
||||
/** 이 작업본에서 다음으로 갈 화면. 갈 곳이 없으면 `null`. */
|
||||
export function nextActionHref(documentId: string, action: NextAction): string | null {
|
||||
const step = NEXT_ACTION_STEP[action];
|
||||
return step ? `/studio/documents/${documentId}/${step}` : null;
|
||||
}
|
||||
@@ -435,3 +435,36 @@
|
||||
.studio-app .studio-taxonomy-tabs button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 17px; background: #f0f0ed; color: var(--muted); font: inherit; font-size: 14px; font-weight: 560; }
|
||||
.studio-app .studio-taxonomy-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; font-weight: 650; }
|
||||
.studio-app .studio-taxonomy-tabs button:hover:not([aria-selected="true"]) { color: var(--ink); }
|
||||
|
||||
/*
|
||||
탐색을 넷으로 묶는다 — 글을 쓰는 일, 구조를 손보는 일, 자료를 관리하는 일, 내보내는 일.
|
||||
여섯 자리가 같은 무게로 늘어서 있으면 어디부터 봐야 하는지를 화면이 말해 주지 않는다.
|
||||
*/
|
||||
.studio-app .studio-nav-group { display: inline-flex; align-items: center; gap: 15px; }
|
||||
.studio-app .studio-nav-group + .studio-nav-group { padding-left: 26px; border-left: 1px solid var(--line); }
|
||||
.studio-app .studio-nav-group-label { color: var(--faint); font-size: 11px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; }
|
||||
.studio-app .studio-desktop-navigation nav,
|
||||
.studio-app .studio-mobile-navigation nav { gap: 0; }
|
||||
|
||||
@media (max-width: 899px) {
|
||||
.studio-app .studio-mobile-navigation nav { flex-direction: column; align-items: flex-start; gap: 6px; }
|
||||
.studio-app .studio-nav-group { width: 100%; flex-wrap: wrap; }
|
||||
.studio-app .studio-nav-group + .studio-nav-group { padding-left: 0; padding-top: 10px; border-left: 0; border-top: 1px solid var(--line); }
|
||||
}
|
||||
|
||||
/* 이어서 하기 — 보고보다 다음 한 걸음이 먼저다 */
|
||||
.studio-app .studio-continue { padding-block: 30px 34px; border-bottom: 1px solid var(--line-strong); }
|
||||
.studio-app .studio-continue h2 { margin: 9px 0 0; font-size: 25px; font-weight: 650; letter-spacing: -0.028em; line-height: 1.3; }
|
||||
.studio-app .studio-continue h2 a { color: var(--ink); }
|
||||
.studio-app .studio-continue h2 a:hover { color: var(--signal); }
|
||||
.studio-app .studio-continue-where { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
|
||||
.studio-app .studio-continue-state { margin: 5px 0 0; color: var(--faint); font-family: "IBM Plex Mono", monospace; font-size: 12px; }
|
||||
.studio-app .studio-continue .studio-primary-action { margin-top: 18px; }
|
||||
|
||||
/* 행의 추가 동작 — 되돌릴 수 없는 것을 한 겹 안에 둔다 */
|
||||
.studio-app .studio-row-overflow { position: relative; }
|
||||
.studio-app .studio-row-overflow > summary { display: inline-flex; min-width: 34px; min-height: 34px; align-items: center; justify-content: center; border-radius: 5px; color: var(--muted); cursor: pointer; font-size: 15px; list-style: none; }
|
||||
.studio-app .studio-row-overflow > summary::-webkit-details-marker { display: none; }
|
||||
.studio-app .studio-row-overflow > summary:hover { background: var(--canvas); color: var(--ink); }
|
||||
.studio-app .studio-row-overflow > div { position: absolute; z-index: 5; top: 100%; right: 0; padding: 7px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--paper); box-shadow: 0 6px 18px rgb(0 0 0 / 8%); }
|
||||
.studio-app .studio-unpublished-mark { color: var(--warning); }
|
||||
|
||||
@@ -91,15 +91,26 @@ describe("TechLog Studio shell", () => {
|
||||
container.querySelectorAll<HTMLAnchorElement>(".studio-desktop-navigation a"),
|
||||
(link) => [link.textContent, link.getAttribute("href")],
|
||||
),
|
||||
/*
|
||||
탐색은 넷으로 묶인다 — 글을 쓰는 일, 구조를 손보는 일, 자료를 관리하는 일, 내보내는 일.
|
||||
여섯 자리가 같은 무게로 늘어서 있으면 어디부터 봐야 하는지를 화면이 말해 주지 않는다.
|
||||
항목과 주소는 계약이 정하고 여기서는 묶음 순서만 바뀐다.
|
||||
*/
|
||||
).toEqual([
|
||||
["작업본", "/studio/documents"],
|
||||
["게시 기록", "/studio/publications"],
|
||||
["새 문서", "/studio/documents/new"],
|
||||
["주제·프로젝트", "/studio/taxonomy"],
|
||||
["Asset", "/studio/assets"],
|
||||
["게시 기록", "/studio/publications"],
|
||||
["릴리즈", "/studio/releases"],
|
||||
["공개 사이트 보기", "/"],
|
||||
]);
|
||||
expect(
|
||||
Array.from(
|
||||
container.querySelectorAll(".studio-desktop-navigation .studio-nav-group-label"),
|
||||
(label) => label.textContent,
|
||||
),
|
||||
).toEqual(["작업", "구조", "자료", "게시"]);
|
||||
expect(screen.getByRole("link", { name: "공개 사이트 보기" })).toHaveAttribute("href", "/");
|
||||
expect(screen.queryByText(/로그인|sign in/i)).not.toBeInTheDocument();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user