fix: Hide waiting tasks from reports as default behaviour

This commit is contained in:
2026-02-25 21:46:50 +01:00
parent 9973631df0
commit 6c28e4d24a
+9
View File
@@ -21,6 +21,7 @@ type Report struct {
DisplayFormat DisplayFormat // How to display results
SortFunc func([]*Task) []*Task
LimitFunc func([]*Task) []*Task
ShowWaiting bool // If false (default), tasks with future wait dates are hidden
}
// AllReports returns all predefined reports
@@ -77,6 +78,7 @@ func AllReport() *Report {
Description: "All tasks",
BaseFilter: filter,
DisplayFormat: DisplayFormatTable,
ShowWaiting: true,
}
}
@@ -273,6 +275,7 @@ func WaitingReport() *Report {
Description: "Hidden/waiting tasks",
BaseFilter: filter,
DisplayFormat: DisplayFormatTable,
ShowWaiting: true,
}
}
@@ -322,6 +325,12 @@ func (r *Report) applyPostFilters(tasks []*Task) []*Task {
for _, task := range tasks {
include := true
// By default, hide tasks with a future wait date (like taskwarrior).
// Reports that need to show waiting tasks set ShowWaiting = true.
if !r.ShowWaiting && task.Wait != nil && task.Wait.After(now) {
include = false
}
// Check for _started marker
if r.BaseFilter.Attributes["_started"] == "true" {
if task.Start == nil {