Pass all values as &key args to ~root-header/~root-mobile

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>
This commit is contained in:
2026-03-04 14:50:14 +00:00
parent e4bfd46c48
commit a30e7228d8
4 changed files with 55 additions and 18 deletions

View File

@@ -4,7 +4,9 @@
;; --- orders layout: root + auth + orders rows ---
(defcomp ~orders-layout-full (&key list-url)
(<> (~root-header)
(<> (~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 (<> (~auth-header-row :account-url account-url
:select-colours select-colours
@@ -19,15 +21,20 @@
(~oob-header-sx
:parent-id "auth-header-child"
:row (~orders-header-row :list-url (or list-url "/")))
(~root-header :oob true)))
(~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)))
(defcomp ~orders-layout-mobile ()
(~root-mobile))
(~root-mobile :nav-tree nav-tree :auth-menu auth-menu))
;; --- order-detail layout: root + auth + orders + order rows ---
(defcomp ~order-detail-layout-full (&key list-url detail-url)
(<> (~root-header)
(<> (~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)
(~order-detail-header-stack
:auth (~auth-header-row :account-url account-url
:select-colours select-colours
@@ -43,7 +50,10 @@
:row (~menu-row-sx :id "order-row" :level 3 :colour "sky"
:link-href (or detail-url "/") :link-label "Order"
:icon "fa fa-gbp" :oob true))
(~root-header :oob true)))
(~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)))
(defcomp ~order-detail-layout-mobile ()
(~root-mobile))
(~root-mobile :nav-tree nav-tree :auth-menu auth-menu))