From 1c6552117038cb7c01e016dbf1ac062e1d9f9c73 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sun, 1 Feb 2026 10:52:28 -1000 Subject: Improve timeline view with dynamic bounds, now line, and overlap handling - Add dynamic calendar clipping: show 1 hour before/after events instead of hardcoded 6am-10pm - Add "NOW" line indicator showing current time position - Improve time label readability with larger font and better contrast - Add overlap detection with column-based indentation for concurrent events - Apply calendar view to Tomorrow section (matching Today's layout) - Fix auto-refresh switching to tasks tab (default was 'tasks' instead of 'timeline') Co-Authored-By: Claude Opus 4.5 --- internal/handlers/handlers.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'internal/handlers/handlers.go') diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index bba12ad..c384c48 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -36,8 +36,13 @@ type Handler struct { // New creates a new Handler instance func New(s *store.Store, todoist api.TodoistAPI, trello api.TrelloAPI, planToEat api.PlanToEatAPI, googleCalendar api.GoogleCalendarAPI, googleTasks api.GoogleTasksAPI, cfg *config.Config) *Handler { + // Template functions + funcMap := template.FuncMap{ + "subtract": func(a, b int) int { return a - b }, + } + // Parse templates including partials - tmpl, err := template.ParseGlob(filepath.Join(cfg.TemplateDir, "*.html")) + tmpl, err := template.New("").Funcs(funcMap).ParseGlob(filepath.Join(cfg.TemplateDir, "*.html")) if err != nil { log.Printf("Warning: failed to parse templates: %v", err) } -- cgit v1.2.3