perf(history): batch transform drag undo

This commit is contained in:
syntaxbullet
2026-07-04 15:49:13 +02:00
parent a030f2065a
commit 1acfcbe4a5
5 changed files with 159 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ import { commandIds } from "./ids";
export const historyUndoCommand: Command = {
id: commandIds.historyUndo,
name: "Undo",
history: { mode: "ignore" },
execute({ state }) {
const previous = state.history.past.at(-1);
if (!previous) return state;
@@ -23,6 +24,7 @@ export const historyUndoCommand: Command = {
export const historyRedoCommand: Command = {
id: commandIds.historyRedo,
name: "Redo",
history: { mode: "ignore" },
execute({ state }) {
const next = state.history.future[0];
if (!next) return state;