From f9127d5272042f4980ece8b39a47613f95eeaf8e Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sat, 31 Jan 2026 21:23:56 -1000 Subject: 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 --- internal/handlers/handlers.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'internal/handlers/handlers.go') diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index 0e5edcc..bba12ad 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -1230,7 +1230,11 @@ func mealTypeOrder(mealType string) int { func (h *Handler) HandleTabShopping(w http.ResponseWriter, r *http.Request) { ctx := r.Context() stores := h.aggregateShoppingLists(ctx) - HTMLResponse(w, h.templates, "shopping-tab", struct{ Stores []models.ShoppingStore }{stores}) + grouped := r.URL.Query().Get("grouped") != "false" // Default to grouped + HTMLResponse(w, h.templates, "shopping-tab", struct { + Stores []models.ShoppingStore + Grouped bool + }{stores, grouped}) } // HandleShoppingQuickAdd adds a user shopping item @@ -1285,7 +1289,10 @@ func (h *Handler) HandleShoppingQuickAdd(w http.ResponseWriter, r *http.Request) } // Return refreshed shopping tab - HTMLResponse(w, h.templates, "shopping-tab", struct{ Stores []models.ShoppingStore }{allStores}) + HTMLResponse(w, h.templates, "shopping-tab", struct { + Stores []models.ShoppingStore + Grouped bool + }{allStores, true}) } // HandleShoppingToggle toggles a shopping item's checked state @@ -1323,7 +1330,10 @@ func (h *Handler) HandleShoppingToggle(w http.ResponseWriter, r *http.Request) { // Return refreshed shopping tab stores := h.aggregateShoppingLists(r.Context()) - HTMLResponse(w, h.templates, "shopping-tab", struct{ Stores []models.ShoppingStore }{stores}) + HTMLResponse(w, h.templates, "shopping-tab", struct { + Stores []models.ShoppingStore + Grouped bool + }{stores, true}) } // HandleShoppingMode renders the focused shopping mode for a single store -- cgit v1.2.3