feat: persistent multi-step undo system in TopBar

This commit is contained in:
Christian Vidal Wolf
2026-04-08 20:11:00 +02:00
parent 72e653e353
commit 968547c8c7
2 changed files with 28 additions and 18 deletions
+8 -3
View File
@@ -275,8 +275,8 @@ export default function App() {
data: JSON.parse(JSON.stringify(appState.data)), // Deep copy
message
};
// Keep only last 5 steps
const newHistory = [newState, ...prev].slice(0, 5);
// Keep last 50 steps
const newHistory = [newState, ...prev].slice(0, 50);
return newHistory;
});
};
@@ -412,7 +412,12 @@ export default function App() {
<UndoToast
undoState={undoHistory[0] || null}
onUndo={handleUndo}
onClose={() => setUndoHistory([])}
onClose={() => {
// Instead of clearing history, we can just hide the toast
// But since UndoToast is driven by undoHistory[0],
// we might want a way to "acknowledge" the current top of history
// For now, let's just not clear the history.
}}
/>
{editingRowIndex !== null && (