mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 12:35:25 +02:00
feat: persistent multi-step undo system in TopBar
This commit is contained in:
+8
-3
@@ -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 && (
|
||||
|
||||
Reference in New Issue
Block a user