summaryrefslogtreecommitdiff
path: root/issues/006-reorder-tasks-by-urgency.md
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-01-22 11:15:08 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-01-22 11:15:08 -1000
commitb41d38e0161d49fac23c1d552622e7b8310b1c68 (patch)
treecef7af2b1b0a5586082121965639ae947c7b54ad /issues/006-reorder-tasks-by-urgency.md
parent7fd381a242f68b7c6f10db4e3ae0bb3d06e36a16 (diff)
Add deploy script and remove resolved issues
- Add deployment/deploy script for server-side deploys - Remove 10 completed issue files (001-016 batch) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'issues/006-reorder-tasks-by-urgency.md')
-rw-r--r--issues/006-reorder-tasks-by-urgency.md63
1 files changed, 0 insertions, 63 deletions
diff --git a/issues/006-reorder-tasks-by-urgency.md b/issues/006-reorder-tasks-by-urgency.md
deleted file mode 100644
index 8a5f968..0000000
--- a/issues/006-reorder-tasks-by-urgency.md
+++ /dev/null
@@ -1,63 +0,0 @@
-# [FEATURE] Reorder task list by urgency
-
-## Description
-List past due tasks, then tasks with a specific time today, then 12am (all-day) tasks today, then future tasks.
-
-## User Story
-As a user, I want tasks sorted by urgency tiers so I see what needs attention first.
-
-## Technical Context
-- Affects: `internal/handlers/handlers.go` — sorting logic before template render
-- Requires distinguishing "has specific time" vs "all-day" (midnight/00:00)
-- Todoist API may return all-day tasks with time set to 00:00:00
-
-## Test Strategy
-
-### Unit Test (Red)
-**File:** `internal/handlers/handlers_test.go`
-
-```go
-func TestSortTasksByUrgency(t *testing.T) {
- tasks := []Task{
- {Name: "future", DueDate: tomorrow},
- {Name: "overdue", DueDate: yesterday},
- {Name: "today-timed", DueDate: todayAt(14, 30)},
- {Name: "today-allday", DueDate: todayAt(0, 0)},
- }
-
- sorted := SortTasksByUrgency(tasks)
-
- // Expected order: overdue, today-timed, today-allday, future
- assert.Equal(t, "overdue", sorted[0].Name)
- assert.Equal(t, "today-timed", sorted[1].Name)
- assert.Equal(t, "today-allday", sorted[2].Name)
- assert.Equal(t, "future", sorted[3].Name)
-}
-```
-
-## Proposed Approach
-
-1. Define sort buckets with priority:
- - Priority 0: Overdue (due_date < today)
- - Priority 1: Today with specific time (due_date == today && time != 00:00)
- - Priority 2: Today all-day (due_date == today && time == 00:00)
- - Priority 3: Future (due_date > today)
-2. Within each bucket, sort by due_date ascending
-3. Implement stable sort to preserve original order within equal items
-
-## Traps to Avoid
-- **Timezone handling:** Ensure consistent timezone (user's local or UTC?) for date comparisons
-- **Null due dates:** Decide where tasks with no due date should appear (suggest: after future tasks)
-- **All-day detection:** Todoist may use different conventions; verify API response format
-
-## Affected Components
-- `internal/handlers/handlers.go`
-- `internal/handlers/handlers_test.go`
-
-## Definition of Done
-- [ ] Tasks sorted in specified order
-- [ ] Overdue tasks appear first
-- [ ] Timed tasks today before all-day tasks today
-- [ ] Future tasks appear last
-- [ ] Null due date tasks handled gracefully
-- [ ] Unit tests cover all buckets and edge cases