Send test dashboard component definitions to client via sexp.js

Uses client_components_tag() to emit all component definitions as
<script type="text/sexp" data-components> before </body>, making them
available for client-side rendering by sexp.js.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 23:42:42 +00:00
parent 9f2f0dacaf
commit 269bcc02be

View File

@@ -4,7 +4,7 @@ from __future__ import annotations
import os
from datetime import datetime
from shared.sexp.jinja_bridge import render, load_service_components
from shared.sexp.jinja_bridge import render, load_service_components, client_components_tag
from shared.sexp.helpers import root_header_html, full_page
# Load test-specific .sexpr components at import time
@@ -196,7 +196,9 @@ async def render_dashboard_page(ctx: dict, result: dict | None,
hdr = _header_stack_html(ctx, active_service)
inner = _results_partial_html(result, running, csrf, active_filter, active_service)
content = _wrap_results_div(inner, running)
return full_page(ctx, header_rows_html=hdr, content_html=content)
body_end = client_components_tag()
return full_page(ctx, header_rows_html=hdr, content_html=content,
body_end_html=body_end)
async def render_results_partial(result: dict | None, running: bool,