diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-23 21:42:51 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-23 21:42:51 -1000 |
| commit | b69d2d5fc8779f43b1ac789605318488efc91361 (patch) | |
| tree | 52d457555ac5ca9382958c80b8174ca1d46b1e9a /internal/handlers/handlers.go | |
| parent | 465093343ddd398ce5f6377fc9c472d8251c618b (diff) | |
Fix uncomplete: add HX-Reswap header to prevent empty swap
The uncomplete response was returning an empty body, causing HTMX to
swap the element with nothing before the refresh-tasks trigger fired.
Added HX-Reswap: none header to preserve the element while the refresh
event propagates.
Also fixed TestGetCardsByDateRange test data to include all required
columns (list_id, list_name, url).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/handlers/handlers.go')
| -rw-r--r-- | internal/handlers/handlers.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index 126eef1..a2d1f0b 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -661,6 +661,8 @@ func (h *Handler) handleAtomToggle(w http.ResponseWriter, r *http.Request, compl case "trello": h.store.InvalidateCache(store.CacheKeyTrelloBoards) } + // Don't swap empty response - just trigger refresh + w.Header().Set("HX-Reswap", "none") w.Header().Set("HX-Trigger", "refresh-tasks") w.WriteHeader(http.StatusOK) } |
