summaryrefslogtreecommitdiff
path: root/internal/models
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-01-31 21:23:56 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-01-31 21:23:56 -1000
commitf9127d5272042f4980ece8b39a47613f95eeaf8e (patch)
treee111cc6f85b0cd23dd7e705b0390d1154fbc13ee /internal/models
parentcbb0b53de1d06918c142171fd084f14f03798bc1 (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'internal/models')
-rw-r--r--internal/models/timeline.go10
1 files changed, 9 insertions, 1 deletions
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) {