diff --git a/src/lembas/web/static/css/app.css b/src/lembas/web/static/css/app.css index 98580e7..ca59b6b 100644 --- a/src/lembas/web/static/css/app.css +++ b/src/lembas/web/static/css/app.css @@ -626,7 +626,9 @@ button, input, textarea, select { z-index: 40; box-shadow: var(--shadow-lg); } - .sidebar[data-collapsed="true"] { display: none; } + /* Hiding it is the `hidden` attribute, forced to win at the top of this + file. There used to be a `[data-collapsed="true"]` rule here that nothing + ever set. */ } /* --- Toasts ---------------------------------------------------------------- diff --git a/src/lembas/web/templates/chat/_thread.html b/src/lembas/web/templates/chat/_thread.html index f6fc28d..c3c1afa 100644 --- a/src/lembas/web/templates/chat/_thread.html +++ b/src/lembas/web/templates/chat/_thread.html @@ -1,7 +1,11 @@ {# The whole thread. Returned after a rewind, which changes an arbitrary number of messages at once -- replacing the lot is simpler and less error-prone than - working out which individual bubbles to remove. + working out which individual bubbles to remove. Also included by + chat/index.html, so the conversation is described in exactly one place. + + Deliberately has no root element: it is swapped with innerHTML into #thread, + and an outerHTML swap would take the container with it. #} {% for message in messages %} {% with body_html = bodies.get(message.id, "") %} diff --git a/src/lembas/web/templates/chat/index.html b/src/lembas/web/templates/chat/index.html index c4dc057..0b8809c 100644 --- a/src/lembas/web/templates/chat/index.html +++ b/src/lembas/web/templates/chat/index.html @@ -16,7 +16,7 @@
@@ -161,13 +161,10 @@ {% endif %} - {% for message in messages %} - {# Markdown was rendered server-side in pages.py, keyed by message - id, so this loop stays a lookup rather than a render. #} - {% with body_html = bodies.get(message.id, "") %} - {% include "chat/_message.html" %} - {% endwith %} - {% endfor %} + {# The same include the rewind response returns, so the conversation + is described in one place. Markdown was rendered server-side in + pages.py, keyed by message id. #} + {% include "chat/_thread.html" %}