Nested component calls in _aser are serialized without body expansion, so free variables inside ~root-header would be sent unresolved to the client. Fix by making ~root-header/~root-mobile take all values as &key params, and having parent layout defcomps pass them explicitly. The parent layout bodies ARE expanded (via async_eval_slot_to_sx), so their free variables resolve correctly during that expansion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
1.1 KiB
Plaintext
23 lines
1.1 KiB
Plaintext
;; Federation layout defcomps — read ctx values from env free variables.
|
|
;; `actor` is injected into env by the layout registration in __init__.py.
|
|
|
|
;; Full page: root header + social header in header-child
|
|
(defcomp ~social-layout-full ()
|
|
(<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
|
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
|
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
|
|
(~header-child-sx
|
|
:inner (~federation-social-header
|
|
:nav (~federation-social-nav :actor actor)))))
|
|
|
|
;; OOB (HTMX): social header oob + root header oob
|
|
(defcomp ~social-layout-oob ()
|
|
(<> (~oob-header-sx
|
|
:parent-id "root-header-child"
|
|
:row (~federation-social-header
|
|
:nav (~federation-social-nav :actor actor)))
|
|
(~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
|
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
|
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin
|
|
:oob true)))
|