Wrap index SX response in #main-panel section
All nav links use sx-select="#main-panel" to extract content from responses. The index partial must include this wrapper so the select finds it, matching the pattern used by test-detail-section. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user