plan 이동 시 undo redo stack 제거

This commit is contained in:
hyojun.choi 2026-05-07 14:18:34 +09:00
parent 80720fef2a
commit edf521e617

View File

@ -31,6 +31,7 @@ import { useCanvasMenu } from './common/useCanvasMenu'
import { QcastContext } from '@/app/QcastProvider' import { QcastContext } from '@/app/QcastProvider'
import { unescapeString } from '@/util/common-utils' import { unescapeString } from '@/util/common-utils'
import { useTrestle } from '@/hooks/module/useTrestle' import { useTrestle } from '@/hooks/module/useTrestle'
import { useUndoRedo } from '@/hooks/useUndoRedo'
// putCanvasStatus 의 in-flight 요청 — module-scope 로 두어 usePlan() 인스턴스 간 공유. // putCanvasStatus 의 in-flight 요청 — module-scope 로 두어 usePlan() 인스턴스 간 공유.
// 큰 fabric JSON 의 동시 PUT 이 SQL Server 데드락 victim 을 양산해 온 이력 때문에 직전 호출은 abort. // 큰 fabric JSON 의 동시 PUT 이 SQL Server 데드락 victim 을 양산해 온 이력 때문에 직전 호출은 abort.
@ -84,6 +85,8 @@ export function usePlan(params = {}) {
//선택된 모듈 배치면 초기화 //선택된 모듈 배치면 초기화
const resetModuleSetupSurface = useResetRecoilState(moduleSetupSurfaceState) const resetModuleSetupSurface = useResetRecoilState(moduleSetupSurfaceState)
const { isAllComplete } = useTrestle() const { isAllComplete } = useTrestle()
// undo/redo 스택 초기화 (플랜 전환 시 사용)
const { clearStacks } = useUndoRedo()
/** /**
* 마우스 포인터의 가이드라인 제거 * 마우스 포인터의 가이드라인 제거
@ -477,6 +480,8 @@ export function usePlan(params = {}) {
handleCurrentPlanUrl() handleCurrentPlanUrl()
// resetCurrentObject() // resetCurrentObject()
resetModuleSetupSurface() resetModuleSetupSurface()
// 플랜 전환 시 이전 플랜의 undo/redo 히스토리는 의미가 없으므로 초기화한다.
clearStacks()
}, [currentCanvasPlan]) }, [currentCanvasPlan])
/** /**