Skip to content

Task #158: 표 크기 조절 Undo/Redo — SnapshotCommand 적용#748

Closed
oksure wants to merge 2 commits into
edwardkim:develfrom
oksure:contrib/table-resize-undo
Closed

Task #158: 표 크기 조절 Undo/Redo — SnapshotCommand 적용#748
oksure wants to merge 2 commits into
edwardkim:develfrom
oksure:contrib/table-resize-undo

Conversation

@oksure

@oksure oksure commented May 9, 2026

Copy link
Copy Markdown
Contributor

문제

표 크기 조절(마우스 드래그, 키보드, Ctrl+방향키 비율 리사이즈) 후 Ctrl+Z로 되돌릴 수 없습니다. resizeTableCells WASM API가 Undo 이력 없이 직접 호출되어 변경 내역이 기록되지 않습니다.

수정 내용

세 가지 크기 조절 경로 모두 executeOperation({ kind: 'snapshot' }) 경유로 변경:

  1. 마우스 드래그 리사이즈 (finishResizeDrag): operationType: 'resizeTable'
  2. 키보드 셀 리사이즈 (resizeCellByKeyboard): operationType: 'resizeCell'
  3. Ctrl+방향키 비율 리사이즈 (resizeTableProportional): operationType: 'resizeTableProportional'

기존 SnapshotCommand 인프라를 그대로 활용하여 before/after 문서 스냅샷을 자동 관리합니다.

검증

  • TypeScript 타입 체크 통과
  • cargo test — 전체 통과

Closes #158

감사합니다.

표 크기 조절(마우스 드래그, 키보드, Ctrl+방향키 비율 리사이즈)이
Undo 이력에 등록되지 않던 문제 수정.

resizeTableCells 직접 호출을 executeOperation + SnapshotCommand
경유로 변경하여 Ctrl+Z/Ctrl+Y로 크기 변경 복원 가능.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 9, 2026 14:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

표 크기 조절(드래그/키보드/Ctrl+방향키) 동작이 Undo/Redo 히스토리에 기록되지 않던 문제(#158)를 해결하기 위해, resizeTableCells 직접 호출 경로를 executeOperation({ kind: 'snapshot' }) 기반으로 전환한 PR입니다.

Changes:

  • 드래그 리사이즈(finishResizeDrag)를 SnapshotCommand 경유로 실행하도록 변경
  • 키보드 셀 리사이즈(resizeCellByKeyboard)를 SnapshotCommand 경유로 실행하도록 변경
  • Ctrl+방향키 비율 리사이즈(resizeTableProportional)를 SnapshotCommand 경유로 실행하도록 변경

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 191 to 201
this.executeOperation({
kind: 'snapshot', operationType: 'resizeTable',
operation: (wasm: any) => {
wasm.resizeTableCells(sec, ppi, ci, updates);
return pos;
},
});
this.eventBus.emit('document-changed');
if (inCellSel) this.updateCellSelection();

this.cleanupResizeDrag();
return pos;
},
});
this.eventBus.emit('document-changed');
Comment on lines +497 to +503
this.executeOperation({
kind: 'snapshot', operationType: 'resizeCell',
operation: (wasm: any) => {
wasm.resizeTableCells(ctx.sec, ctx.ppi, ctx.ci, updates);
return pos;
},
});
return pos;
},
});
this.eventBus.emit('document-changed');
return pos;
},
});
this.eventBus.emit('document-changed');
executeOperation(snapshot)이 내부적으로 afterEdit()을 호출하여
document-changed를 이미 emit하므로 외부의 중복 emit 3건 제거.
finishResizeDrag, resizeCellByKeyboard에 try/catch 추가하여
예외 발생 시에도 cleanup이 실행되도록 보장.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@oksure

oksure commented May 9, 2026

Copy link
Copy Markdown
Contributor Author

Copilot 리뷰 반영 (a15336d):

  • executeOperation(snapshot) 내부의 afterEdit()이 이미 document-changed를 emit하므로 3건의 중복 emit 제거
  • finishResizeDrag, resizeCellByKeyboard에 try/catch 추가하여 예외 시에도 cleanup 보장

edwardkim added a commit that referenced this pull request May 10, 2026
PR #728 (closes #204) 의 표 편집 11 커맨드 + 표 크기 조절 3 함수 SnapshotCommand 일괄 적용
머지로 본질적 정정이 이미 devel 에 반영되어 있어 cherry-pick 결과 empty commit (allow-empty).
컨트리뷰터 (@oksure) 의 commit 이력 보존 + author 정보 보존.

검증:
- tsc --noEmit ✅
- cargo test --release ALL GREEN
- 광범위 sweep 170/170 same
- WASM 4.66 MB
- 웹 에디터 인터랙션 검증 ✅ 통과 (3가지 크기 조절 경로 + Ctrl+Z)

closes #158
@edwardkim

Copy link
Copy Markdown
Owner

@oksure 검토 완료했습니다. 감사합니다.

처리 결과

Merge commit: 5ce0bcc9 (devel)

본질

PR #748 의 정정 본질이 PR #728 (closes #204) 머지 영역에 이미 흡수된 상태였습니다. PR #728 이 표 편집 11 커맨드 + 표 크기 조절 3 함수 (finishResizeDrag, resizeCellByKeyboard, resizeTableProportional) 까지 모두 SnapshotCommand 패턴을 적용했고, PR #748 의 의도와 동일하게 try/catch + afterEdit 자동 emit 까지 정합되어 있었습니다.

처리 방식

검증

  • TypeScript / cargo test ALL GREEN
  • 광범위 sweep 170/170 same
  • WASM 4.66 MB
  • 웹 에디터 인터랙션 검증 통과 (3가지 크기 조절 경로 + Ctrl+Z)

Issue #158 함께 close 합니다.

5/10 사이클 16번째 PR — 수고하셨습니다.

@edwardkim

Copy link
Copy Markdown
Owner

Merged via cherry-pick + empty commit (PR #728 supersede). Merge commit: 5ce0bcc

@edwardkim edwardkim closed this May 10, 2026
edwardkim added a commit that referenced this pull request May 10, 2026
PR #748 (closes #158) 처리 보고서 + 검토 문서 archives 이동 + 5/10 orders 16번째 PR 행 추가.
PR #728 supersede 흡수 — 옵션 (b) cherry-pick + empty commit 으로 author 보존.

Merge commit: 5ce0bcc
Cherry-pick (empty): 312fc4c + d20a6a4
edwardkim added a commit that referenced this pull request May 10, 2026
5/10 + 5/11 사이클 누적 — 외부 기여자 다수 PR 30+ 머지.

Cargo.toml + rhwp-vscode/package.json + npm/editor/package.json + rhwp-studio/package.json: 0.7.10 → 0.7.11
rhwp-vscode/CHANGELOG.md: [0.7.11] 항목 추가

핵심 변경:
- Skia native raster P8 (#761) + P9 (#769) — Layer IR contract hardening + text replay parity
- HWP3 native 렌더링 (#753) — hwp3-sample10 8 단계 정정 + Git LFS pdf-large/ 신규
- 페이지네이션 정정 (#778) — Task #703 다단 컬럼 분배 회귀 정정
- rhwp-studio 인터랙션 (PR #781/#786/#787/#788) — scrollbar/수식/표 셀/도구 모음 결함 정정
- rhwp-studio editor 신규 기능 (PR #728/#748/#750/#760 등) — 표 편집 Undo/Redo + 다단 설정 + 다수 단축키
@edwardkim edwardkim mentioned this pull request May 10, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants