feat: add annotations, undo system, and schema updates
Add annotations as JSON column on tasks table with Annotate/Denotate methods and CLI commands. Add undo system backed by change_log with lightweight undo_stack table (capped at 10 entries). All mutating CLI commands (add, done, delete, modify, start, stop) now record undo entries. Undo restores prior task state from change_log data. Schema changes (in v1 migration): - annotations TEXT column on tasks - undo_stack table - annotations field in change_log triggers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -63,6 +63,8 @@ func addTask(args []string) error {
|
||||
return fmt.Errorf("failed to create task: %w", err)
|
||||
}
|
||||
|
||||
engine.RecordUndo("add", task.UUID)
|
||||
|
||||
displayID, err := engine.AppendTask(task)
|
||||
if err != nil {
|
||||
// Non-fatal: task was created, just can't assign display ID
|
||||
@@ -113,6 +115,8 @@ func addRecurringTask(description string, mod *engine.Modifier) error {
|
||||
return err
|
||||
}
|
||||
|
||||
engine.RecordUndo("add", instance.UUID)
|
||||
|
||||
displayID, err := engine.AppendTask(instance)
|
||||
if err != nil {
|
||||
fmt.Printf("Created recurring task %s\n", *instance.ParentUUID)
|
||||
|
||||
Reference in New Issue
Block a user