From 7093d84ab5840ce5c87a75479240d063564382c4 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Fri, 21 Aug 2026 15:35:23 +0900 Subject: [PATCH] fix: give a document a slug, and say so when saving fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Validation reported a slug the author could see on screen as missing. Both halves of that were the editor's fault. The document slug must match `^[a-z0-9]+(?:-[a-z0-9]+)*$`, which the editor never said and never helped with. A Korean slug was rejected by the server with a 422 carrying no details — and the editor answered that only through `setRequestAnnouncement`, which is an aria-live region and shows a sighted author nothing at all. The value stayed in the field, so it looked saved. Then validation, which reads the saved version by design, correctly reported no slug, and the author read that as the tool contradicting itself. An empty slug is now derived from the title, romanizing Hangul the same way topic slugs do, so a Korean title produces a valid slug and the author never has to learn the rule. A slug that cannot work is refused before the request, naming the rule instead of letting the server answer with an unexplained 422. Every save failure now renders where the author is looking, not only where a screen reader would hear it. The rail shows one message rather than two: a conflict already says what to do, so it outranks the server's wording, and everything else shows the server's reason. --- .../components/common-document-fields.tsx | 2 +- .../components/document-editor-controller.ts | 6 +++ .../components/document-editor-screen.tsx | 37 +++++++++++++++---- .../components/document-status-rail.tsx | 13 ++++++- 4 files changed, 49 insertions(+), 9 deletions(-) diff --git a/src/features/tech-log/presentation/studio/components/common-document-fields.tsx b/src/features/tech-log/presentation/studio/components/common-document-fields.tsx index 1474e88..a0ff732 100644 --- a/src/features/tech-log/presentation/studio/components/common-document-fields.tsx +++ b/src/features/tech-log/presentation/studio/components/common-document-fields.tsx @@ -22,7 +22,7 @@ export function CommonDocumentFields({

DOCUMENT

기본 정보

- +