diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-02-01 10:52:28 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-02-01 10:52:28 -1000 |
| commit | 1c6552117038cb7c01e016dbf1ac062e1d9f9c73 (patch) | |
| tree | ff65c67a40e08a14f89fe3057a8ac4886d94b75b /internal/handlers/handlers_test.go | |
| parent | e0e0dc11195c0e0516b45975de51df1dc98f83de (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'internal/handlers/handlers_test.go')
| -rw-r--r-- | internal/handlers/handlers_test.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/handlers/handlers_test.go b/internal/handlers/handlers_test.go index 3367ef6..96cb911 100644 --- a/internal/handlers/handlers_test.go +++ b/internal/handlers/handlers_test.go @@ -64,11 +64,16 @@ func setupTestDB(t *testing.T) (*store.Store, func()) { func loadTestTemplates(t *testing.T) *template.Template { t.Helper() + // Template functions (must match handlers.go) + funcMap := template.FuncMap{ + "subtract": func(a, b int) int { return a - b }, + } + // Get path relative to project root - tmpl, err := template.ParseGlob(filepath.Join("web", "templates", "*.html")) + tmpl, err := template.New("").Funcs(funcMap).ParseGlob(filepath.Join("web", "templates", "*.html")) if err != nil { // Try from internal/handlers (2 levels up) - tmpl, err = template.ParseGlob(filepath.Join("..", "..", "web", "templates", "*.html")) + tmpl, err = template.New("").Funcs(funcMap).ParseGlob(filepath.Join("..", "..", "web", "templates", "*.html")) if err != nil { t.Logf("Warning: failed to parse templates: %v", err) return nil |
