diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-20 11:17:19 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-20 11:17:19 -1000 |
| commit | 07ba815e8517ee2d3a5fa531361bbd09bdfcbaa7 (patch) | |
| tree | ca9d9be0f02d5a724a3646f87d4a9f50203249cc /internal/handlers/tabs.go | |
| parent | 6a59098c3096f5ebd3a61ef5268cbd480b0f1519 (diff) | |
Remove Obsidian integration for public server deployment
Obsidian relied on local filesystem access which is incompatible with
public server deployment. This removes all Obsidian-related code including:
- API client and interface
- Store layer methods (SaveNotes, GetNotes, SearchNotes)
- Handler methods and routes
- UI tab and templates
- Configuration fields
- Related tests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/handlers/tabs.go')
| -rw-r--r-- | internal/handlers/tabs.go | 56 |
1 files changed, 2 insertions, 54 deletions
diff --git a/internal/handlers/tabs.go b/internal/handlers/tabs.go index 1afdd06..7e0b352 100644 --- a/internal/handlers/tabs.go +++ b/internal/handlers/tabs.go @@ -126,7 +126,7 @@ func (h *TabsHandler) HandleTasks(w http.ResponseWriter, r *http.Request) { } } -// HandlePlanning renders the Planning tab (Trello boards + Todoist tasks) +// HandlePlanning renders the Planning tab (Trello boards) func (h *TabsHandler) HandlePlanning(w http.ResponseWriter, r *http.Request) { // Fetch Trello boards boards, err := h.store.GetBoards() @@ -136,21 +136,12 @@ 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 - Tasks []models.Task Projects []models.Project }{ Boards: boards, - Tasks: tasks, - Projects: []models.Project{}, // Empty for now - form won't display but checkboxes will work + Projects: []models.Project{}, // Empty for now } if err := h.templates.ExecuteTemplate(w, "planning-tab", data); err != nil { @@ -159,49 +150,6 @@ func (h *TabsHandler) HandlePlanning(w http.ResponseWriter, r *http.Request) { } } -// HandleNotes renders the Notes tab (Obsidian notes) -func (h *TabsHandler) HandleNotes(w http.ResponseWriter, r *http.Request) { - // Check for search query parameter - query := r.URL.Query().Get("q") - - var notes []models.Note - var err error - - // If search query is present, search notes; otherwise, get all notes - if query != "" { - notes, err = h.store.SearchNotes(query) - } else { - notes, err = h.store.GetNotes(20) - } - - if err != nil { - http.Error(w, "Failed to fetch notes", http.StatusInternalServerError) - log.Printf("Error fetching notes: %v", err) - return - } - - data := struct { - Notes []models.Note - Errors []string - }{ - Notes: notes, - Errors: nil, - } - - // Check HX-Target header for partial update - hxTarget := r.Header.Get("HX-Target") - templateName := "notes-tab" - if hxTarget == "notes-results" { - // Render only the notes list for HTMX partial update - templateName = "obsidian-notes" - } - - if err := h.templates.ExecuteTemplate(w, templateName, data); err != nil { - http.Error(w, "Failed to render template", http.StatusInternalServerError) - log.Printf("Error rendering notes tab: %v", err) - } -} - // HandleMeals renders the Meals tab (PlanToEat) func (h *TabsHandler) HandleMeals(w http.ResponseWriter, r *http.Request) { // Fetch meals for next 7 days |
