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 }>) {