fix(m02): 셀 밀기 · 당기기에 이름 따라감 · 카드 도면 저장도 표 없는 연결표 줄 뺌(114-2)
- 칸 삽입 · 삭제 창(밀기 · 당기기) — 띠 안에 통째로 든 이름정의 범위를 같이 옮김 · 되돌리기 한 걸음 - 연결표 맞춤 몸을 fitLinks 로 떼어 도면 상세 · 카드 도면 저장이 같이 씀 - 시험 — 밀기 여섯 갈래 · 카드 저장 줄 빼기 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgChuAcyBqUkhHMTXomQC7
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
- 114-1 면적 상세를 열 때 화면(`sentRanges` + 책)이 `도면_{연결}` 이름정의를 둠 → 행 넣기 → 면적 [저장]
|
||||
→ 서버 `refresh_drawing` 이 그 이름을 연결표 줄에 적고 도면 표 칸 글 = 옮겨진 칸.
|
||||
- 114-2 셀 밀기 · 당기기(칸 삽입 · 삭제 창)에 이름 따라감 · 카드 도면 저장도 표 없는 연결표 줄 뺌(`fitLinks`).
|
||||
TS 는 Node 로(`AreaToDrawing` 은 그 자리 변환 · 스프레드시트 모듈은 `helper_spreadsheet_d_bundle.cjs`).
|
||||
"""
|
||||
|
||||
@@ -66,7 +67,36 @@ const { applyCommand } = ss("spreadsheet_commands");
|
||||
names: book.시트[0].이름정의,
|
||||
};
|
||||
applyCommand(book, { 종류: "행넣기", 시트: "s1", at: 0, 수: 1 }); // 1행 위에 한 행
|
||||
console.log(JSON.stringify({ opened, book }));
|
||||
// 114-2 — 셀 밀기 · 당기기(칸 삽입 · 삭제 창)에 이름 따라감 · 되돌리기 한 걸음
|
||||
const dlg = ss("spreadsheet_insert_dialog");
|
||||
const E7J17 = { r0: 6, c0: 4, r1: 16, c1: 9 };
|
||||
const shift = (fn, range) => {
|
||||
const b = { 종류: "통합문서", 판: 1, 열: "t", 서식: [{}], 시트: [
|
||||
{ id: "s1", 이름: "s1", 칸: { E7: { 값: 1 } }, 이름정의: [{ 이름: "도면_T1", 범위: E7J17 }] },
|
||||
] };
|
||||
const sent = [];
|
||||
const ctx = { book: b, readOnly: false, selection: { 시트: "s1" }, sheet: () => b.시트[0],
|
||||
dispatch: (c) => (sent.push(c.종류 === "묶음" ? c.명령.map((x) => x.종류).join("+") : c.종류), applyCommand(b, c)) };
|
||||
dlg[fn](ctx, range);
|
||||
const n = b.시트[0].이름정의.map((x) => x.범위);
|
||||
return { names: n, sent, cell: Object.keys(b.시트[0].칸) };
|
||||
};
|
||||
const shifted = {
|
||||
downInside: shift("insertShiftDown", { r0: 9, c0: 4, r1: 9, c1: 9 }),
|
||||
downAbove: shift("insertShiftDown", { r0: 4, c0: 4, r1: 4, c1: 9 }),
|
||||
downPartial: shift("insertShiftDown", { r0: 4, c0: 4, r1: 4, c1: 5 }),
|
||||
upAll: shift("deleteShiftUp", E7J17),
|
||||
right: shift("insertShiftRight", { r0: 6, c0: 3, r1: 16, c1: 3 }),
|
||||
left: shift("deleteShiftLeft", { r0: 6, c0: 0, r1: 16, c1: 1 }),
|
||||
};
|
||||
// 114-2 — 카드 도면 저장도 표 없는 연결표 줄을 뺌(도면 상세 저장과 같은 몸)
|
||||
const tbl = (id) => ({ type: "Table", shapeData: { cells: [[{ text: "x" }]], style: { 연결: id } } });
|
||||
const row = (id) => ({ 연결: id, 시트: "s1", 범위: "A1", 값: {} });
|
||||
const fit = {
|
||||
kept: toDrawing.fitLinks({ 도면: { entities: [tbl("T1")] }, 연결표: [row("T1"), row("T2")] }).연결표,
|
||||
plain: "연결표" in toDrawing.fitLinks({ 도면: { entities: [tbl("T9")] } }),
|
||||
};
|
||||
console.log(JSON.stringify({ opened, book, shifted, fit }));
|
||||
})().catch((e) => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
@@ -134,3 +164,27 @@ def test_옛_연결_열기_행_넣기_저장_도면_표_값_따라감_114_1(worl
|
||||
cells = doc["도면"]["entities"][0]["shapeData"]["cells"]
|
||||
assert _texts(cells) == _texts(want["표"]["shapeData"]["cells"]) # 옮겨진 칸 = 보낸 그 칸
|
||||
assert _texts(cells)[0] == ["제목", "1,234.50"]
|
||||
|
||||
|
||||
def test_셀_밀기_당기기에_이름_따라감_띠에_걸치기만_하면_그대로_114_2(world): # noqa: F811
|
||||
with store.at(world["system"]):
|
||||
area = store.read("area", "rv")
|
||||
s = _node({"book": area["문서"], "drawing": {"연결표": []}})["shifted"]
|
||||
box = lambda r0, c0, r1, c1: [{"r0": r0, "c0": c0, "r1": r1, "c1": c1}] # noqa: E731
|
||||
assert s["downInside"]["names"] == box(6, 4, 17, 9) # 범위 안에 밀어 넣음 = 늘어남 E7:J18
|
||||
assert s["downAbove"]["names"] == box(7, 4, 17, 9) # 위에서 밀림 = 통째로 E8:J18
|
||||
assert s["downPartial"]["names"] == box(6, 4, 16, 9) # 띠(E:F)에 걸치기만 = 그대로
|
||||
assert s["upAll"]["names"] == [] # 다 지운 자리 = 이름 빠짐(저장 때 연결 끊김)
|
||||
assert s["right"]["names"] == box(6, 5, 16, 10) # F7:K17
|
||||
assert s["left"]["names"] == box(6, 2, 16, 7) # C7:H17
|
||||
assert s["downInside"]["sent"] == ["시트통째+칸"] # 한 묶음 = 되돌리기 한 걸음
|
||||
assert s["downPartial"]["sent"] == ["칸"] # 안 바뀌면 시트통째 안 끼움
|
||||
assert s["downAbove"]["cell"] == ["E8"] # 값도 함께 밀림
|
||||
|
||||
|
||||
def test_카드_도면_저장도_표_없는_연결표_줄_뺌_114_2(world): # noqa: F811
|
||||
with store.at(world["system"]):
|
||||
area = store.read("area", "rv")
|
||||
fit = _node({"book": area["문서"], "drawing": {"연결표": []}})["fit"]
|
||||
assert fit["kept"] == [{"연결": "T1", "시트": "s1", "범위": "A1", "값": {}, "장": ""}]
|
||||
assert fit["plain"] is False # 기록 없던 도면은 칸을 안 만듦
|
||||
|
||||
@@ -40,9 +40,9 @@ def test_메뉴는_숨기고_저장은_문서_전체():
|
||||
assert part in card.split("const HIDE_EDIT")[1].split(";\n")[0]
|
||||
# 도번 · 열 · 판 은 읽은 그대로 · 모든 장(지금 탭 하나가 1장을 덮던 흠 · 105-3)
|
||||
assert (
|
||||
'const next = { ...doc, ...((await handle.getDoc()) as Pick<StructureDoc, "도면" | "더한장">) };'
|
||||
'const next = fitLinks({\n ...doc,\n ...((await handle.getDoc()) as Pick<StructureDoc, "도면" | "더한장">),\n });'
|
||||
in card
|
||||
)
|
||||
) # 지운 표의 연결표 줄은 뺌(114-2 · 도면 상세 저장과 같은 몸)
|
||||
assert "async function doSave(): Promise<void>" in card
|
||||
assert 'write("structure", opt.column, version, next)' in card
|
||||
for key in ("L · PL", "E · Delete", "Ctrl+Z · Ctrl+Y", "Ctrl+S"):
|
||||
|
||||
Reference in New Issue
Block a user