diff --git a/src/App.tsx b/src/App.tsx index 6a6503c..1f53b39 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -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() { 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 && ( diff --git a/src/components/TopBar.tsx b/src/components/TopBar.tsx index e597d6f..1418593 100644 --- a/src/components/TopBar.tsx +++ b/src/components/TopBar.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { Download, Database, LogOut, Undo2 } from 'lucide-react'; +import { cn } from '../lib/utils'; interface TopBarProps { stats: any; @@ -70,21 +71,25 @@ export function TopBar({ stats, onExport, hasData, hasUnsavedChanges, userEmail, )} - {canUndo && ( - - )} + {userEmail && (