wip: sse implementation chat

This commit is contained in:
Per Stark
2025-02-24 12:23:58 +01:00
parent e43b63de9f
commit c41e370b81
16 changed files with 361 additions and 63 deletions

View File

@@ -16,4 +16,24 @@
</div>
{% endif %}
{% endfor %}
</div>
</div>
<script>
// Scroll to latest message after HTMX swap
document.body.addEventListener('htmx:afterSwap', function (evt) {
const chatContainer = document.getElementById('chat_container');
if (chatContainer) {
chatContainer.scrollTop = chatContainer.scrollHeight;
}
});
</script>
<style>
#chat_container {
max-height: 70vh;
/* Adjust as needed */
overflow-y: auto;
/* Enable scrolling */
padding: 1rem;
}
</style>