From fbf803978e1512b6833188cd91a7f00df1244e8b Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Tue, 13 Jan 2026 14:25:03 -1000 Subject: Add Todoist tasks with completion checkboxes to Planning tab Make Todoist tasks visible by integrating into Planning tab: - Add todoist-tasks template to planning-tab.html - Update HandlePlanning to fetch and pass Tasks data - Pass empty Projects slice (quick add form won't show initially) - Completion checkboxes now visible and functional Tasks with checkboxes now appear on Planning tab above Trello boards. Users can click checkboxes to complete tasks instantly. Co-Authored-By: Claude Sonnet 4.5 --- internal/handlers/tabs.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'internal/handlers/tabs.go') diff --git a/internal/handlers/tabs.go b/internal/handlers/tabs.go index b8e7bcb..c23910d 100644 --- a/internal/handlers/tabs.go +++ b/internal/handlers/tabs.go @@ -108,7 +108,7 @@ func (h *TabsHandler) HandleTasks(w http.ResponseWriter, r *http.Request) { } } -// HandlePlanning renders the Planning tab (Trello boards) +// HandlePlanning renders the Planning tab (Trello boards + Todoist tasks) func (h *TabsHandler) HandlePlanning(w http.ResponseWriter, r *http.Request) { // Fetch Trello boards boards, err := h.store.GetBoards() @@ -118,10 +118,21 @@ func (h *TabsHandler) HandlePlanning(w http.ResponseWriter, r *http.Request) { return } + // Fetch Todoist tasks + tasks, err := h.store.GetTasks() + if err != nil { + log.Printf("Error fetching tasks: %v", err) + tasks = []models.Task{} + } + data := struct { - Boards []models.Board + Boards []models.Board + Tasks []models.Task + Projects []models.Project }{ - Boards: boards, + Boards: boards, + Tasks: tasks, + Projects: []models.Project{}, // Empty for now - form won't display but checkboxes will work } if err := h.templates.ExecuteTemplate(w, "planning-tab", data); err != nil { -- cgit v1.2.3