MCPcopy Create free account
hub / github.com/driangle/taskmd / formatChangeSummary

Function formatChangeSummary

apps/cli/internal/cli/feed.go:176–197  ·  view source on GitHub ↗

formatChangeSummary builds a compact one-line summary of field and subtask changes.

(f feed.FileChange)

Source from the content-addressed store, hash-verified

174
175// formatChangeSummary builds a compact one-line summary of field and subtask changes.
176func formatChangeSummary(f feed.FileChange) string {
177 var parts []string
178 for _, fc := range f.FieldChanges {
179 parts = append(parts, fmt.Sprintf("%s %s \u2192 %s", fc.Field, fc.OldValue, fc.NewValue))
180 }
181 done := 0
182 undone := 0
183 for _, sc := range f.SubtaskChanges {
184 if sc.Done {
185 done++
186 } else {
187 undone++
188 }
189 }
190 if done > 0 {
191 parts = append(parts, fmt.Sprintf("%d subtask(s) completed", done))
192 }
193 if undone > 0 {
194 parts = append(parts, fmt.Sprintf("%d subtask(s) unchecked", undone))
195 }
196 return strings.Join(parts, ", ")
197}
198
199func fileStatusTag(fc feed.FileChange) string {
200 if fc.TaskStatus == "completed" {

Callers 1

writeFileChangeTextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected