diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-07-13 06:54:13 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-07-13 06:54:13 +0000 |
| commit | 8310f802dd9fc6ef5dff0be7f640f79c5b39987f (patch) | |
| tree | d145bd7be5801f12563e99b6828b0f2facdc370c /internal/store/native_tasks.go | |
| parent | 73fbd05a1230552bcef9834d3ee999ef19957693 (diff) | |
feat(widget): editable task details, scrollable list, and overdue-task fixes
- Add description editing to the widget's task detail popup for
doot/gtasks/trello, backed by new GET /api/widget/detail and
POST /api/widget/update endpoints
- Make Google Tasks and Trello cards completable via the widget (Trello
completion archives the card); fix Trello description never being
fetched, which meant saving could silently wipe a card's real desc
- Fix google_tasks.due_date/updated_at (TEXT columns) never round-tripping
through sql.NullTime, which broke cached Google Tasks reads whenever
the cache was valid
- Fix native-task and Google-Task date-range queries excluding anything
due before the window start, which dropped incomplete tasks off the
widget the moment their due day passed (the "overdue tasks disappeared"
bug)
- Fix native task description edits blanking the task's title
- Make the widget's day list scroll (LazyColumn) instead of clipping
- Optimistically remove a task from the widget immediately on completion,
ahead of the authoritative background refresh
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZ7ikw2ukGJFTHE3bJS7zL
Diffstat (limited to 'internal/store/native_tasks.go')
| -rw-r--r-- | internal/store/native_tasks.go | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/internal/store/native_tasks.go b/internal/store/native_tasks.go index 5758407..218675e 100644 --- a/internal/store/native_tasks.go +++ b/internal/store/native_tasks.go @@ -22,14 +22,15 @@ func (s *Store) GetNativeTasks() ([]models.Task, error) { return scanNativeTasks(rows) } -// GetNativeTasksByDateRange returns non-completed native tasks due within the given range. +// GetNativeTasksByDateRange returns non-completed native tasks due within the given range, +// including overdue tasks (due before start) so they keep appearing until completed. func (s *Store) GetNativeTasksByDateRange(start, end time.Time) ([]models.Task, error) { rows, err := s.db.Query(` SELECT id, content, description, project_name, due_date, priority, completed, labels, created_at FROM native_tasks - WHERE completed = 0 AND due_date IS NOT NULL AND due_date >= ? AND due_date < ? + WHERE completed = 0 AND due_date IS NOT NULL AND due_date < ? ORDER BY due_date ASC, priority DESC - `, start, end) + `, end) if err != nil { return nil, err } @@ -71,6 +72,15 @@ func (s *Store) UpdateNativeTask(id, content, description string) error { return err } +// UpdateNativeTaskDescription updates only a native task's description, leaving content untouched. +func (s *Store) UpdateNativeTaskDescription(id, description string) error { + _, err := s.db.Exec(` + UPDATE native_tasks SET description = ?, updated_at = CURRENT_TIMESTAMP + WHERE id = ? + `, description, id) + return err +} + // CompleteNativeTask marks a task as completed. func (s *Store) CompleteNativeTask(id string) error { _, err := s.db.Exec(` |
