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/timeline_logic_test.go | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'internal/handlers/timeline_logic_test.go') diff --git a/internal/handlers/timeline_logic_test.go b/internal/handlers/timeline_logic_test.go index 8104a96..d6959da 100644 --- a/internal/handlers/timeline_logic_test.go +++ b/internal/handlers/timeline_logic_test.go @@ -90,6 +90,17 @@ func setupTestStore(t *testing.T) *store.Store { html_link TEXT, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ); + CREATE TABLE IF NOT EXISTS google_tasks ( + id TEXT PRIMARY KEY, + title TEXT NOT NULL, + notes TEXT, + status TEXT NOT NULL, + completed BOOLEAN NOT NULL DEFAULT 0, + due_date DATETIME, + updated_at DATETIME, + list_id TEXT NOT NULL, + url TEXT + ); ` if err := os.WriteFile(filepath.Join(migrationDir, "001_init.sql"), []byte(schema), 0644); err != nil { t.Fatalf("Failed to write migration file: %v", err) @@ -143,7 +154,7 @@ func TestBuildTimeline(t *testing.T) { start := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) end := time.Date(2023, 1, 2, 0, 0, 0, 0, time.UTC) - items, err := BuildTimeline(context.Background(), s, nil, start, end) + items, err := BuildTimeline(context.Background(), s, start, end) if err != nil { t.Fatalf("BuildTimeline failed: %v", err) } @@ -277,7 +288,7 @@ func TestBuildTimeline_IncludesOverdueItems(t *testing.T) { // Query range: today through tomorrow end := today.AddDate(0, 0, 1) - items, err := BuildTimeline(context.Background(), s, nil,today, end) + items, err := BuildTimeline(context.Background(), s, today, end) if err != nil { t.Fatalf("BuildTimeline failed: %v", err) } @@ -320,7 +331,7 @@ func TestBuildTimeline_ExcludesCompletedOverdue(t *testing.T) { {ID: "done1", Content: "Done overdue", DueDate: &yesterday, Completed: true}, }) - items, err := BuildTimeline(context.Background(), s, nil,today, end) + items, err := BuildTimeline(context.Background(), s, today, end) if err != nil { t.Fatalf("BuildTimeline failed: %v", err) } @@ -348,7 +359,7 @@ func TestBuildTimeline_ReadsCalendarEventsFromStore(t *testing.T) { } // Call BuildTimeline with NO calendar client (nil) — events should come from store - items, err := BuildTimeline(context.Background(), s, nil,start, end) + items, err := BuildTimeline(context.Background(), s, start, end) if err != nil { t.Fatalf("BuildTimeline failed: %v", err) } @@ -473,7 +484,7 @@ func TestBuildTimeline_IncludesUndatedTodoistTasks(t *testing.T) { start := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) end := time.Date(2023, 1, 2, 0, 0, 0, 0, time.UTC) - items, err := BuildTimeline(context.Background(), s, nil, start, end) + items, err := BuildTimeline(context.Background(), s, start, end) if err != nil { t.Fatalf("BuildTimeline failed: %v", err) } -- cgit v1.2.3