summaryrefslogtreecommitdiff
path: root/internal/models/timeline.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-07-25 20:09:42 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-07-25 20:09:42 +0000
commit7f8cd6bfb894385b9ae310fd000cb921fef71cea (patch)
tree08542eabe0463eb96b6878875699c92b1eeb9d80 /internal/models/timeline.go
parent231f6f81ef60888de7309f589b6ebd2634159524 (diff)
fix: undated tasks were landing in the widget's scheduled-events grid
ComputeDaySection unconditionally recomputed IsAllDay from a midnight-time heuristic, clobbering the IsAllDay:true flag callers set to mark floating (no-due-date) tasks -- since undated tasks use Time = now, this silently reset IsAllDay to false and gave them a real Start, so the widget could render them via EventBlock/HourRow instead of TaskRow. Their click handler always opens the calendar/source URL, so tapping a no-due-date task (e.g. a Google Task) opened Google Calendar instead of the task detail sheet. ComputeDaySection now only ever sets IsAllDay true, never clears an already-true value. Also flag IsAllDay for undated Google Tasks, which never got it set at all (only native undated doot tasks did).
Diffstat (limited to 'internal/models/timeline.go')
-rw-r--r--internal/models/timeline.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/internal/models/timeline.go b/internal/models/timeline.go
index 4b90856..5224b72 100644
--- a/internal/models/timeline.go
+++ b/internal/models/timeline.go
@@ -66,8 +66,15 @@ func (item *TimelineItem) ComputeDaySection(now time.Time) {
// Check if item is overdue (before today)
item.IsOverdue = itemDay.Before(today)
- // Check if item is all-day (midnight time means no specific time)
- item.IsAllDay = localItemTime.Hour() == 0 && localItemTime.Minute() == 0
+ // Check if item is all-day (midnight time means no specific time).
+ // Only ever sets IsAllDay to true here -- never clears a true a caller
+ // already set (e.g. nativeUndated/gtask "no due date" tasks, which use
+ // IsAllDay as a floating-task marker with Time set to "now", not
+ // midnight -- clobbering it back to false made them look like real
+ // scheduled items to the widget client).
+ if localItemTime.Hour() == 0 && localItemTime.Minute() == 0 {
+ item.IsAllDay = true
+ }
if itemDay.Before(tomorrow) {
item.DaySection = DaySectionToday