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/widget_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'internal/handlers/widget_test.go') diff --git a/internal/handlers/widget_test.go b/internal/handlers/widget_test.go index 2bb92bc..fcbba52 100644 --- a/internal/handlers/widget_test.go +++ b/internal/handlers/widget_test.go @@ -17,6 +17,7 @@ import ( type mockGoogleTasksClient struct { completedListID, completedTaskID string notesListID, notesTaskID, notes string + notesTitle string } func (m *mockGoogleTasksClient) GetTasks(ctx context.Context) ([]models.GoogleTask, error) { @@ -32,8 +33,8 @@ func (m *mockGoogleTasksClient) CompleteTask(ctx context.Context, listID, taskID func (m *mockGoogleTasksClient) UncompleteTask(ctx context.Context, listID, taskID string) error { return nil } -func (m *mockGoogleTasksClient) UpdateTaskNotes(ctx context.Context, listID, taskID, notes string) error { - m.notesListID, m.notesTaskID, m.notes = listID, taskID, notes +func (m *mockGoogleTasksClient) UpdateTask(ctx context.Context, listID, taskID, title, notes string) error { + m.notesListID, m.notesTaskID, m.notesTitle, m.notes = listID, taskID, title, notes return nil } func (m *mockGoogleTasksClient) GetTaskLists(ctx context.Context) ([]models.TaskListInfo, error) { @@ -678,6 +679,9 @@ func TestHandleWidgetUpdate_GoogleTask(t *testing.T) { if mock.notesListID != "list-a" || mock.notesTaskID != "g1" || mock.notes != "bring photo and $170" { t.Errorf("unexpected update call: listID=%q taskID=%q notes=%q", mock.notesListID, mock.notesTaskID, mock.notes) } + if mock.notesTitle != "Renew passport" { + t.Errorf("title = %q, want unchanged %q (widget's edit popup has no title field)", mock.notesTitle, "Renew passport") + } } func seedTestCard(t *testing.T, db *store.Store) { -- cgit v1.2.3