From bb6eba00dbf0b1e6dd3b62b98820ff43461b68bb Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 9 Sep 2026 15:31:05 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20UX=20=EB=A6=AC=EB=B7=B0=EC=9D=98=20?= =?UTF-8?q?=EC=B6=9C=EC=8B=9C=20=EC=B0=A8=EB=8B=A8=20=EB=8B=A4=EC=84=AF=20?= =?UTF-8?q?=EA=B1=B4=EC=9D=84=20=EA=B3=A0=EC=B9=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit B1. 검증·미리보기 화면이 CSS 없이 배포됐다. `workflow.module.css` 를 import 하는 파일이 하나도 없었고, Vite 의 CSS Module 은 import 되어야 번들에 들어간다. 제목이 62px 가 아니라 16px 로 나왔고 미리보기의 링크 두 개가 공백 없이 붙었다. 규칙이 전부 `:global()` 이었으므로 모듈일 이유가 없다 — studio.css 로 옮겼다. B2. Asset 라이브러리에 스타일이 없고 진입 경로도 없었다. 네 클래스에 규칙이 하나도 없어 key·상태·사용 수가 공백 없이 이어 붙었다. 스무 개짜리 목록에 썸네일도 없어 무엇을 고르는지 눌러 봐야 알았다. 내비게이션에도 없어서 URL 을 직접 쳐야 닿았다 — "정리하는 화면" 에 정리하러 갈 길이 없었다. B3. 삭제에 확인이 없었다. 문서·주제·프로젝트·릴리즈·Asset 전부 한 번에 영구 삭제였고, 그 「삭제」가 행에서 시각적으로 가장 강한 요소였다(16px/600 빨강). 정작 그 행에서 해야 할 일인 「검증하기」는 13px/400 이었다. 확인 창을 하나 만들어 다섯 곳에 붙이고, 행의 우선순위를 되돌렸다. B4(일부). robots.txt 가 광고하던 sitemap 이 404 였다. 무엇이 게시됐는지는 서버만 알므로 정적 파일이 아니라 조회로 만든다(백엔드 커밋 참조). robots.txt 가 그 주소를 가리키게 했다. B5. 라우트 프리픽스 밖 URL 이 nginx 의 맨 `Not Found` 로 끝났다. 404 상태는 그대로 두고 — 크롤러에게 링크가 깨졌다고 말하는 것이 그것이다 — 본문만 앱을 주도록 `error_page 404 @not_found` 를 뒀다. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01PTnWufiY9ATv57egkKKVAV --- public/robots.txt | 5 +- scripts/generate-nginx-config.ts | 32 ++-- .../contracts/tech-log-route-contract.ts | 2 +- .../studio/components/asset-library.tsx | 44 ++++- .../components/destructive-confirm-dialog.tsx | 99 ++++++++++ .../studio/components/document-list.tsx | 25 ++- .../studio/components/release-manager.tsx | 22 ++- .../studio/components/taxonomy-manager.tsx | 42 ++++- .../studio/components/topic-editor.tsx | 22 ++- .../tech-log/presentation/styles/studio.css | 174 ++++++++++++++++++ .../presentation/styles/workflow.module.css | 96 ---------- .../features/tech-log/asset-library.test.tsx | 45 ++++- .../tech-log/navigation-derivation.test.ts | 1 + .../features/tech-log/route-contract.test.ts | 11 +- .../tech-log/studio-shell-smoke.test.tsx | 1 + 15 files changed, 496 insertions(+), 125 deletions(-) create mode 100644 src/features/tech-log/presentation/studio/components/destructive-confirm-dialog.tsx delete mode 100644 src/features/tech-log/presentation/styles/workflow.module.css diff --git a/public/robots.txt b/public/robots.txt index 5b53265..69f5930 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -2,6 +2,9 @@ User-agent: * Allow: / Disallow: /studio +# sitemap 은 /api 아래에 있다. 무엇이 게시됐는지는 빌드가 아니라 게시 시점에 정해지고 그것을 +# 아는 것은 서버뿐이라 정적 파일로 만들 수 없다. Disallow 보다 먼저 두어야 크롤러가 읽는다. +Allow: /api/v1/public/sitemap.xml Disallow: /api/ -Sitemap: https://hyeonworks.com/sitemap.xml +Sitemap: https://hyeonworks.com/api/v1/public/sitemap.xml diff --git a/scripts/generate-nginx-config.ts b/scripts/generate-nginx-config.ts index 308ea6b..f17cd89 100644 --- a/scripts/generate-nginx-config.ts +++ b/scripts/generate-nginx-config.ts @@ -108,13 +108,6 @@ async function main(): Promise { const rawBase = process.env["VITE_ROUTER_BASE_PATH"] ?? "/"; const basePath = rawBase.endsWith("/") ? rawBase.slice(0, -1) : rawBase; - const [notFoundType, notFoundCharsetParam] = contract.notFound.contentType - .split(";") - .map((part) => part.trim()); - const notFoundCharset = (notFoundCharsetParam ?? "charset=utf-8") - .replace(/^charset=/i, "") - .toLowerCase(); - // Regex locations now, matching the Studio half: the contract declares which // paths the router serves, not which ones the fixture happened to contain, so // a record published after this build is served instead of 404ed at the edge. @@ -217,14 +210,25 @@ ${studioLocations} add_header Cache-Control "${assetCache}" always; } - # Anything else is not a route this deployment serves. + # 이 배포가 서비스하는 라우트가 아닌 주소. + # + # 상태 코드는 404 그대로 둔다 — 크롤러와 우리에게 링크가 깨졌다고 말해 주는 것이 그것이고, + # 200 껍데기를 주면 그 신호가 사라진다. 다만 본문은 앱을 준다. 예전에는 nginx 의 맨 + # "Not Found" 가 흰 화면으로 나가서, 오타 링크 하나에 헤더도 내비도 없는 막다른 길이 됐다. + # 앱에는 path "*" 로 선언된 404 라우트가 이미 있고 청크도 빌드되는데 닿을 길이 없었다. + # + # error_page 404 @not_found 는 "=" 없이 쓰면 원래 상태 코드를 유지한다. + error_page 404 @not_found; + + location @not_found { +${secure} + add_header Cache-Control "${indexCache}" always; + # index.html 이 없으면 여기서 끝난다. recursive_error_pages 는 기본이 off 라 되돌지 않는다. + try_files /index.html =404; + } + location / { - # The contract states the content type with its charset attached - # (text/plain;charset=UTF-8), but nginx takes the two separately — - # default_type rejects a parameter outright. - default_type ${notFoundType}; - charset ${notFoundCharset}; - return ${contract.notFound.status} "${contract.notFound.body}"; + return ${contract.notFound.status}; } } `; 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 6d77a2c..c2b11fb 100644 --- a/src/features/tech-log/contracts/tech-log-route-contract.ts +++ b/src/features/tech-log/contracts/tech-log-route-contract.ts @@ -56,7 +56,7 @@ const TECH_LOG_ROUTE_SPECS = [ defineSpec({ routeId: "TECH_LOG_STUDIO_DOCUMENT_PUBLISH", path: "/studio/documents/:id/publish", layoutGroup: "STUDIO", paramsSchema: "TechLogDocumentIdParams", searchSchema: null, title: "게시", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_STUDIO_PUBLICATIONS", path: "/studio/publications", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "게시 기록", navigationLabel: "게시 기록", navigationOrder: 20 }), defineSpec({ routeId: "TECH_LOG_STUDIO_PUBLICATION_PREVIEW", path: "/studio/publications/:publicationEventId/preview", layoutGroup: "STUDIO", paramsSchema: "TechLogPublicationEventIdParams", searchSchema: null, title: "게시 Snapshot", navigationLabel: null, navigationOrder: null }), - defineSpec({ routeId: "TECH_LOG_STUDIO_ASSETS", path: "/studio/assets", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "Asset", navigationLabel: null, navigationOrder: null }), + defineSpec({ routeId: "TECH_LOG_STUDIO_ASSETS", path: "/studio/assets", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "Asset", navigationLabel: "Asset", navigationOrder: 45 }), defineSpec({ routeId: "TECH_LOG_STUDIO_TAXONOMY", path: "/studio/taxonomy", layoutGroup: "STUDIO", paramsSchema: null, searchSchema: null, title: "주제와 프로젝트", navigationLabel: "주제·프로젝트", navigationOrder: 40 }), defineSpec({ routeId: "TECH_LOG_STUDIO_PROJECT_EDIT", path: "/studio/projects/:id", layoutGroup: "STUDIO", paramsSchema: "TechLogDocumentIdParams", searchSchema: null, title: "프로젝트 편집", navigationLabel: null, navigationOrder: null }), defineSpec({ routeId: "TECH_LOG_STUDIO_TOPIC_EDIT", path: "/studio/topics/:id", layoutGroup: "STUDIO", paramsSchema: "TechLogDocumentIdParams", searchSchema: null, title: "주제 편집", navigationLabel: null, navigationOrder: null }), diff --git a/src/features/tech-log/presentation/studio/components/asset-library.tsx b/src/features/tech-log/presentation/studio/components/asset-library.tsx index 1f656fc..19dc1de 100644 --- a/src/features/tech-log/presentation/studio/components/asset-library.tsx +++ b/src/features/tech-log/presentation/studio/components/asset-library.tsx @@ -1,4 +1,5 @@ import { useEffect, useId, useRef, useState, type FormEvent } from "react"; +import { DestructiveConfirmDialog } from "./destructive-confirm-dialog.tsx"; import type { Asset, AssetDetail } from "../../../contracts/studio/contract.ts"; import type { StudioAssetGateway } from "../../../application/ports/studio-asset-gateway.ts"; @@ -41,6 +42,7 @@ export function AssetLibrary(props: Readonly<{ gateway: StudioAssetGateway }>) { const [selected, setSelected] = useState(null); const [pending, setPending] = useState(false); const [notice, setNotice] = useState(""); + const [confirmDelete, setConfirmDelete] = useState(false); // Wrapped in an object, not a bare `string | null`: the "no appended row to // land on" case still needs a focus move (to the page heading), and a bare // null cannot express "a move is pending, target unknown". @@ -216,6 +218,7 @@ export function AssetLibrary(props: Readonly<{ gateway: StudioAssetGateway }>) { }); setAssets((current) => current.filter((item) => item.id !== detail.asset.id)); setNotice("삭제했습니다."); + setConfirmDelete(false); closeDetailAfterRemoval(); } catch (error) { setNotice( @@ -253,8 +256,12 @@ export function AssetLibrary(props: Readonly<{ gateway: StudioAssetGateway }>) { + {/* + 확인 창이 열려 있는 동안에는 같은 문구를 창 안에서만 말한다. 두 벌이 화면에 남으면 읽는 + 사람은 무엇이 방금 일어난 일인지 고르게 된다. + */}

- {notice} + {confirmDelete ? "" : notice}

{listStatus === "LOADING" ? ( @@ -292,6 +299,21 @@ export function AssetLibrary(props: Readonly<{ gateway: StudioAssetGateway }>) {
    {assets.map((asset) => (
  • + {/* + key 만 있던 동안 이 목록은 "무엇을 고르는지" 를 말해 주지 못했다. Asset 이 스무 + 개면 key 스무 줄이고, 그중 어느 것이 찾던 도식인지는 눌러 봐야 알았다. + 썸네일은 그 왕복을 없앤다. + + 주소가 없거나(업로드 처리 중) 그림이 아닌 것(첨부파일)에는 자리를 만들지 않는다 — + 빈 상자가 남으면 목록이 어긋나 보인다. + */} + {asset.publicPath && asset.mediaType.startsWith("image/") ? ( + + ) : ( + + )} ) : ( @@ -353,6 +379,20 @@ export function AssetLibrary(props: Readonly<{ gateway: StudioAssetGateway }>) { ) : null} + setConfirmDelete(false)} + onConfirm={() => { + if (selected) void remove(selected); + }} + /> ); } diff --git a/src/features/tech-log/presentation/studio/components/destructive-confirm-dialog.tsx b/src/features/tech-log/presentation/studio/components/destructive-confirm-dialog.tsx new file mode 100644 index 0000000..cba80be --- /dev/null +++ b/src/features/tech-log/presentation/studio/components/destructive-confirm-dialog.tsx @@ -0,0 +1,99 @@ +import { useEffect, useRef } from "react"; + +/** + * 되돌릴 수 없는 일을 하기 전에 한 번 묻는 자리. + * + *

    Studio 의 삭제는 전부 한 번에 영구 삭제였다 — 확인도 되돌리기도 없었다. 그리고 그 「삭제」가 + * 행에서 시각적으로 가장 강한 요소였다(빨강 600). 실수로 누르면 그것으로 끝났다. + * + *

    되돌리기(undo)를 두지 않는 이유는 서버가 삭제를 되돌릴 방법을 갖고 있지 않아서다. 그러니 + * 막을 자리는 누르기 직전뿐이고, 그때 무엇이 지워지는지를 이름으로 보여 준다 — "이 항목을 + * 지울까요?" 는 잘못 고른 것을 잡아 주지 못한다. + * + *

    기본 초점은 「취소」에 둔다. 열자마자 Enter 를 눌러도 아무 일이 없어야 한다. + */ +export function DestructiveConfirmDialog({ + open, + pending, + title, + targetName, + description, + confirmLabel = "삭제", + error, + onCancel, + onConfirm, +}: { + open: boolean; + /** 요청이 나가 있는 동안 두 버튼을 함께 막는다. 두 번 눌러 두 번 지우는 일을 없앤다. */ + pending: boolean; + title: string; + /** 지워지는 대상의 이름. 잘못 고른 것을 여기서 잡는다. */ + targetName: string; + /** 함께 사라지는 것이 있으면 적는다. 없으면 비운다. */ + description?: string; + confirmLabel?: string; + error?: string; + onCancel(): void; + onConfirm(): void; +}) { + const dialogRef = useRef(null); + const cancelRef = useRef(null); + + useEffect(() => { + const dialog = dialogRef.current; + if (!dialog) return; + if (open && !dialog.open) { + dialog.showModal(); + cancelRef.current?.focus(); + } else if (!open && dialog.open) { + dialog.close(); + } + }, [open]); + + const cancel = () => { + dialogRef.current?.close(); + onCancel(); + }; + + return ( +

    { + event.preventDefault(); + if (!pending) cancel(); + }} + > +
    +

    CONFIRM

    +

    {title}

    +

    + {targetName} +

    + {description ?

    {description}

    : null} +

    되돌릴 수 없습니다.

    + {error ? ( +

    + {error} +

    + ) : null} +
    + + +
    +
    +
    + ); +} diff --git a/src/features/tech-log/presentation/studio/components/document-list.tsx b/src/features/tech-log/presentation/studio/components/document-list.tsx index 35c8c66..9db40c0 100644 --- a/src/features/tech-log/presentation/studio/components/document-list.tsx +++ b/src/features/tech-log/presentation/studio/components/document-list.tsx @@ -1,4 +1,5 @@ import { useEffect, useState, type FormEvent } from "react"; +import { DestructiveConfirmDialog } from "./destructive-confirm-dialog.tsx"; import type { ListDocumentsQuery } from "../../../application/ports/studio-gateway.ts"; import type { DocumentPage } from "../../../contracts/studio/contract.ts"; @@ -67,6 +68,12 @@ export function DocumentList() { const { gateway, managementGateway, setRequestAnnouncement } = useStudio(); const [deletingId, setDeletingId] = useState(null); const [deleteError, setDeleteError] = useState(""); + /* + 지우기 직전에 무엇이 지워지는지 이름으로 보여 주고 한 번 묻는다. 예전에는 이 버튼이 곧 + 영구 삭제였고, 그 버튼이 행에서 시각적으로 가장 강한 요소였다. + */ + const [pendingDelete, setPendingDelete] = + useState(null); const [searchDraft, setSearchDraft] = useState(""); const [q, setQ] = useState(""); const [kind, setKind] = useState(); @@ -115,6 +122,7 @@ export function DocumentList() { ); } setRequestAnnouncement(`작업본 ${item.title || "제목 없음"} 을(를) 삭제했습니다.`); + setPendingDelete(null); // 다시 불러오지 않고 이 행만 지운다. 목록은 커서 페이지네이션이라 재조회하면 다음 // 항목이 빈 자리를 즉시 채우고, 개수도 20 그대로다 — 작성자에게는 삭제가 아무 일도 // 하지 않은 것처럼 보인다. 삭제가 성공한 뒤의 화면은 그 행이 없는 화면이 맞다. @@ -343,7 +351,10 @@ export function DocumentList() { className="studio-secondary-button studio-danger-button" type="button" disabled={deletingId !== null} - onClick={() => void removeDocument(item)} + onClick={() => { + setDeleteError(""); + setPendingDelete(item); + }} > 삭제 @@ -367,6 +378,18 @@ export function DocumentList() { /> ) : null} + setPendingDelete(null)} + onConfirm={() => { + if (pendingDelete) void removeDocument(pendingDelete); + }} + /> ); } diff --git a/src/features/tech-log/presentation/studio/components/release-manager.tsx b/src/features/tech-log/presentation/studio/components/release-manager.tsx index fea2877..362f409 100644 --- a/src/features/tech-log/presentation/studio/components/release-manager.tsx +++ b/src/features/tech-log/presentation/studio/components/release-manager.tsx @@ -1,4 +1,5 @@ import { useCallback, useEffect, useState, type FormEvent } from "react"; +import { DestructiveConfirmDialog } from "./destructive-confirm-dialog.tsx"; import type { ReleaseEditResponse, @@ -85,6 +86,8 @@ export function ReleaseManager() { const [loading, setLoading] = useState(true); const [error, setError] = useState(""); const [pending, setPending] = useState(false); + /* 릴리즈는 공개 사이트에 남는 기록이다. 지우기 전에 무엇이 지워지는지 이름으로 보여 준다. */ + const [pendingDelete, setPendingDelete] = useState(null); const [generation, setGeneration] = useState(0); const [newTitle, setNewTitle] = useState(""); /* 방금 만든 릴리즈를 목록에서 짚어 준다 — 목록이 길면 어느 것이 새것인지 알기 어렵다. */ @@ -145,6 +148,7 @@ export function ReleaseManager() { try { await managementGateway.deleteRelease(release.id, release.version); setRequestAnnouncement(`릴리즈 ${release.versionLabel} 을(를) 삭제했습니다.`); + setPendingDelete(null); reload(); } catch (error) { setError(managementFailureMessage(error, "삭제하지 못했습니다.")); @@ -242,7 +246,10 @@ export function ReleaseManager() { className="studio-secondary-button studio-danger-button" type="button" disabled={pending} - onClick={() => void remove(release)} + onClick={() => { + setError(""); + setPendingDelete(release); + }} > 삭제 @@ -252,7 +259,18 @@ export function ReleaseManager() { )} - + setPendingDelete(null)} + onConfirm={() => { + if (pendingDelete) void remove(pendingDelete); + }} + /> ); } diff --git a/src/features/tech-log/presentation/studio/components/taxonomy-manager.tsx b/src/features/tech-log/presentation/studio/components/taxonomy-manager.tsx index 55511ea..ab2f6ab 100644 --- a/src/features/tech-log/presentation/studio/components/taxonomy-manager.tsx +++ b/src/features/tech-log/presentation/studio/components/taxonomy-manager.tsx @@ -1,4 +1,5 @@ import { useCallback, useEffect, useState, type FormEvent } from "react"; +import { DestructiveConfirmDialog } from "./destructive-confirm-dialog.tsx"; import type { ProjectIndexItem, TopicEdit } from "../../../contracts/management/contract.ts"; import { managementFailureMessage } from "../../../application/ports/management-gateway-error.ts"; @@ -40,6 +41,13 @@ export function TaxonomyManager() { const [loading, setLoading] = useState(true); const [error, setError] = useState(""); const [pending, setPending] = useState(false); + /* + 주제와 프로젝트는 다른 기록이 매달려 있는 자리다. 지우기 직전에 무엇이 지워지는지 이름으로 + 보여 주고 한 번 묻는다 — 목록에서 두 줄 아래를 눌렀다는 것을 여기서 잡는다. + */ + const [pendingDelete, setPendingDelete] = useState< + { kind: "TOPIC"; topic: TopicEdit } | { kind: "PROJECT"; project: ProjectIndexItem } | null + >(null); const [generation, setGeneration] = useState(0); const [topicName, setTopicName] = useState(""); @@ -154,6 +162,7 @@ export function TaxonomyManager() { try { await managementGateway.deleteTopic(topic.id, topic.version); setRequestAnnouncement(`주제 ${topic.name} 을(를) 삭제했습니다.`); + setPendingDelete(null); reload(); } catch (error) { setError(managementFailureMessage(error, "주제를 삭제하지 못했습니다.")); @@ -169,6 +178,7 @@ export function TaxonomyManager() { try { await managementGateway.deleteProject(project.id, project.version); setRequestAnnouncement(`프로젝트 ${project.name} 을(를) 삭제했습니다.`); + setPendingDelete(null); reload(); } catch (error) { setError(managementFailureMessage(error, "프로젝트를 삭제하지 못했습니다.")); @@ -310,7 +320,10 @@ export function TaxonomyManager() { className="studio-secondary-button studio-danger-button" type="button" disabled={pending} - onClick={() => void removeTopic(topic)} + onClick={() => { + setError(""); + setPendingDelete({ kind: "TOPIC", topic }); + }} > 삭제 @@ -387,7 +400,10 @@ export function TaxonomyManager() { className="studio-secondary-button studio-danger-button" type="button" disabled={pending} - onClick={() => void removeProject(project)} + onClick={() => { + setError(""); + setPendingDelete({ kind: "PROJECT", project }); + }} > 삭제 @@ -400,6 +416,28 @@ export function TaxonomyManager() { )} ) : null} + setPendingDelete(null)} + onConfirm={() => { + if (!pendingDelete) return; + if (pendingDelete.kind === "PROJECT") void removeProject(pendingDelete.project); + else void removeTopic(pendingDelete.topic); + }} + /> ); } diff --git a/src/features/tech-log/presentation/studio/components/topic-editor.tsx b/src/features/tech-log/presentation/studio/components/topic-editor.tsx index f39b408..7a2c9d3 100644 --- a/src/features/tech-log/presentation/studio/components/topic-editor.tsx +++ b/src/features/tech-log/presentation/studio/components/topic-editor.tsx @@ -1,4 +1,5 @@ import { useCallback, useEffect, useState, type FormEvent } from "react"; +import { DestructiveConfirmDialog } from "./destructive-confirm-dialog.tsx"; import type { TopicEdit, TopicVariantEdit } from "../../../contracts/management/contract.ts"; import { managementFailureMessage } from "../../../application/ports/management-gateway-error.ts"; @@ -177,6 +178,9 @@ export function TopicEditor() { } }; + /* 축을 지우면 거기 걸려 있던 기록이 그 주제의 공통 기록으로 돌아간다. 되돌릴 수 없으므로 묻는다. */ + const [pendingDelete, setPendingDelete] = useState(null); + const removeVariant = async (variant: TopicVariantEdit) => { if (pending || variant.id === undefined || variant.version === undefined) return; setPending(true); @@ -184,6 +188,7 @@ export function TopicEditor() { try { await managementGateway.deleteTopicVariant(topicId, variant.id, variant.version); setRequestAnnouncement(`${variant.title} 을(를) 삭제했습니다.`); + setPendingDelete(null); reload(); } catch (failure) { setError(managementFailureMessage(failure, "축을 삭제하지 못했습니다.")); @@ -376,7 +381,10 @@ export function TopicEditor() { className="studio-danger-action" type="button" disabled={pending} - onClick={() => void removeVariant(variant)} + onClick={() => { + setError(""); + setPendingDelete(variant); + }} > 삭제 @@ -421,6 +429,18 @@ export function TopicEditor() { ) : null} + setPendingDelete(null)} + onConfirm={() => { + if (pendingDelete) void removeVariant(pendingDelete); + }} + /> ); } diff --git a/src/features/tech-log/presentation/styles/studio.css b/src/features/tech-log/presentation/styles/studio.css index 2d9f06d..f90d6da 100644 --- a/src/features/tech-log/presentation/styles/studio.css +++ b/src/features/tech-log/presentation/styles/studio.css @@ -255,3 +255,177 @@ /* 지금 보고 있는 쪽. 배경 대신 글자만 진하게. */ .studio-app .studio-pagination button[aria-current="page"] { color: var(--ink); font-weight: 700; } .studio-app .studio-pagination__gap { min-width: 20px; color: var(--faint); text-align: center; } + +/* -------------------------------------------------------------------------- + 검증·미리보기 화면. + + 이 규칙들은 `workflow.module.css` 에 있었는데 그 파일을 import 하는 곳이 하나도 없었다. + Vite 의 CSS Module 은 import 되어야 번들에 들어가므로, 세 화면(검증·미리보기·검증 보고)이 + 스타일 없이 배포됐다 — 제목이 62px 가 아니라 16px 로 나오고, 미리보기의 링크 두 개가 + 공백 없이 붙어 「검증 화면으로 이동편집으로 돌아가기」로 보였다. + + 자매 파일 `publication-flow.module.css` 는 `publication-flow-classes.ts` 가 import 한다. + 여기서는 규칙이 전부 `:global()` 이었으므로 모듈일 이유가 없다 — 이 파일로 옮긴다. + -------------------------------------------------------------------------- */ +.studio-workflow-screen, +.studio-preview-screen { min-width: 0; } + +.studio-workflow-heading, +.studio-preview-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding-bottom: 42px; border-bottom: 1px solid var(--line-strong); } +.studio-workflow-heading h1, +.studio-preview-toolbar h1 { margin: 0; font-size: clamp(38px, 5vw, 62px); line-height: 1.06; letter-spacing: -0.045em; } +.studio-workflow-heading > div > p:last-child, +.studio-preview-toolbar > div > p:last-child { max-width: 780px; margin: 16px 0 0; color: var(--muted); font-size: 17px; line-height: 1.6; overflow-wrap: anywhere; } +.studio-workflow-quiet-link { display: inline-flex; min-height: 44px; align-items: center; color: var(--signal); font-weight: 650; white-space: nowrap; } + +.studio-workflow-gate { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 36px; align-items: center; margin-top: 34px; padding: 28px; border: 1px solid var(--line-strong); border-left-width: 4px; } +.studio-workflow-gate--ready { border-left-color: #166748; background: #f3faf6; } +.studio-workflow-gate--blocked { border-left-color: #9a5a1f; background: #fff9f0; } +.studio-workflow-gate h2 { margin: 0; font-size: 25px; letter-spacing: -0.03em; } +.studio-workflow-gate p:last-child { margin: 10px 0 0; color: var(--muted); line-height: 1.65; } +.studio-workflow-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } +/* Studio 의 나머지와 같은 언어 — 상자 없이 글자의 굵기와 색으로만 격을 나눈다. */ +.studio-workflow-actions button, +.studio-workflow-actions a { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding-inline: 2px; border: 0; border-radius: 0; background: none; color: var(--muted); font-weight: 600; } +.studio-workflow-actions button:hover:not(:disabled), +.studio-workflow-actions a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; } +.studio-workflow-actions button:first-child { color: var(--ink); font-weight: 700; } +.studio-workflow-actions button:disabled { color: var(--faint); cursor: wait; } +.studio-workflow-feedback { margin: 18px 0 0; padding: 14px 16px; border-left: 3px solid var(--signal); background: #f5f7ff; } +.studio-workflow-loading { min-height: 240px; padding-block: 56px; color: var(--muted); } + +.studio-workflow-report { margin-top: 54px; border-top: 1px solid var(--line-strong); } +.studio-workflow-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 26px; border-bottom: 1px solid var(--line); } +.studio-workflow-section-heading h2 { margin: 0; font-size: 28px; letter-spacing: -0.03em; } +.studio-workflow-status { display: inline-flex; min-height: 32px; align-items: center; padding-inline: 11px; border: 1px solid currentColor; border-radius: 999px; font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 700; } +.studio-workflow-status--invalid { color: #8f2f27; } +.studio-workflow-status--warnings { color: #8b5a14; } +.studio-workflow-status--valid { color: #166748; } +.studio-workflow-metadata, +.studio-preview-metadata { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-bottom: 1px solid var(--line); } +.studio-workflow-metadata div, +.studio-preview-metadata div { min-width: 0; padding: 20px; border-right: 1px solid var(--line); } +.studio-workflow-metadata div:last-child, +.studio-preview-metadata div:last-child { border-right: 0; } +.studio-workflow-metadata dt, +.studio-preview-metadata dt { color: var(--muted); font-size: 11px; } +.studio-workflow-metadata dd, +.studio-preview-metadata dd { margin: 7px 0 0; font-size: 13px; overflow-wrap: anywhere; } +.studio-workflow-issue-list { margin: 0; padding: 0; list-style: none; } +.studio-workflow-issue-list li { min-width: 0; border-bottom: 1px solid var(--line); } +.studio-workflow-issue-list a { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; min-width: 0; gap: 18px; align-items: start; padding-block: 22px; color: inherit; } +.studio-workflow-issue-severity { color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 11px; } +.studio-workflow-issue-body { display: grid; min-width: 0; gap: 7px; } +.studio-workflow-issue-body strong, +.studio-workflow-issue-body small { overflow-wrap: anywhere; } +.studio-workflow-issue-body small { color: var(--muted); font-family: "IBM Plex Mono", monospace; } +.studio-workflow-empty-issues, +.studio-workflow-empty-panel { margin: 0; padding-block: 42px; border-bottom: 1px solid var(--line); color: var(--muted); } +.studio-workflow-empty-panel h2 { margin: 0; color: var(--ink); font-size: 25px; } +.studio-workflow-empty-panel p { margin: 10px 0 0; } + +.studio-preview-toolbar--compact { padding-bottom: 28px; } +.studio-preview-title { margin: 0; color: var(--ink); font-size: 28px; font-weight: 700; letter-spacing: -0.03em; } +.studio-preview-state { display: flex; justify-content: space-between; gap: 28px; align-items: center; margin-top: 24px; padding: 20px; border: 1px solid var(--line-strong); border-left-width: 4px; } +.studio-preview-state strong { font-family: "IBM Plex Mono", monospace; font-size: 12px; } +.studio-preview-state p { margin: 5px 0 0; color: var(--muted); } +.studio-preview-state--current { border-left-color: #166748; background: #f3faf6; } +.studio-preview-state--none, +.studio-preview-state--stale { border-left-color: #9a5a1f; background: #fff9f0; } +.studio-preview-state--expired { border-left-color: #8f2f27; background: #fff7f4; } +.studio-preview-metadata { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; border-top: 1px solid var(--line); } +.studio-preview-public-frame { min-width: 0; margin-top: 38px; overflow: clip; border: 1px solid var(--line); background: var(--paper); } +.studio-preview-public-frame .public-record-embedded { width: 100%; max-width: none; margin: 0; padding: clamp(24px, 5vw, 56px); } + +@media (max-width: 1024px) { + .studio-workflow-gate { grid-template-columns: minmax(0, 1fr); } + .studio-preview-state { align-items: flex-start; flex-direction: column; } +} + +@media (max-width: 767px) { + .studio-workflow-heading, + .studio-preview-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; padding-bottom: 28px; } + .studio-workflow-quiet-link { white-space: normal; } + .studio-workflow-gate { margin-top: 24px; padding: 22px 18px; } + .studio-workflow-actions { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr); } + .studio-workflow-metadata, + .studio-preview-metadata { grid-template-columns: minmax(0, 1fr); } + .studio-workflow-metadata div, + .studio-preview-metadata div { border-right: 0; border-bottom: 1px solid var(--line); } + .studio-workflow-metadata div:last-child, + .studio-preview-metadata div:last-child { border-bottom: 0; } + .studio-workflow-issue-list a { grid-template-columns: minmax(0, 1fr); gap: 8px; } + .studio-workflow-issue-list a > span:last-child { display: none; } + .studio-preview-public-frame .public-record-embedded { padding: 22px 16px; } +} + +/* 지난 판정은 현재 것과 같은 무게로 보이면 안 된다 — 읽는 사람이 지금 상태로 읽는다. */ +.studio-workflow-status--stale { border-color: var(--line); background: var(--paper); color: var(--muted); } +.studio-workflow-stale-notice { margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--paper); color: var(--muted); font-size: 13px; line-height: 1.6; } +.studio-workflow-issue-list--stale { opacity: 0.62; } + +/* -------------------------------------------------------------------------- + Asset 라이브러리. + + 이 화면이 쓰는 네 클래스에는 규칙이 하나도 없었다. `
  • ` 가 브라우저 기본 + `display: list-item` 으로 떨어져 key·상태·사용 수가 공백 없이 이어 붙었고 — + `ap4-edge-trust-architecture-8125e9e8READY사용 0건` — 스무 개짜리 목록이 한 덩어리로 + 보였다. 내비게이션에도 없어 URL 을 직접 쳐야 닿는 화면이었다. + -------------------------------------------------------------------------- */ +.studio-app .asset-library-list { display: grid; margin: 24px 0 0; padding: 0; border-top: 1px solid var(--line); list-style: none; } +.studio-app .asset-library-list li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding-block: 12px; border-bottom: 1px solid var(--line); } +/* 고른 것을 목록 안에서 잃지 않게. 배경 대신 왼쪽 선으로만 표시한다. */ +.studio-app .asset-library-list li:has(button[aria-current="true"]) { border-left: 3px solid var(--signal); padding-left: 13px; margin-left: -16px; } +.studio-app .asset-library-list img { width: 56px; height: 40px; border: 1px solid var(--line); object-fit: contain; background: #fff; } +.studio-app .asset-library-list__glyph { display: inline-flex; width: 56px; height: 40px; align-items: center; justify-content: center; border: 1px solid var(--line); color: var(--faint); font-size: 12px; } +/* key 는 눌러서 상세를 여는 자리다. Studio 의 다른 곳과 같은 언어 — 상자 없이 글자만. */ +.studio-app .asset-library-list button { min-height: 40px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; text-align: left; overflow-wrap: anywhere; } +.studio-app .asset-library-list button:hover { text-decoration: underline; text-underline-offset: 4px; } +.studio-app .asset-library-list button[aria-current="true"] { font-weight: 700; } +.studio-app .asset-library-list span { color: var(--muted); font-size: 13px; white-space: nowrap; } + +.studio-app .asset-detail { margin-top: 28px; padding: 24px; border: 1px solid var(--line-strong); border-left-width: 4px; border-left-color: var(--signal); } +.studio-app .asset-detail h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; overflow-wrap: anywhere; } +.studio-app .asset-detail > p { margin: 8px 0 0; color: var(--muted); font-size: 14px; } +.studio-app .asset-detail ul { margin: 14px 0 0; padding-left: 18px; color: var(--ink); font-size: 15px; line-height: 1.7; } +.studio-app .asset-detail-actions { display: flex; gap: 8px; margin-top: 20px; } +.studio-app .asset-detail-actions button { min-height: 44px; padding-inline: 2px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; } +.studio-app .asset-detail-actions button:hover:not(:disabled) { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; } +.studio-app .asset-detail-actions button:disabled { color: var(--faint); cursor: wait; } + +@media (max-width: 640px) { + .studio-app .asset-library-list li { grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "thumb key" "thumb meta"; row-gap: 4px; } + .studio-app .asset-library-list img, + .studio-app .asset-library-list__glyph { width: 40px; height: 30px; grid-area: thumb; } + .studio-app .asset-library-list button { grid-area: key; } +} + +/* -------------------------------------------------------------------------- + 되돌릴 수 없는 일을 묻는 자리. + -------------------------------------------------------------------------- */ +.studio-confirm-dialog { max-width: 460px; padding: 0; border: 1px solid var(--line-strong); background: var(--paper, #fff); } +.studio-confirm-dialog::backdrop { background: rgb(23 24 27 / 38%); } +.studio-confirm-dialog .studio-dialog-body { padding: 28px; } +.studio-confirm-dialog h2 { margin: 4px 0 0; font-size: 24px; letter-spacing: -0.03em; } +/* 무엇이 지워지는지. 잘못 고른 것을 잡아 주는 것은 이 한 줄이다. */ +.studio-confirm-dialog .studio-confirm-target { margin: 14px 0 0; padding: 12px 14px; border-left: 3px solid var(--line-strong); background: #f7f7f5; color: var(--ink); font-weight: 650; overflow-wrap: anywhere; } +.studio-confirm-dialog p { margin: 12px 0 0; color: var(--muted); line-height: 1.65; } +.studio-confirm-dialog .studio-confirm-warning { color: var(--danger, #b4232a); font-weight: 600; } +.studio-confirm-dialog .studio-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; } +.studio-confirm-dialog .studio-dialog-actions button { min-height: 44px; padding-inline: 4px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; } +.studio-confirm-dialog .studio-dialog-actions button:hover:not(:disabled) { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; } +/* 취소가 기본 초점이다. 실행 쪽만 색으로 표시한다. */ +.studio-confirm-dialog .studio-confirm-destructive { color: var(--danger, #b4232a); font-weight: 700; } +.studio-confirm-dialog .studio-dialog-actions button:disabled { color: var(--faint); cursor: wait; } + +/* + 행의 우선순위를 되돌린다. + + 작업본 목록 첫 행을 재어 보면 `삭제` 가 16px/600 빨강으로 가장 강하고, 정작 그 행에서 해야 할 + 일인 `검증하기` 는 13px/400 으로 가장 약했다. 되돌릴 수 없는 동작이 가장 눈에 띄고 다음 단계가 + 가장 안 보이는 배치였다. +*/ +.studio-app .studio-document-row dl > div:nth-child(2) dd a { color: var(--ink); font-size: 16px; font-weight: 700; } +.studio-app .studio-document-row dl > div:nth-child(2) dd a:hover { text-decoration: underline; text-underline-offset: 4px; } +/* 삭제는 여전히 빨강이되 이 행에서 가장 강한 것은 아니게 둔다. */ +.studio-app .studio-document-row .studio-danger-button { font-size: 14px; font-weight: 500; } diff --git a/src/features/tech-log/presentation/styles/workflow.module.css b/src/features/tech-log/presentation/styles/workflow.module.css deleted file mode 100644 index 74e7916..0000000 --- a/src/features/tech-log/presentation/styles/workflow.module.css +++ /dev/null @@ -1,96 +0,0 @@ -:global(.studio-workflow-screen), -:global(.studio-preview-screen) { min-width: 0; } - -:global(.studio-workflow-heading), -:global(.studio-preview-toolbar) { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding-bottom: 42px; border-bottom: 1px solid var(--line-strong); } -:global(.studio-workflow-heading) h1, -:global(.studio-preview-toolbar) h1 { margin: 0; font-size: clamp(38px, 5vw, 62px); line-height: 1.06; letter-spacing: -0.045em; } -:global(.studio-workflow-heading > div > p:last-child), -:global(.studio-preview-toolbar > div > p:last-child) { max-width: 780px; margin: 16px 0 0; color: var(--muted); font-size: 17px; line-height: 1.6; overflow-wrap: anywhere; } -:global(.studio-workflow-quiet-link) { display: inline-flex; min-height: 44px; align-items: center; color: var(--signal); font-weight: 650; white-space: nowrap; } - -:global(.studio-workflow-gate) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 36px; align-items: center; margin-top: 34px; padding: 28px; border: 1px solid var(--line-strong); border-left-width: 4px; } -:global(.studio-workflow-gate--ready) { border-left-color: #166748; background: #f3faf6; } -:global(.studio-workflow-gate--blocked) { border-left-color: #9a5a1f; background: #fff9f0; } -:global(.studio-workflow-gate) h2 { margin: 0; font-size: 25px; letter-spacing: -0.03em; } -:global(.studio-workflow-gate) p:last-child { margin: 10px 0 0; color: var(--muted); line-height: 1.65; } -:global(.studio-workflow-actions) { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } -/* Studio 의 나머지와 같은 언어 — 상자 없이 글자의 굵기와 색으로만 격을 나눈다. */ -:global(.studio-workflow-actions) button, -:global(.studio-workflow-actions) a { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding-inline: 2px; border: 0; border-radius: 0; background: none; color: var(--muted); font-weight: 600; } -:global(.studio-workflow-actions) button:hover:not(:disabled), -:global(.studio-workflow-actions) a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; } -:global(.studio-workflow-actions) button:first-child { color: var(--ink); font-weight: 700; } -:global(.studio-workflow-actions) button:disabled { color: var(--faint); cursor: wait; } -:global(.studio-workflow-feedback) { margin: 18px 0 0; padding: 14px 16px; border-left: 3px solid var(--signal); background: #f5f7ff; } -:global(.studio-workflow-loading) { min-height: 240px; padding-block: 56px; color: var(--muted); } - -:global(.studio-workflow-report) { margin-top: 54px; border-top: 1px solid var(--line-strong); } -:global(.studio-workflow-section-heading) { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 26px; border-bottom: 1px solid var(--line); } -:global(.studio-workflow-section-heading) h2 { margin: 0; font-size: 28px; letter-spacing: -0.03em; } -:global(.studio-workflow-status) { display: inline-flex; min-height: 32px; align-items: center; padding-inline: 11px; border: 1px solid currentColor; border-radius: 999px; font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 700; } -:global(.studio-workflow-status--invalid) { color: #8f2f27; } -:global(.studio-workflow-status--warnings) { color: #8b5a14; } -:global(.studio-workflow-status--valid) { color: #166748; } -:global(.studio-workflow-metadata), -:global(.studio-preview-metadata) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-bottom: 1px solid var(--line); } -:global(.studio-workflow-metadata) div, -:global(.studio-preview-metadata) div { min-width: 0; padding: 20px; border-right: 1px solid var(--line); } -:global(.studio-workflow-metadata) div:last-child, -:global(.studio-preview-metadata) div:last-child { border-right: 0; } -:global(.studio-workflow-metadata) dt, -:global(.studio-preview-metadata) dt { color: var(--muted); font-size: 11px; } -:global(.studio-workflow-metadata) dd, -:global(.studio-preview-metadata) dd { margin: 7px 0 0; font-size: 13px; overflow-wrap: anywhere; } -:global(.studio-workflow-issue-list) { margin: 0; padding: 0; list-style: none; } -:global(.studio-workflow-issue-list) li { min-width: 0; border-bottom: 1px solid var(--line); } -:global(.studio-workflow-issue-list) a { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; min-width: 0; gap: 18px; align-items: start; padding-block: 22px; color: inherit; } -:global(.studio-workflow-issue-severity) { color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 11px; } -:global(.studio-workflow-issue-body) { display: grid; min-width: 0; gap: 7px; } -:global(.studio-workflow-issue-body) strong, -:global(.studio-workflow-issue-body) small { overflow-wrap: anywhere; } -:global(.studio-workflow-issue-body) small { color: var(--muted); font-family: "IBM Plex Mono", monospace; } -:global(.studio-workflow-empty-issues), -:global(.studio-workflow-empty-panel) { margin: 0; padding-block: 42px; border-bottom: 1px solid var(--line); color: var(--muted); } -:global(.studio-workflow-empty-panel) h2 { margin: 0; color: var(--ink); font-size: 25px; } -:global(.studio-workflow-empty-panel) p { margin: 10px 0 0; } - -:global(.studio-preview-toolbar--compact) { padding-bottom: 28px; } -:global(.studio-preview-title) { margin: 0; color: var(--ink); font-size: 28px; font-weight: 700; letter-spacing: -0.03em; } -:global(.studio-preview-state) { display: flex; justify-content: space-between; gap: 28px; align-items: center; margin-top: 24px; padding: 20px; border: 1px solid var(--line-strong); border-left-width: 4px; } -:global(.studio-preview-state) strong { font-family: "IBM Plex Mono", monospace; font-size: 12px; } -:global(.studio-preview-state) p { margin: 5px 0 0; color: var(--muted); } -:global(.studio-preview-state--current) { border-left-color: #166748; background: #f3faf6; } -:global(.studio-preview-state--none), -:global(.studio-preview-state--stale) { border-left-color: #9a5a1f; background: #fff9f0; } -:global(.studio-preview-state--expired) { border-left-color: #8f2f27; background: #fff7f4; } -:global(.studio-preview-metadata) { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; border-top: 1px solid var(--line); } -:global(.studio-preview-public-frame) { min-width: 0; margin-top: 38px; overflow: clip; border: 1px solid var(--line); background: var(--paper); } -:global(.studio-preview-public-frame .public-record-embedded) { width: 100%; max-width: none; margin: 0; padding: clamp(24px, 5vw, 56px); } - -@media (max-width: 1024px) { - :global(.studio-workflow-gate) { grid-template-columns: minmax(0, 1fr); } - :global(.studio-preview-state) { align-items: flex-start; flex-direction: column; } -} - -@media (max-width: 767px) { - :global(.studio-workflow-heading), - :global(.studio-preview-toolbar) { align-items: flex-start; flex-direction: column; gap: 12px; padding-bottom: 28px; } - :global(.studio-workflow-quiet-link) { white-space: normal; } - :global(.studio-workflow-gate) { margin-top: 24px; padding: 22px 18px; } - :global(.studio-workflow-actions) { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr); } - :global(.studio-workflow-metadata), - :global(.studio-preview-metadata) { grid-template-columns: minmax(0, 1fr); } - :global(.studio-workflow-metadata) div, - :global(.studio-preview-metadata) div { border-right: 0; border-bottom: 1px solid var(--line); } - :global(.studio-workflow-metadata) div:last-child, - :global(.studio-preview-metadata) div:last-child { border-bottom: 0; } - :global(.studio-workflow-issue-list) a { grid-template-columns: minmax(0, 1fr); gap: 8px; } - :global(.studio-workflow-issue-list) a > span:last-child { display: none; } - :global(.studio-preview-public-frame .public-record-embedded) { padding: 22px 16px; } -} - -/* 지난 판정은 현재 것과 같은 무게로 보이면 안 된다 — 읽는 사람이 지금 상태로 읽는다. */ -:global(.studio-workflow-status--stale) { border-color: var(--line); background: var(--paper); color: var(--muted); } -:global(.studio-workflow-stale-notice) { margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--paper); color: var(--muted); font-size: 13px; line-height: 1.6; } -:global(.studio-workflow-issue-list--stale) { opacity: 0.62; } diff --git a/tests/features/tech-log/asset-library.test.tsx b/tests/features/tech-log/asset-library.test.tsx index ff497eb..98a9541 100644 --- a/tests/features/tech-log/asset-library.test.tsx +++ b/tests/features/tech-log/asset-library.test.tsx @@ -1,10 +1,43 @@ // @vitest-environment jsdom import assert from "node:assert/strict"; -import { expect, test } from "vitest"; -import { act, render, screen, waitFor } from "@testing-library/react"; +import { afterEach, beforeEach, expect, test } from "vitest"; +import { act, render, screen, waitFor, within } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; +/* + jsdom 에는 `HTMLDialogElement.prototype.showModal` 이 없다. 이 저장소의 다른 다이얼로그 + 테스트(studio-save-navigation, studio-publication-flow)와 같은 방식으로 채운다. +*/ +const originalShowModal = HTMLDialogElement.prototype.showModal; +const originalClose = HTMLDialogElement.prototype.close; + +beforeEach(() => { + Object.defineProperty(HTMLDialogElement.prototype, "showModal", { + configurable: true, + value(this: HTMLDialogElement) { + this.setAttribute("open", ""); + }, + }); + Object.defineProperty(HTMLDialogElement.prototype, "close", { + configurable: true, + value(this: HTMLDialogElement) { + this.removeAttribute("open"); + }, + }); +}); + +afterEach(() => { + Object.defineProperty(HTMLDialogElement.prototype, "showModal", { + configurable: true, + value: originalShowModal, + }); + Object.defineProperty(HTMLDialogElement.prototype, "close", { + configurable: true, + value: originalClose, + }); +}); + import { AssetLibrary, canHardDelete, @@ -151,7 +184,11 @@ test("surfaces ASSET_IN_USE when the server rejects a delete", async () => { )} />); await user.click(await screen.findByRole("button", { name: "boundary" })); + // 삭제는 이제 확인을 한 번 거친다. 상세의 버튼이 창을 열고, 창의 버튼이 실제로 지운다. await user.click(await screen.findByRole("button", { name: "삭제" })); + await user.click( + within(await screen.findByRole("dialog")).getByRole("button", { name: "삭제" }), + ); assert.ok(await screen.findByText("사용 중인 Asset은 삭제할 수 없습니다.")); }); @@ -208,7 +245,11 @@ test("removes the asset and restores focus to the page heading, not the detached render(); await user.click(await screen.findByRole("button", { name: "boundary" })); + // 삭제는 이제 확인을 한 번 거친다. 상세의 버튼이 창을 열고, 창의 버튼이 실제로 지운다. await user.click(await screen.findByRole("button", { name: "삭제" })); + await user.click( + within(await screen.findByRole("dialog")).getByRole("button", { name: "삭제" }), + ); assert.ok(await screen.findByText("삭제했습니다.")); assert.equal(deleteCalls.length, 1); diff --git a/tests/features/tech-log/navigation-derivation.test.ts b/tests/features/tech-log/navigation-derivation.test.ts index 00198ab..9c78a4b 100644 --- a/tests/features/tech-log/navigation-derivation.test.ts +++ b/tests/features/tech-log/navigation-derivation.test.ts @@ -29,6 +29,7 @@ describe("TechLog navigation derivation", () => { ["게시 기록", "/studio/publications"], ["새 문서", "/studio/documents/new"], ["주제·프로젝트", "/studio/taxonomy"], + ["Asset", "/studio/assets"], ["릴리즈", "/studio/releases"], ]); }); diff --git a/tests/features/tech-log/route-contract.test.ts b/tests/features/tech-log/route-contract.test.ts index 9240609..5e526c3 100644 --- a/tests/features/tech-log/route-contract.test.ts +++ b/tests/features/tech-log/route-contract.test.ts @@ -166,6 +166,7 @@ describe("TechLog route boundary contract", () => { ["TECH_LOG_STUDIO_DOCUMENTS", "STUDIO", "작업본", 10], ["TECH_LOG_STUDIO_DOCUMENT_NEW", "STUDIO", "새 문서", 30], ["TECH_LOG_STUDIO_PUBLICATIONS", "STUDIO", "게시 기록", 20], + ["TECH_LOG_STUDIO_ASSETS", "STUDIO", "Asset", 45], ["TECH_LOG_STUDIO_TAXONOMY", "STUDIO", "주제·프로젝트", 40], ["TECH_LOG_STUDIO_RELEASES", "STUDIO", "릴리즈", 50], ]); @@ -230,14 +231,18 @@ describe("TechLog route boundary contract", () => { ).toThrow(); }); - it("registers the studio asset library outside primary navigation", () => { + /* + Asset 화면은 오래 내비게이션 밖에 있었다. 화면 설명은 "사용하지 않는 Asset 을 정리합니다" + 인데 거기 갈 방법이 URL 직접 입력뿐이었다 — 정리하라고 만든 화면에 정리하러 갈 길이 없었다. + */ + it("registers the studio asset library in primary navigation", () => { const route = TECH_LOG_ROUTE_REGISTRY.TECH_LOG_STUDIO_ASSETS; expect(route).toBeTruthy(); expect(route.path).toBe("/studio/assets"); expect(route.layoutGroup).toBe("STUDIO"); - expect(route.navigationLabel).toBeNull(); - expect(route.navigationOrder).toBeNull(); + expect(route.navigationLabel).toBe("Asset"); + expect(route.navigationOrder).toBe(45); }); it("atomically installs the complete TechLog route and runtime inventories", () => { diff --git a/tests/features/tech-log/studio-shell-smoke.test.tsx b/tests/features/tech-log/studio-shell-smoke.test.tsx index 2d99d9f..1d8c61d 100644 --- a/tests/features/tech-log/studio-shell-smoke.test.tsx +++ b/tests/features/tech-log/studio-shell-smoke.test.tsx @@ -96,6 +96,7 @@ describe("TechLog Studio shell", () => { ["게시 기록", "/studio/publications"], ["새 문서", "/studio/documents/new"], ["주제·프로젝트", "/studio/taxonomy"], + ["Asset", "/studio/assets"], ["릴리즈", "/studio/releases"], ["공개 사이트 보기", "/"], ]);