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:
@@ -175,6 +175,18 @@ func FormatTaskDetail(task *Task) string {
|
||||
t.AppendRow(table.Row{"Tags", formatTags(task.Tags)})
|
||||
}
|
||||
|
||||
if len(task.Annotations) > 0 {
|
||||
t.AppendSeparator()
|
||||
for i, ann := range task.Annotations {
|
||||
label := ""
|
||||
if i == 0 {
|
||||
label = "Annotations"
|
||||
}
|
||||
ts := time.Unix(ann.Timestamp, 0).Format("2006-01-02 15:04")
|
||||
t.AppendRow(table.Row{label, fmt.Sprintf("%s %s", ts, ann.Text)})
|
||||
}
|
||||
}
|
||||
|
||||
return t.Render()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user