From dd4689a71de8f1c0b5a2d483827411a9645ad66a Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Tue, 20 Jan 2026 21:38:18 -1000 Subject: UI improvements and bug fixes - Gray out overdue tasks (past today) - Sort tasks with specific times before midnight-due tasks - Fix timezone bug in quick add (use local timezone) - Remove "Personal Dashboard" header, minimal refresh/logout bar - Change Todoist icon from checkmark to red circle - Show due time when set (not just date) - Compact task list styling Co-Authored-By: Claude Opus 4.5 --- internal/models/atom.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'internal/models') diff --git a/internal/models/atom.go b/internal/models/atom.go index fe40962..b3a384a 100644 --- a/internal/models/atom.go +++ b/internal/models/atom.go @@ -36,11 +36,30 @@ type Atom struct { // UI Helpers (to be populated by mappers) SourceIcon string // e.g., "trello-icon.svg" or emoji ColorClass string // e.g., "border-blue-500" + IsOverdue bool // True if due date is before today + HasSetTime bool // True if due time is not midnight (has specific time) // Original Data (for write operations) Raw interface{} } +// ComputeUIFields calculates IsOverdue and HasSetTime based on DueDate +func (a *Atom) ComputeUIFields() { + if a.DueDate == nil { + return + } + + now := time.Now() + today := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location()) + + // Check if overdue (due date is before today) + dueDay := time.Date(a.DueDate.Year(), a.DueDate.Month(), a.DueDate.Day(), 0, 0, 0, 0, a.DueDate.Location()) + a.IsOverdue = dueDay.Before(today) + + // Check if has set time (not midnight) + a.HasSetTime = a.DueDate.Hour() != 0 || a.DueDate.Minute() != 0 +} + // TaskToAtom converts a Todoist Task to an Atom func TaskToAtom(t Task) Atom { // Todoist priority: 1 (normal) to 4 (urgent) @@ -63,7 +82,7 @@ func TaskToAtom(t Task) Atom { DueDate: t.DueDate, CreatedAt: t.CreatedAt, Priority: priority, - SourceIcon: "✓", // Checkmark emoji for tasks + SourceIcon: "🔴", // Red circle for Todoist ColorClass: "border-red-500", Raw: t, } -- cgit v1.2.3