fix(468 값 안 변함 ③): 되돌리기 빈 칸 · 접힘 파생값 · 배지 소수 한 자리

- 사진첩: 「{}」 · 「null」 · 「""」 = 칸 없음 — 빈 맵 쓰기가 걸음이 되어 ↷ 를 버리던 흠(R4) · 「[]」(관 · 구조물 모두 지움)은 값으로 둠
- 세션 맵 · 연동 플래그: 빈 맵 persist = 칸 지움(갈아끼움 이동이 「{}」 여섯 칸을 만들지 않음)
- 종단도: 본문 0 크기(판 접힘)에도 낡음 예약 · 유토 총괄값 · 배분 선반입 · 측점 자료를 셈 · 그리기만 건너뜀 — 떼어 낸 유토 판은 그림
- 배지: 소수 한 자리 고정(−17,570.0㎥)
- 시험: test_272_history_empty_cells · test_272_hidden_summary(옛 코드 7 실패)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 07:21:14 +09:00
co-authored by Claude Opus 5.5
parent 039b5a3f3b
commit 0ffabd6fbf
9 changed files with 643 additions and 65 deletions
@@ -35,7 +35,7 @@ export interface SessionMap<V> {
values: Map<string, V>;
/** 세션값 읽기 — 맵을 비우고 다시 채운다. */
load: () => void;
/** 맵을 통째로 세션에 쓴다. */
/** 맵을 통째로 세션에 쓴다 — 빈 맵이면 칸을 지운다. */
persist: () => void;
}
@@ -98,7 +98,8 @@ export function createSessionMap<V>(
const key = sessionKey();
if (!key) return;
try {
writeByKey(key, JSON.stringify(Object.fromEntries(values)));
// 빈 맵 = 칸 지움(272) — 「{}」 를 남기면 사진첩이 걸음으로 봄
writeByKey(key, values.size ? JSON.stringify(Object.fromEntries(values)) : null);
} catch {
/* 세션 저장 실패는 무시(용량 초과 등) — 값은 메모리에 유지된다. */
}
@@ -144,10 +145,12 @@ export function createLinkFlagSession(sessionKey: () => string | null): LinkFlag
if (!key) return;
writeByKey(
key,
JSON.stringify({
detached: Object.fromEntries(detached),
grade: Object.fromEntries(followGrade),
}),
detached.size || followGrade.size
? JSON.stringify({
detached: Object.fromEntries(detached),
grade: Object.fromEntries(followGrade),
})
: null, // 둘 다 비면 칸 지움(272)
);
},
};