diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-23 08:13:02 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-23 08:13:02 +0000 |
| commit | b2d8fc460be3105ac383098e7cdc92171e5026ec (patch) | |
| tree | cd5ba3f3008e6b3310680d785880f1f32ed090c5 /internal/models/atom.go | |
| parent | b0688c8819da1b7fcb4a97b6ec1fa58050e4841e (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/models/atom.go')
| -rw-r--r-- | internal/models/atom.go | 31 |
1 files changed, 16 insertions, 15 deletions
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, } } |
