Replace env free-variable threading with IO-primitive auto-fetch macros
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m38s

Layout components now self-resolve context (cart-mini, auth-menu, nav-tree,
rights, URLs) via new IO primitives (root-header-ctx, select-colours,
account-nav-ctx, app-rights) and defmacro wrappers (~root-header-auto,
~auth-header-row-auto, ~root-mobile-auto). This eliminates _ctx_to_env(),
HELPER_CSS_CLASSES, and verbose :key threading across all 10 services.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 18:20:57 +00:00
parent 8be00df6d9
commit 7fda7a8027
41 changed files with 551 additions and 523 deletions

View File

@@ -35,8 +35,8 @@ async def render_browse_page(ctx: dict) -> str:
cards = await _product_cards_sx(ctx)
content = await _product_grid(cards)
from shared.sx.helpers import render_to_sx_with_env, _ctx_to_env
hdr = await render_to_sx_with_env("market-browse-layout-full", _ctx_to_env(ctx),
from shared.sx.helpers import render_to_sx_with_env
hdr = await render_to_sx_with_env("market-browse-layout-full", {},
post_header=SxExpr(await _post_header_sx(ctx)),
market_header=SxExpr(await _market_header_sx(ctx)))
menu = await _mobile_nav_panel_sx(ctx)
@@ -81,8 +81,8 @@ async def render_product_page(ctx: dict, d: dict) -> str:
content = await _product_detail_sx(d, ctx)
meta = await _product_meta_sx(d, ctx)
from shared.sx.helpers import render_to_sx_with_env, _ctx_to_env
hdr = await render_to_sx_with_env("market-product-layout-full", _ctx_to_env(ctx),
from shared.sx.helpers import render_to_sx_with_env
hdr = await render_to_sx_with_env("market-product-layout-full", {},
post_header=SxExpr(await _post_header_sx(ctx)),
market_header=SxExpr(await _market_header_sx(ctx)),
product_header=SxExpr(await _product_header_sx(ctx, d)))
@@ -112,8 +112,8 @@ async def render_product_admin_page(ctx: dict, d: dict) -> str:
"""Full page: product admin."""
content = await _product_detail_sx(d, ctx)
from shared.sx.helpers import render_to_sx_with_env, _ctx_to_env
hdr = await render_to_sx_with_env("market-product-admin-layout-full", _ctx_to_env(ctx),
from shared.sx.helpers import render_to_sx_with_env
hdr = await render_to_sx_with_env("market-product-admin-layout-full", {},
post_header=SxExpr(await _post_header_sx(ctx)),
market_header=SxExpr(await _market_header_sx(ctx)),
product_header=SxExpr(await _product_header_sx(ctx, d)),