From c36e90f6b723402bd29654e4da2c38bd44778867 Mon Sep 17 00:00:00 2001 From: Evan Jarrett Date: Tue, 1 Sep 2026 11:03:54 -0500 Subject: [PATCH] hold/admin: swap out the deleted crew row instead of sending 204 The delete handler returned 204 No Content for htmx requests, on the theory that an empty body plus hx-swap="outerHTML" would make the row disappear. htmx's default responseHandling maps 204 to swap:false, so it never swapped at all: the record was gone from the PDS but the row stayed on screen until a manual refresh. Return an empty 200, which htmx does swap. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Ai43R3s33cBGMybGp2gUcG --- pkg/hold/admin/handlers_crew.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/hold/admin/handlers_crew.go b/pkg/hold/admin/handlers_crew.go index d64bb50..0f872c7 100644 --- a/pkg/hold/admin/handlers_crew.go +++ b/pkg/hold/admin/handlers_crew.go @@ -614,12 +614,13 @@ func (ui *AdminUI) handleCrewDelete(w http.ResponseWriter, r *http.Request) { slog.Info("Crew member removed via admin panel", "did", member.Member, "by", session.DID) - // For HTMX requests, return 204 No Content. The row uses + // For HTMX requests, return an empty 200. The row uses // hx-swap="outerHTML" so htmx replaces it with the empty response body - // and the row disappears. Explicit 204 is the stable idiom (plain 200 - // with empty body works today but is implementation-defined). + // and the row disappears. Not 204: htmx's default responseHandling maps + // 204 to swap:false, so the deleted row would stay on screen until a + // manual refresh. if r.Header.Get("HX-Request") == "true" { - w.WriteHeader(http.StatusNoContent) + w.WriteHeader(http.StatusOK) return }