diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-18 14:06:26 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-18 14:06:26 -1000 |
| commit | 143166ce759ce2cb0133b7438db36b844a9db1a7 (patch) | |
| tree | c7adf1243a9927f568f5937f95419a1b4b61a709 /internal/handlers/tabs.go | |
| parent | 9cee3f78483532828a2f72c65eb2b952b2ded670 (diff) | |
Implement Trello task heuristics for Tasks tab (Phase 3 Step 6)
Add filtering logic to show Trello cards as actionable tasks when they
have due dates OR are in lists named like "todo", "doing", "in progress",
"tasks", "next", or "today". This makes the Tasks tab more useful by
surfacing cards that represent work items even without explicit due dates.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/handlers/tabs.go')
| -rw-r--r-- | internal/handlers/tabs.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/internal/handlers/tabs.go b/internal/handlers/tabs.go index c23910d..ce9c34f 100644 --- a/internal/handlers/tabs.go +++ b/internal/handlers/tabs.go @@ -5,12 +5,25 @@ import ( "log" "net/http" "sort" + "strings" "time" "task-dashboard/internal/models" "task-dashboard/internal/store" ) +// isActionableList returns true if the list name indicates an actionable list +func isActionableList(name string) bool { + lower := strings.ToLower(name) + return strings.Contains(lower, "doing") || + strings.Contains(lower, "in progress") || + strings.Contains(lower, "to do") || + strings.Contains(lower, "todo") || + strings.Contains(lower, "tasks") || + strings.Contains(lower, "next") || + strings.Contains(lower, "today") +} + // TabsHandler handles tab-specific rendering with Atom model type TabsHandler struct { store *store.Store @@ -65,10 +78,10 @@ func (h *TabsHandler) HandleTasks(w http.ResponseWriter, r *http.Request) { } } - // Convert Trello cards with due dates + // Convert Trello cards with due dates or in actionable lists for _, board := range boards { for _, card := range board.Cards { - if card.DueDate != nil { + if card.DueDate != nil || isActionableList(card.ListName) { atoms = append(atoms, models.CardToAtom(card)) } } |
