summaryrefslogtreecommitdiff
path: root/internal/handlers/atoms.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-23 08:13:02 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-23 08:13:02 +0000
commitb2d8fc460be3105ac383098e7cdc92171e5026ec (patch)
treecd5ba3f3008e6b3310680d785880f1f32ed090c5 /internal/handlers/atoms.go
parentb0688c8819da1b7fcb4a97b6ec1fa58050e4841e (diff)
feat: unify Google Tasks with main system via caching and integrated UI
- Implement SQLite caching layer for Google Tasks - Integrate Google Tasks into unified Atoms loop (showing in Tasks tab) - Update Planning tab to include cached Google Tasks - Enhance Quick Add form with Todoist project selector - Remove orphaned HandleTasksTab/HandleRefreshTab methods - Update tests to reflect new BuildTimeline signature and data structures
Diffstat (limited to 'internal/handlers/atoms.go')
-rw-r--r--internal/handlers/atoms.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/internal/handlers/atoms.go b/internal/handlers/atoms.go
index 0ebf4e6..e99c879 100644
--- a/internal/handlers/atoms.go
+++ b/internal/handlers/atoms.go
@@ -1,13 +1,14 @@
package handlers
import (
+ "log"
"sort"
"task-dashboard/internal/models"
"task-dashboard/internal/store"
)
-// BuildUnifiedAtomList creates a list of atoms from tasks and cards
+// BuildUnifiedAtomList creates a list of atoms from tasks, cards, and google tasks
func BuildUnifiedAtomList(s *store.Store) ([]models.Atom, []models.Board, error) {
tasks, err := s.GetTasks()
if err != nil {
@@ -19,7 +20,13 @@ func BuildUnifiedAtomList(s *store.Store) ([]models.Atom, []models.Board, error)
return nil, nil, err
}
- atoms := make([]models.Atom, 0, len(tasks))
+ gTasks, err := s.GetGoogleTasks()
+ if err != nil {
+ // Log but don't fail if gtasks fails (might be new/not configured)
+ log.Printf("Warning: failed to fetch cached google tasks: %v", err)
+ }
+
+ atoms := make([]models.Atom, 0, len(tasks)+len(gTasks))
// Add incomplete tasks
for _, task := range tasks {
@@ -28,6 +35,13 @@ func BuildUnifiedAtomList(s *store.Store) ([]models.Atom, []models.Board, error)
}
}
+ // Add incomplete google tasks
+ for _, gTask := range gTasks {
+ if !gTask.Completed {
+ atoms = append(atoms, models.GoogleTaskToAtom(gTask))
+ }
+ }
+
// Add cards with due dates or from actionable lists
for _, board := range boards {
for _, card := range board.Cards {