summaryrefslogtreecommitdiff
path: root/internal/handlers/atoms.go
diff options
context:
space:
mode:
authorDoot Agent <agent@doot.local>2026-07-05 08:22:17 +0000
committerDoot Agent <agent@doot.local>2026-07-05 08:22:17 +0000
commit8ca820b05e9e699a7b563a2e37ff2a0629a5505a (patch)
treeea9558a46143e2be3ff7f681242b3a896957441a /internal/handlers/atoms.go
parent8c55b9b10fecd45ac5acf3f13fc23d342a4aa53b (diff)
fix: native tasks missing from Tasks tab and blank title on completion
Bug 1: BuildUnifiedAtomList never called GetNativeTasks(), so doot-sourced tasks were absent from the web Tasks tab. Added GetNativeTasks() fetch and NativeTaskToAtom conversion (new model helper, SourceDoot constant). Bug 2: handleAtomToggle called getAtomDetails after CompleteNativeTask, but GetNativeTasks filters WHERE completed=0, so the task was already gone and the title came back blank. Moved getAtomDetails call to before the completion switch so all sources (including doot) capture title/dueDate first. Also fixed widget_test.go compile error: TestHandleWidgetComplete_NonTodoist called HandleWidgetComplete as a package-level function but it is a method on *Handler. Rewrote the file as package handlers (internal) and construct &Handler{} directly. Regression tests added for both bugs in atoms_test.go and handlers_test.go. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/handlers/atoms.go')
-rw-r--r--internal/handlers/atoms.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/internal/handlers/atoms.go b/internal/handlers/atoms.go
index 6086a5b..0b59060 100644
--- a/internal/handlers/atoms.go
+++ b/internal/handlers/atoms.go
@@ -28,7 +28,17 @@ func BuildUnifiedAtomList(s *store.Store, claudomator api.ClaudomatorClient) ([]
log.Printf("Warning: failed to fetch cached google tasks: %v", err)
}
- atoms := make([]models.Atom, 0, len(tasks)+len(gTasks))
+ nativeTasks, err := s.GetNativeTasks()
+ if err != nil {
+ log.Printf("Warning: failed to fetch native tasks: %v", err)
+ }
+
+ atoms := make([]models.Atom, 0, len(tasks)+len(gTasks)+len(nativeTasks))
+
+ // Add native doot tasks (GetNativeTasks already filters completed=0)
+ for _, task := range nativeTasks {
+ atoms = append(atoms, models.NativeTaskToAtom(task))
+ }
// Add incomplete tasks
for _, task := range tasks {