fix(803-2b): 저장 전 새 로직 기호 식 영역 누름 = 입력 · 편집 줄 너비 전부

- 까닭 — 수식 화면 고침 조건이 「관리자 + 로직 키」 · 신규 로직은 저장 전 키가 없어 영역 누름 처리가 아예 안 붙음(GC000211 같은 저장된 로직은 누름 됨)
- M01 저장 전 새 로직도 고침 · 고친 문서는 캐시 「""」 열쇠 · 미리 셈은 임시 키 · [수식 저장] · [고침 버림]은 키가 생긴 뒤
- 페이지 [저장]으로 새 키가 생기면 고친 문서를 그 키(빈 문서)로 이어 감(이름 · 단위 = 새 로직) · 신규 로직을 다시 열면 옛 고침 걷음
- M02 저장 전 새 SK = 자리 표시(저장하면 M01 사본) — 읽기만 그대로
- 편집 중 줄 = 그 줄 너비 전부(빈 줄 입력 칸이 2em 으로 줄던 것 · 「a =」 「3」 꺾임 고침)
- 서버 · 계산기 · 문서 꼴 그대로 · 새 라이브러리 없음

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-07 21:27:54 +09:00
co-authored by Claude Opus 5.5
parent dcae2eb705
commit 970fd441ba
2 changed files with 23 additions and 5 deletions
+7
View File
@@ -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;
+16 -5
View File
@@ -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<void> => {
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<Loaded>(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)) });