From edf521e617bcd81386b78b411096a4dc14b14abf Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 7 May 2026 14:18:34 +0900 Subject: [PATCH] =?UTF-8?q?plan=20=EC=9D=B4=EB=8F=99=20=EC=8B=9C=20undo=20?= =?UTF-8?q?redo=20stack=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePlan.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index 150be261..77f5b9b7 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -31,6 +31,7 @@ import { useCanvasMenu } from './common/useCanvasMenu' import { QcastContext } from '@/app/QcastProvider' import { unescapeString } from '@/util/common-utils' import { useTrestle } from '@/hooks/module/useTrestle' +import { useUndoRedo } from '@/hooks/useUndoRedo' // putCanvasStatus 의 in-flight 요청 — module-scope 로 두어 usePlan() 인스턴스 간 공유. // 큰 fabric JSON 의 동시 PUT 이 SQL Server 데드락 victim 을 양산해 온 이력 때문에 직전 호출은 abort. @@ -84,6 +85,8 @@ export function usePlan(params = {}) { //선택된 모듈 배치면 초기화 const resetModuleSetupSurface = useResetRecoilState(moduleSetupSurfaceState) const { isAllComplete } = useTrestle() + // undo/redo 스택 초기화 (플랜 전환 시 사용) + const { clearStacks } = useUndoRedo() /** * 마우스 포인터의 가이드라인 제거 @@ -477,6 +480,8 @@ export function usePlan(params = {}) { handleCurrentPlanUrl() // resetCurrentObject() resetModuleSetupSurface() + // 플랜 전환 시 이전 플랜의 undo/redo 히스토리는 의미가 없으므로 초기화한다. + clearStacks() }, [currentCanvasPlan]) /**