[feat/MAT-358] undo/redo command 패턴 HistoryManager#300
Open
b0nsu wants to merge 1 commit intorefactor/mat-355-renderingfrom
Open
[feat/MAT-358] undo/redo command 패턴 HistoryManager#300b0nsu wants to merge 1 commit intorefactor/mat-355-renderingfrom
b0nsu wants to merge 1 commit intorefactor/mat-355-renderingfrom
Conversation
- engine/HistoryManager.ts: command 패턴 (AppendStroke, EraseStrokes, ReplaceDocument) - append-stroke undo O(1): slice로 마지막 stroke 제거 (deepCopy + path rebuild 제거) - erase transaction: beginTransaction/commitTransaction - lock/unlock: 텍스트 편집 중 canvas undo 차단 - cachedPathsBefore 구조 준비 (renderer 연동 후 적용) - model/drawingTypes.ts: DocumentSnapshot 타입 추가 - DrawingCanvas.tsx: 기존 historyRef/historyIndexRef/saveToHistory/restoreFromHistory 제거 → HistoryManager + createSnapshot/applySnapshot으로 교체 (-225줄, +129줄) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
배열 기반 히스토리를 command pattern HistoryManager로 교체합니다.
DocumentSnapshot + StrokeBounds로 undo 시 O(1) 복원, 이후 eraser 최적화 기반을 마련합니다.
Linear
Changes
engine/HistoryManager.ts생성 — command pattern (AppendStroke, EraseStrokes, ReplaceDocument)Testing
pnpm typecheck통과pnpm lint통과Risk / Impact