diff --git a/src/lembas/web/templates/chat/_composer.html b/src/lembas/web/templates/chat/_composer.html index c535df8..71490b9 100644 --- a/src/lembas/web/templates/chat/_composer.html +++ b/src/lembas/web/templates/chat/_composer.html @@ -354,9 +354,19 @@ `agent_jobs` table, and the composer is rendered on every page load and after every reply. One request five seconds later costs nothing; a query on the render path costs it every time. #} + {# `hx-target="this"` is load-bearing and is the whole of a bug that + blanked every agent chat. htmx INHERITS `hx-target` from ancestors, + and this sits inside the composer's form, which carries + `hx-target="#thread"` so that a sent message appends a bubble. Without + a target of its own, this element's request resolved to `#thread` -- + and with `outerHTML` it replaced the entire transcript with the chip. + The reply rendered and then vanished, prompt and all. + + Anything in here that fetches must say where the answer goes. There + is a test. #} {% if jobs_enabled %}
+ hx-target="this" hx-swap="outerHTML"> {% endif %} {% endif %} diff --git a/src/lembas/web/templates/chat/_jobs_chip.html b/src/lembas/web/templates/chat/_jobs_chip.html index 1b48f65..cdecbec 100644 --- a/src/lembas/web/templates/chat/_jobs_chip.html +++ b/src/lembas/web/templates/chat/_jobs_chip.html @@ -10,10 +10,17 @@ Swapped `outerHTML` onto itself, so the reply is the whole element including the trigger. Every response has to be a complete chip for the same reason. + + `hx-target="this"`, explicitly, because this element lives inside the + composer's form and htmx INHERITS `hx-target` from ancestors -- that form + carries `hx-target="#thread"` so a sent message appends a bubble, and without + a target of its own this poll resolved there and replaced the whole transcript + with itself every five seconds. It blanked every agent chat. #}