From 970fd441ba6d8f8f9bc42e5ce0e4c55b0c781567 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Sat, 7 Nov 2026 21:27:54 +0900 Subject: [PATCH] =?UTF-8?q?fix(803-2b):=20=EC=A0=80=EC=9E=A5=20=EC=A0=84?= =?UTF-8?q?=20=EC=83=88=20=EB=A1=9C=EC=A7=81=20=EA=B8=B0=ED=98=B8=20?= =?UTF-8?q?=EC=8B=9D=20=EC=98=81=EC=97=AD=20=EB=88=84=EB=A6=84=20=3D=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=20=C2=B7=20=ED=8E=B8=EC=A7=91=20=EC=A4=84=20?= =?UTF-8?q?=EB=84=88=EB=B9=84=20=EC=A0=84=EB=B6=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 까닭 — 수식 화면 고침 조건이 「관리자 + 로직 키」 · 신규 로직은 저장 전 키가 없어 영역 누름 처리가 아예 안 붙음(GC000211 같은 저장된 로직은 누름 됨) - M01 저장 전 새 로직도 고침 · 고친 문서는 캐시 「""」 열쇠 · 미리 셈은 임시 키 · [수식 저장] · [고침 버림]은 키가 생긴 뒤 - 페이지 [저장]으로 새 키가 생기면 고친 문서를 그 키(빈 문서)로 이어 감(이름 · 단위 = 새 로직) · 신규 로직을 다시 열면 옛 고침 걷음 - M02 저장 전 새 SK = 자리 표시(저장하면 M01 사본) — 읽기만 그대로 - 편집 중 줄 = 그 줄 너비 전부(빈 줄 입력 칸이 2em 으로 줄던 것 · 「a =」 「3」 꺾임 고침) - 서버 · 계산기 · 문서 꼴 그대로 · 새 라이브러리 없음 Co-Authored-By: Claude Opus 5.5 --- A00_Common/formula_doc.css | 7 +++++++ A00_Common/formula_doc_screen.ts | 21 ++++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/A00_Common/formula_doc.css b/A00_Common/formula_doc.css index a2c3a59ec..bf1c7fe75 100644 --- a/A00_Common/formula_doc.css +++ b/A00_Common/formula_doc.css @@ -346,6 +346,13 @@ cursor: text; } +/* 편집 중 줄 = 그 줄 너비 전부(빈 줄도 입력 칸이 보임 · 줄은 넘칠 때만 꺾임) */ +.fdoc__edit.fdoc-math, +.fdoc__edit.fdoc-math > .fdoc-math__view, +.fdoc__edit.fdoc-math > .fdoc-math__view > .fdoc-math__row { + flex: 1 1 auto; +} + .fdoc-math__view, .fdoc-math__row { display: inline-flex; diff --git a/A00_Common/formula_doc_screen.ts b/A00_Common/formula_doc_screen.ts index 35f67cb4d..1b398e9b3 100644 --- a/A00_Common/formula_doc_screen.ts +++ b/A00_Common/formula_doc_screen.ts @@ -195,7 +195,7 @@ export function createDocScreen(opt: DocScreenOptions) { const mine = ++seq; void call<{ 셈: DocAnswer; 연결: DocRecord; 부름?: Docs }>( "/preview", - cp ? { 문서: doc, 끊음: cut } : { 문서: doc, 입력: usable() }, + cp ? { 문서: doc, 끊음: cut } : { 문서: key ? doc : { ...doc, 키: "_새" }, 입력: usable() }, ctl.signal, ) .then((got) => { @@ -390,7 +390,9 @@ export function createDocScreen(opt: DocScreenOptions) { [head, grid, side, foot].forEach((x) => x.replaceChildren()); return; } - const edit = opt.admin && !!key; + // M01 저장 전 새 로직(키 없음)도 고침 — [수식 저장] · [고침 버림]은 키가 생긴 뒤(페이지 [저장] → 새 키로 이어 감) + // M02 저장 전 새 SK = 자리 표시(저장하면 M01 사본) — 읽기만 + const edit = opt.admin && (!!key || !cp); const vals = answer.값 ?? {}; const vars = new Map((doc.변수 ?? []).map((v) => [varId(v), v])); const lineSet = new Set((doc.식 ?? []).map((l) => String(l.기호 ?? "")).filter(Boolean)); @@ -403,7 +405,7 @@ export function createDocScreen(opt: DocScreenOptions) { const options = optionBar(); head.replaceChildren( ...(options.length ? [el("div", { className: "fdoc__options", children: options })] : []), - toolRow(edit), + toolRow(edit && !!key), ); const { cells, order } = buildLines({ admin: edit, @@ -597,6 +599,7 @@ export function createDocScreen(opt: DocScreenOptions) { const open = async (next: string): Promise => { if (next === key && doc) return; rows.reset(); + const was = key; key = next; doc = answer = null; given = {}; @@ -608,9 +611,10 @@ export function createDocScreen(opt: DocScreenOptions) { [cut, calls, mark, savedCut, version] = [{}, {}, undefined, "{}", ""]; draw(); if (!next) { - // 저장 전 새 로직 — 세 영역 빈 화면(저장하면 고칠 수 있음) + // 저장 전 새 로직 — 세 영역 빈 화면(누르면 입력 · 고친 것은 캐시 "" 열쇠) doc = blankDoc(); saved = JSON.stringify(doc); + keep(); // 옛 새 로직 고침(「""」 열쇠) 걷음 recalc(); return draw(); } @@ -619,7 +623,14 @@ export function createDocScreen(opt: DocScreenOptions) { const got = await call(cp ? "" : `?key=${encodeURIComponent(next)}`); if (mine !== seq || key !== next) return; take(got); - const draft = drafts()[next]; + const all = drafts(); + // 저장 전 새 로직에서 고친 문서 — 페이지 [저장]으로 생긴 새 키(빈 문서)로 이어 감 + if (!was && got.새 && all[""] && !all[next]) { + all[next] = { ...all[""], 키: next, 이름: got.문서.이름, 결과단위: got.문서.결과단위 }; + delete all[""]; + sessionStorage.setItem(opt.cache, JSON.stringify(all)); + } + const draft = all[next]; if (draft) doc = clone(draft); const kept = cp ? (drafts()[`${next}#끊음`] as unknown as Docs | undefined) : undefined; if (kept) cache.merge({ 문서: (cut = clone(kept)) });