diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-21 22:53:37 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-21 22:53:37 -1000 |
| commit | 583f90c5dedf0235fa45557359b0e6e7dd62b0f0 (patch) | |
| tree | 304e4527b6668669197fc9ffdf2ffc87566478f0 /internal/models/atom.go | |
| parent | dd4689a71de8f1c0b5a2d483827411a9645ad66a (diff) | |
Implement 10 UI/UX improvements and bug fixes
- Fix outdated Todoist task URL format (showTask -> app/task)
- Fix quick-add date defaulting to tomorrow in evening (client-side JS)
- Add tap-to-expand for task descriptions with checkbox completion
- Add visual differentiation: overdue (red), future (gray), today (normal)
- Sort tasks by urgency: overdue > today-timed > today-allday > future
- Keep completed tasks visible with strikethrough until refresh
- Add random Unsplash landscape background with content overlay
- Hide future tasks behind collapsible fold with count badge
- Unified modal menu for Quick Add + Bug Report (Ctrl+K shortcut)
- Click task title to edit description in modal
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/models/atom.go')
| -rw-r--r-- | internal/models/atom.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/models/atom.go b/internal/models/atom.go index b3a384a..10d14d1 100644 --- a/internal/models/atom.go +++ b/internal/models/atom.go @@ -37,13 +37,14 @@ type Atom struct { 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 + IsFuture bool // True if due date is after 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 +// ComputeUIFields calculates IsOverdue, IsFuture, and HasSetTime based on DueDate func (a *Atom) ComputeUIFields() { if a.DueDate == nil { return @@ -51,11 +52,15 @@ func (a *Atom) ComputeUIFields() { now := time.Now() today := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location()) + tomorrow := today.AddDate(0, 0, 1) // 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 future (due date is after today) + a.IsFuture = !dueDay.Before(tomorrow) + // Check if has set time (not midnight) a.HasSetTime = a.DueDate.Hour() != 0 || a.DueDate.Minute() != 0 } |
