From 7e650a0ee3a61d56525cc9e298ed0c4194e780a4 Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 24 Feb 2026 11:34:45 +0000 Subject: [PATCH] Add nav-tree, auth-menu, cart-mini fragment slots to shared header The shared _header.html template now checks for pre-fetched fragment HTML (nav_tree_html, auth_menu_html, cart_mini_html) before falling back to local includes. This lets consumer apps render cross-app UI via the fragment composition system. Co-Authored-By: Claude Opus 4.6 --- .../templates/_types/root/header/_header.html | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/browser/templates/_types/root/header/_header.html b/browser/templates/_types/root/header/_header.html index fc4591b..0564756 100644 --- a/browser/templates/_types/root/header/_header.html +++ b/browser/templates/_types/root/header/_header.html @@ -9,8 +9,12 @@ {% call links.menu_row(id='root-row', oob=oob) %}
{# Cart mini #} - {% from '_types/cart/_mini.html' import mini with context %} - {{mini()}} + {% if cart_mini_html %} + {{ cart_mini_html | safe }} + {% else %} + {% from '_types/cart/_mini.html' import mini with context %} + {{mini()}} + {% endif %} {# Site title #}
@@ -20,11 +24,19 @@ {# Desktop nav #} @@ -33,10 +45,14 @@ {% endcall %} {# Mobile user info #}
- {% if g.user %} - {% include '_types/root/mobile/_full_user.html' %} + {% if auth_menu_html %} + {{ auth_menu_html | safe }} {% else %} - {% include '_types/root/mobile/_sign_in.html' %} + {% if g.user %} + {% include '_types/root/mobile/_full_user.html' %} + {% else %} + {% include '_types/root/mobile/_sign_in.html' %} + {% endif %} {% endif %}
{% endmacro %} \ No newline at end of file