diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-31 21:23:56 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-31 21:23:56 -1000 |
| commit | f9127d5272042f4980ece8b39a47613f95eeaf8e (patch) | |
| tree | e111cc6f85b0cd23dd7e705b0390d1154fbc13ee /internal/handlers/response.go | |
| parent | cbb0b53de1d06918c142171fd084f14f03798bc1 (diff) | |
Fix timeline calendar view and shopping UI bugs (#56, #65-73)
- #56: Add overflow-hidden to card/panel classes to prevent content overflow
- #65: Fix Google Tasks not showing by including tasks without due dates
- #66: Add no-cache headers to prevent stale template responses
- #67: Increase dropdown z-index to 100 for proper layering
- #69: Implement calendar-style Today section with hourly grid (6am-10pm),
duration-based event heights, and compact overdue/all-day section
- #70: Only reset shopping-mode form on successful submission
- #71: Remove checkboxes from shopping tab (only show in shopping mode)
- #72: Add inline add-item input at end of each store section
- #73: Add Grouped/Flat view toggle for shopping list
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/handlers/response.go')
| -rw-r--r-- | internal/handlers/response.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/handlers/response.go b/internal/handlers/response.go index 9a7ab45..34d4491 100644 --- a/internal/handlers/response.go +++ b/internal/handlers/response.go @@ -7,9 +7,17 @@ import ( "net/http" ) +// noCacheHeaders sets headers to prevent browser caching +func noCacheHeaders(w http.ResponseWriter) { + w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") + w.Header().Set("Pragma", "no-cache") + w.Header().Set("Expires", "0") +} + // JSONResponse writes data as JSON with appropriate headers func JSONResponse(w http.ResponseWriter, data interface{}) { w.Header().Set("Content-Type", "application/json") + noCacheHeaders(w) _ = json.NewEncoder(w).Encode(data) } @@ -23,6 +31,8 @@ func JSONError(w http.ResponseWriter, status int, msg string, err error) { // HTMLResponse renders an HTML template func HTMLResponse(w http.ResponseWriter, tmpl *template.Template, name string, data interface{}) { + w.Header().Set("Content-Type", "text/html; charset=utf-8") + noCacheHeaders(w) if err := tmpl.ExecuteTemplate(w, name, data); err != nil { http.Error(w, "Failed to render template", http.StatusInternalServerError) log.Printf("Error rendering template %s: %v", name, err) |
