fix(17): return TabloOverviewTabFragment on HX-Request for overview tab

TabloDetailHandler was always rendering the full page regardless of
HX-Request, causing HTMX to swap the entire layout (sidebar, header)
into #tab-content instead of just the overview fragment.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Arthur Belleville 2026-05-17 10:24:39 +02:00
parent d8e52f695b
commit bc3d8e6355
No known key found for this signature in database

View file

@ -218,6 +218,10 @@ func TabloDetailHandler(deps TablosDeps) http.HandlerFunc {
sidebarTablos = []sqlc.Tablo{}
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
if r.Header.Get("HX-Request") == "true" {
_ = templates.TabloOverviewTabFragment(tablo, csrf.Token(r)).Render(r.Context(), w)
return
}
_ = templates.TabloDetailPage(user, csrf.Token(r), "", sidebarTablos, tablo, tasks, nil, templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, templates.EventsCalendar{}, templates.DiscussionTabData{}, "overview").Render(r.Context(), w)
}
}