From f9127d5272042f4980ece8b39a47613f95eeaf8e Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sat, 31 Jan 2026 21:23:56 -1000 Subject: Fix timeline calendar view and shopping UI bugs (#56, #65-73) - #56: Add overflow-hidden to card/panel classes to prevent content overflow - #65: Fix Google Tasks not showing by including tasks without due dates - #66: Add no-cache headers to prevent stale template responses - #67: Increase dropdown z-index to 100 for proper layering - #69: Implement calendar-style Today section with hourly grid (6am-10pm), duration-based event heights, and compact overdue/all-day section - #70: Only reset shopping-mode form on successful submission - #71: Remove checkboxes from shopping tab (only show in shopping mode) - #72: Add inline add-item input at end of each store section - #73: Add Grouped/Flat view toggle for shopping list Co-Authored-By: Claude Opus 4.5 --- internal/models/timeline.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'internal/models') diff --git a/internal/models/timeline.go b/internal/models/timeline.go index 0968d41..c4196bd 100644 --- a/internal/models/timeline.go +++ b/internal/models/timeline.go @@ -36,6 +36,8 @@ type TimelineItem struct { // UI enhancement fields IsCompleted bool `json:"is_completed"` + IsOverdue bool `json:"is_overdue"` + IsAllDay bool `json:"is_all_day"` // True if time is midnight (no specific time) DaySection DaySection `json:"day_section"` Source string `json:"source"` // "todoist", "trello", "plantoeat", "calendar", "gtasks" @@ -43,7 +45,7 @@ type TimelineItem struct { ListID string `json:"list_id,omitempty"` // For Google Tasks } -// ComputeDaySection sets the DaySection based on the item's time +// ComputeDaySection sets the DaySection, IsOverdue, and IsAllDay based on the item's time func (item *TimelineItem) ComputeDaySection(now time.Time) { // Use configured display timezone for consistent comparisons tz := config.GetDisplayTimezone() @@ -56,6 +58,12 @@ func (item *TimelineItem) ComputeDaySection(now time.Time) { itemDay := time.Date(localItemTime.Year(), localItemTime.Month(), localItemTime.Day(), 0, 0, 0, 0, tz) + // 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 + if itemDay.Before(tomorrow) { item.DaySection = DaySectionToday } else if itemDay.Before(dayAfterTomorrow) { -- cgit v1.2.3