Persist undo/redo history across runs with a 20-entry cap.

Serialize create/update/delete commands to DataDir/history.json and reload them on startup via OpenHistory.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Skruecken
2026-10-19 10:25:07 +02:00
co-authored by Cursor
parent 24c1e146ec
commit 73216ec4ae
4 changed files with 298 additions and 9 deletions
+4 -1
View File
@@ -48,7 +48,10 @@ func run() error {
return fmt.Errorf("ensure project: %w", err)
}
history := command.NewHistory()
history, err := command.OpenHistory(command.HistoryPath(cfg.DataDir), store)
if err != nil {
return fmt.Errorf("history: %w", err)
}
model := ui.New(cfg, store, projects, history)
prog := tea.NewProgram(model, tea.WithAltScreen())
if _, err := prog.Run(); err != nil {