This commit is contained in:
mark committed 2026-09-07 08:22:43 -04:00
1 parent ba3b588ac5
commit d74385ca3c
2 files changed
+80 -24

No files matched your search

+17 -7
View File
@@ -20,7 +20,7 @@
declares .d-flex after Reboot's [hidden] rule, both !important and at the
same specificity, so the utility would win.
Two things bring it back into step with the page, because the navbar is
Three things bring it back into step with the page, because the navbar is
never the swap target -- every boosted link lands in #content:
a navigation sw.js appends this template to the fragment with oob set,
@@ -28,18 +28,28 @@
line, so one response moves both.
a restore htmx swaps the history element straight in and processes
no out-of-band elements at all, so the picker asks for
itself instead. worker-ready is in the same trigger for
the empty state below.
itself instead. worker-ready is in the same trigger, for a
page boot.html composed before there was a worker to ask.
an anchor a link to GEN#v3_16 should open with the picker reading
3:16, and the fragment never reaches the worker: a browser
asks for /GEN and keeps the rest. So a picker that arrived
with the page asks once, on load, if there is an anchor to
ask about.
Neither carries the book: the request does, in HX-Current-URL, which is the
address the page is actually showing. An address baked into this attribute
None of them carries the book or the anchor. The request does, in
HX-Current-URL, which htmx sets from location.href -- the address the page
is actually showing, fragment and all. Baking either into these attributes
is the one thing here that can go stale, because the picker outlives the
page it was rendered for. #}
page it was rendered for.
settled is what stops the load trigger looping: the answer to it is a
picker already standing in the right place, and it says so by leaving the
trigger out of the copy it sends back. #}
<div class="reference navbar-text {% if reference %}d-flex{% else %}d-none{% endif %} align-items-center gap-1 ms-3"
id="reference"
{%- if oob %} hx-swap-oob="true"{% endif %}
hx-get="api/reference"
hx-trigger="worker-ready from:body, htmx:historyRestore from:body"
hx-trigger="{% if reference and not settled %}load[location.hash], {% endif %}worker-ready from:body, htmx:historyRestore from:body"
hx-target="this" hx-swap="outerHTML">
{%- if reference %}
<span class="reference-book text-light fw-semibold"