From a03d7673e7adf9a575c7272b2b528a74b230535e Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Thu, 13 Aug 2026 08:38:29 +0000 Subject: Fix blank task-detail modal for Google Tasks loadTaskDetailData/HandleUpdateTask only had cases for "trello" and "doot" sources, so opening a gtask from the Tasks or Timeline tab rendered an empty title/description. Reuses the existing findGoogleTask cache lookup for both. Renamed the API client's UpdateTaskNotes to UpdateTask(title, notes) so the web modal can save an edited title too, not just description; the widget's description-only edit popup now just round-trips the task's existing title unchanged. --- internal/handlers/handlers.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'internal/handlers/handlers.go') diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index 30aaf67..7220474 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -832,6 +832,10 @@ func (h *Handler) loadTaskDetailData(id, source string) taskDetailData { data.RecurrenceInterval = task.RecurrenceInterval data.RecurrenceWeekdays = task.RecurrenceWeekdays } + case "gtasks": + if t, ok := h.findGoogleTask(id); ok { + data.Title, data.Description = t.Title, t.Notes + } } return data } @@ -975,6 +979,24 @@ func (h *Handler) HandleUpdateTask(w http.ResponseWriter, r *http.Request) { updates["name"] = title } err = h.trelloClient.UpdateCard(r.Context(), id, updates) + case "gtasks": + if h.googleTasksClient == nil { + JSONError(w, http.StatusServiceUnavailable, "Google Tasks not configured", nil) + return + } + t, ok := h.findGoogleTask(id) + if !ok { + JSONError(w, http.StatusNotFound, "task not found", nil) + return + } + saveTitle := title + if saveTitle == "" { + saveTitle = t.Title + } + err = h.googleTasksClient.UpdateTask(r.Context(), t.ListID, id, saveTitle, description) + if err == nil { + _ = h.store.InvalidateCache(store.CacheKeyGoogleTasks) + } default: JSONError(w, http.StatusBadRequest, "Unknown source", nil) return -- cgit v1.2.3