From 2016f0b72727cb65f6c5604e3ad20afd672dc954 Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 24 Feb 2026 11:39:39 +0000 Subject: [PATCH] Fetch nav-tree fragment from blog, drop local menu_items query Navigation is now rendered by blog as an HTML fragment. This app fetches it with its own app_name and path for correct highlighting. Co-Authored-By: Claude Opus 4.6 --- app.py | 9 ++++++--- shared | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 66db1cf..cdc90ec 100644 --- a/app.py +++ b/app.py @@ -2,7 +2,7 @@ from __future__ import annotations import path_setup # noqa: F401 # adds shared/ to sys.path from pathlib import Path -from quart import g +from quart import g, request from jinja2 import FileSystemLoader, ChoiceLoader from shared.infrastructure.factory import create_base_app @@ -18,12 +18,15 @@ from bp import ( async def federation_context() -> dict: """Federation app context processor.""" from shared.infrastructure.context import base_context - from shared.services.navigation import get_navigation_tree from shared.infrastructure.cart_identity import current_cart_identity + from shared.infrastructure.fragments import fetch_fragment ctx = await base_context() - ctx["menu_items"] = await get_navigation_tree(g.s) + ctx["nav_tree_html"] = await fetch_fragment( + "blog", "nav-tree", + params={"app_name": "federation", "path": request.path}, + ) # Cart data (consistent with all other apps) ident = current_cart_identity() diff --git a/shared b/shared index 0d40dfa..7e650a0 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit 0d40dfaeca7dbdc8adeaf7b071bfd9faccb74511 +Subproject commit 7e650a0ee3a61d56525cc9e298ed0c4194e780a4