From 4943c80dbd0973bf2a5ef2bb572ae2b83021f368 Mon Sep 17 00:00:00 2001 From: Mathias Date: Fri, 2 Oct 2026 17:20:02 +0200 Subject: [PATCH] feat(progress): Annotate -- a note on a step, saved at once (second review finding 1) Co-Authored-By: Claude Sonnet 5.5 --- internal/progress/tracker.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/internal/progress/tracker.go b/internal/progress/tracker.go index 37678b7..71c3d2f 100644 --- a/internal/progress/tracker.go +++ b/internal/progress/tracker.go @@ -186,6 +186,20 @@ func (t *Tracker) Finish() { t.save() } +// Annotate attaches a short plain note to a phase and saves it at once. It is for a +// remark the reader should see although nothing failed. Durations and counts only: a note +// is shown on a page about a private recording. +func (t *Tracker) Annotate(key, note string) { + t.mu.Lock() + defer t.mu.Unlock() + s := t.find(key) + if s == nil { + return + } + s.Note = note + t.save() +} + // Heartbeat stamps the job's row every beatEvery and logs which phase is still running // every stillEvery, until ctx ends. It runs on its own, independent of any engine call: // a heartbeat that stopped means the process is gone, not that a request is slow.