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/models/atom.go | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'internal/models/atom.go') diff --git a/internal/models/atom.go b/internal/models/atom.go index 3745917..767ccdd 100644 --- a/internal/models/atom.go +++ b/internal/models/atom.go @@ -12,6 +12,7 @@ const ( SourceTrello AtomSource = "trello" SourceTodoist AtomSource = "todoist" SourceMeal AtomSource = "plantoeat" + SourceGTasks AtomSource = "gtasks" ) type AtomType string @@ -122,24 +123,24 @@ func CardToAtom(c Card) Atom { } } -// MealToAtom converts a PlanToEat Meal to an Atom -func MealToAtom(m Meal) Atom { - // Meals don't have priority, default to low (1) - priority := 1 +// GoogleTaskToAtom converts a Google Task to an Atom +func GoogleTaskToAtom(t GoogleTask) Atom { + // Google Tasks don't have explicit priority, default to medium (2) + priority := 2 return Atom{ - ID: m.ID, - Title: m.RecipeName, - Description: m.MealType, // breakfast, lunch, dinner - Source: SourceMeal, - Type: TypeMeal, - URL: m.RecipeURL, - DueDate: &m.Date, // Meal date is effectively the "due date" - CreatedAt: time.Time{}, + ID: t.ID, + Title: t.Title, + Description: t.Notes, + Source: SourceGTasks, + Type: TypeTask, + URL: t.URL, + DueDate: t.DueDate, + CreatedAt: t.UpdatedAt, Priority: priority, - SourceIcon: "🍽️", // Fork and knife emoji for meals - ColorClass: "border-green-500", - Raw: m, + SourceIcon: "🔵", // Blue circle for Google Tasks + ColorClass: "border-blue-400", + Raw: t, } } -- cgit v1.2.3