diff --git a/test/bp/dashboard/routes.py b/test/bp/dashboard/routes.py index aab19b5..fbd2af7 100644 --- a/test/bp/dashboard/routes.py +++ b/test/bp/dashboard/routes.py @@ -26,12 +26,15 @@ def register(url_prefix: str = "/") -> Blueprint: if is_sx: from shared.sx.helpers import sx_response - html = await render_results_partial_sx( + inner = await render_results_partial_sx( result, running, csrf, active_filter=active_filter, active_service=active_service, ) - return sx_response(html) + # Wrap in #main-panel so sx-select="#main-panel" works + sx = (f'(section :id "main-panel" :class "flex-1 md:h-full md:min-h-0' + f' overflow-y-auto overscroll-contain js-grid-viewport" {inner})') + return sx_response(sx) from shared.sx.page import get_template_context ctx = await get_template_context() diff --git a/test/sx/dashboard.sx b/test/sx/dashboard.sx index 6a02fc3..6b8aa8b 100644 --- a/test/sx/dashboard.sx +++ b/test/sx/dashboard.sx @@ -20,7 +20,8 @@ (defcomp ~test-filter-card (&key href label count colour-border colour-bg colour-text active) (a :href href :sx-get href - :sx-target "#test-results" + :sx-target "#main-panel" + :sx-select "#main-panel" :sx-swap "outerHTML" :sx-push-url "true" :class (str "block rounded border p-3 text-center transition-colors no-underline hover:opacity-80 " @@ -125,7 +126,8 @@ (a :href "/" :sx-get "/" :sx-target "#main-panel" - :sx-swap "innerHTML" + :sx-select "#main-panel" + :sx-swap "outerHTML" :sx-push-url "true" :class "text-sky-600 hover:text-sky-800 text-sm" "← Back to results")