From a8edc26a1d4061aece89ed7b5eec4aa163362751 Mon Sep 17 00:00:00 2001 From: giles Date: Sat, 28 Feb 2026 16:46:47 +0000 Subject: [PATCH] Add external flag to menu-row for cross-subdomain links Cross-subdomain hx-get breaks due to OAuth redirects. When external=true, menu-row renders a plain without HTMX attributes, allowing normal browser navigation. Applied to post header links on events and market services which link back to blog.rose-ash.com. Co-Authored-By: Claude Opus 4.6 --- events/sexp/sexp_components.py | 3 ++- market/sexp/sexp_components.py | 1 + shared/sexp/templates/layout.sexp | 12 ++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/events/sexp/sexp_components.py b/events/sexp/sexp_components.py index f8eb1d0..6e73a23 100644 --- a/events/sexp/sexp_components.py +++ b/events/sexp/sexp_components.py @@ -61,7 +61,8 @@ def _post_header_html(ctx: dict, *, oob: bool = False) -> str: return render("menu-row", id="post-row", level=1, link_href=link_href, link_label_html=label_html, - nav_html=nav_html, child_id="post-header-child", oob=oob) + nav_html=nav_html, child_id="post-header-child", oob=oob, + external=True) def _post_nav_html(ctx: dict) -> str: diff --git a/market/sexp/sexp_components.py b/market/sexp/sexp_components.py index 5eddb30..fcf6616 100644 --- a/market/sexp/sexp_components.py +++ b/market/sexp/sexp_components.py @@ -99,6 +99,7 @@ def _post_header_html(ctx: dict, *, oob: bool = False) -> str: id="post-row", level=1, link_href=link_href, link_label_html=label_html, nav_html=nav_html, child_id="post-header-child", oob=oob, + external=True, ) diff --git a/shared/sexp/templates/layout.sexp b/shared/sexp/templates/layout.sexp index fa3273a..3877a7f 100644 --- a/shared/sexp/templates/layout.sexp +++ b/shared/sexp/templates/layout.sexp @@ -120,7 +120,7 @@ (when auth-menu-html (raw! auth-menu-html))))) (defcomp ~menu-row (&key id level colour link-href link-label link-label-html icon - hx-select nav-html child-id child-html oob) + hx-select nav-html child-id child-html oob external) (let* ((c (or colour "sky")) (lv (or level 1)) (shade (str (- 500 (* lv 100))))) @@ -130,11 +130,11 @@ :class (str "flex flex-col items-center md:flex-row justify-center md:justify-between w-full p-1 bg-" c "-" shade) (div :class "relative nav-group" (a :href link-href - :hx-get link-href - :hx-target "#main-panel" - :hx-select (or hx-select "#main-panel") - :hx-swap "outerHTML" - :hx-push-url "true" + :hx-get (if external nil link-href) + :hx-target (if external nil "#main-panel") + :hx-select (if external nil (or hx-select "#main-panel")) + :hx-swap (if external nil "outerHTML") + :hx-push-url (if external nil "true") :class "w-full whitespace-normal flex items-center gap-2 font-bold text-2xl px-3 py-2" (when icon (i :class icon :aria-hidden "true")) (if link-label-html (raw! link-label-html)