fix: 요약이 문장 중간에서 멈추지 않게 하고 남은 자리를 보여 준다

요약 칸이 300자에서 말없이 입력을 멈췄다. 아무 표시가 없어 키보드가
고장 난 것처럼 보인다.

계약 상한을 600 으로 올리고(입력·공개 렌더 모델 함께) 칸 아래에
`412 / 600` 을 둔다. 한계에 닿으면 붉게 바뀐다.

글자 수는 label 밖에 둔다. 안에 두면 label 의 글자가 모두 칸의 이름이
되어 이름이 "요약 412 / 600" 으로 타자마다 바뀐다 — 기존 테스트 둘이
실제로 그것을 잡아냈다. 읽어 주는 것은 한계에 닿는 순간뿐이다. 글자마다
세어 읽으면 받아쓰기가 된다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011nAjrqNHGPNngN4aUbcyvJ
This commit is contained in:
DongHyeonka
2026-08-29 22:07:54 +09:00
co-authored by Claude Opus 5
parent df371d38bd
commit 8fce8ea69c
8 changed files with 61 additions and 13 deletions
@@ -5,6 +5,12 @@ import { RelationEditor } from "./relation-editor.tsx";
type CatalogEntry = components["schemas"]["CatalogEntry"];
/**
* 요약이 들어갈 수 있는 최대 길이. 계약 `WorkingCopyInputBase.summary` 와 같은 값이어야 한다 —
* 여기가 더 크면 다 쓰고 나서 저장할 때 거절당하고, 더 작으면 쓸 수 있는 자리를 못 쓴다.
*/
const SUMMARY_MAX = 600;
/** 이 화면이 자기 칸 아래에 보여 줄 수 있는 경로. 나머지는 게시 버튼 옆에 남는다. */
export const COMMON_FIELD_PATHS = [
"/title",
@@ -37,10 +43,22 @@ export function CommonDocumentFields({
<div className="studio-field-grid">
<label className="studio-field studio-field--wide"><span>제목</span><input value={draft.title} maxLength={120} onChange={(event) => onUpdate({ title: event.currentTarget.value })} /><FieldNotice issues={issues} path="/title" /></label>
<label className="studio-field"><span>slug</span><input value={draft.slug} maxLength={100} placeholder="비우면 제목에서 만듭니다 (영문 소문자·숫자·하이픈)" onChange={(event) => onUpdate({ slug: event.currentTarget.value as WorkingCopyInput["slug"] })} /><FieldNotice issues={issues} path="/slug" /></label>
<label className="studio-field studio-field--wide"><span>요약</span><textarea value={draft.summary} maxLength={300} onChange={(event) => onUpdate({ summary: event.currentTarget.value })} /><FieldNotice issues={issues} path="/summary" /></label>
{/*
요약만 label 로 감싸지 않고 htmlFor 로 잇는다. 감싸면 label 안의 글자가 모두 칸의
이름이 되어 "요약 412 / 600" 처럼 타자마다 이름이 바뀐다 — 이름은 「요약」로 두고
남은 자리는 그 옆에 따로 보여 준다.
*/}
<div className="studio-field studio-field--wide"><label htmlFor="studio-field-summary">요약</label><textarea id="studio-field-summary" value={draft.summary} maxLength={SUMMARY_MAX} onChange={(event) => onUpdate({ summary: event.currentTarget.value })} /><span className="studio-char-count" aria-hidden="true" data-full={draft.summary.length >= SUMMARY_MAX ? "" : undefined}>{draft.summary.length} / {SUMMARY_MAX}</span><FieldNotice issues={issues} path="/summary" /></div>
<label className="studio-field"><span>Topic</span><select value={draft.topicId ?? ""} onChange={(event) => onUpdate({ topicId: event.currentTarget.value || null })}><option value="">선택하지 않음</option>{topics.map((entry) => <option key={entry.id} value={entry.id}>{entry.label}</option>)}</select><FieldNotice issues={issues} path="/topicId" /></label>
<label className="studio-field"><span>Project</span><select value={draft.projectId ?? ""} onChange={(event) => onUpdate({ projectId: event.currentTarget.value || null })}><option value="">미지정</option>{projects.map((entry) => <option key={entry.id} value={entry.id}>{entry.label}</option>)}</select><FieldNotice issues={issues} path="/projectId" /></label>
</div>
{/*
보조 기술에는 글자마다 세어 읽어 줄 수 없다 — 받아쓰기가 된다. 한계에 닿는 순간만 알린다.
label 밖에 두는 이유는 안에 두면 요약 칸의 이름이 이 문장까지 포함하게 되기 때문이다.
*/}
<p role="status" className="studio-visually-hidden">
{draft.summary.length >= SUMMARY_MAX ? `요약을 ${SUMMARY_MAX}자까지 모두 썼습니다. 더 입력되지 않습니다.` : ""}
</p>
<RelationEditor evidence={draft.kind === "PROJECT_DECISION"} relations={draft.relations} catalog={relations} onChange={(next) => onUpdate({ relations: next })} />
<FieldNotice issues={issues} path="/relations" />
</section>