diff --git a/test/bp/dashboard/routes.py b/test/bp/dashboard/routes.py index 3257d2c..aab19b5 100644 --- a/test/bp/dashboard/routes.py +++ b/test/bp/dashboard/routes.py @@ -89,6 +89,7 @@ def register(url_prefix: str = "/") -> Blueprint: async def results(): """HTMX partial — poll target for results table.""" from shared.browser.app.csrf import generate_csrf_token + from shared.sx.helpers import sx_response from sxc.pages.renders import render_results_partial_sx import runner @@ -104,10 +105,9 @@ def register(url_prefix: str = "/") -> Blueprint: active_service=active_service, ) - resp = Response(html, status=200, content_type="text/html") - # If still running, tell HTMX to keep polling + headers = {} if running: - resp.headers["HX-Trigger-After-Swap"] = "test-still-running" - return resp + headers["HX-Trigger-After-Swap"] = "test-still-running" + return sx_response(html, headers=headers) return bp