From 3fbfdd1f9441299eb146bf215449f238977deb66 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 29 Jun 2026 08:53:48 +0000 Subject: feat: native task management + Todoist migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds doot-owned task storage (native_tasks table) so tasks can be managed without Todoist. CompleteTask for 'doot' source just updates the DB — no external API call, no token dependency. Migration path: POST /settings/import-from-todoist — copies Todoist cache → native_tasks Then remove TODOIST_TOKEN from .env to disable Todoist Changes: - migration 020: native_tasks table - store: GetNativeTasks, GetNativeTasksByDateRange, GetUndatedNativeTasks, CreateNativeTask, CompleteNativeTask, UncompleteNativeTask, UpdateNativeTask, ImportFromTodoist - timeline: native tasks appear as source="doot" (teal) - handleAtomToggle: "doot" case — no external API needed - HandleWidgetComplete: method on Handler, handles "doot" natively - HandleUnifiedAdd: "doot" source creates in native_tasks - widget: "doot" tasks are completable, teal color indicator Co-Authored-By: Claude Sonnet 4.6 --- cmd/dashboard/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmd/dashboard/main.go') diff --git a/cmd/dashboard/main.go b/cmd/dashboard/main.go index 92a149b..c154d9b 100644 --- a/cmd/dashboard/main.go +++ b/cmd/dashboard/main.go @@ -342,6 +342,9 @@ func main() { r.Post("/passkeys/register/finish", authHandlers.HandlePasskeyRegisterFinish) r.Delete("/passkeys/{id}", authHandlers.HandleDeletePasskey) + // Native task management + r.Post("/settings/import-from-todoist", h.HandleImportFromTodoist) + // Settings r.Get("/settings", h.HandleSettingsPage) r.Post("/settings/sync", h.HandleSyncSources) @@ -362,7 +365,7 @@ func main() { return handlers.WidgetAuthMiddleware(cfg.WidgetToken, next) } r.With(widgetAuth).Get("/api/widget", h.HandleWidgetGet) - r.With(widgetAuth).Post("/api/widget/complete", handlers.HandleWidgetComplete(todoistClient)) + r.With(widgetAuth).Post("/api/widget/complete", h.HandleWidgetComplete) } else { log.Println("WIDGET_TOKEN not set — /api/widget disabled") } -- cgit v1.2.3