From b2d8fc460be3105ac383098e7cdc92171e5026ec Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 23 Mar 2026 08:13:02 +0000 Subject: 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 --- internal/handlers/atoms.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'internal/handlers/atoms.go') 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 { -- cgit v1.2.3