UI: block messages while agent is replying, visualize status

This commit is contained in:
mudler
2024-04-06 16:16:09 +02:00
parent 84c56f6c3e
commit 215c3ddbf7
2 changed files with 13 additions and 5 deletions

View File

@@ -51,6 +51,7 @@
</div>
<!-- https://github.com/bigskysoftware/htmx/issues/1882#issuecomment-1783463192 -->
<div sse-swap="messages" hx-swap="beforeend" id="messages" hx-on:htmx:after-settle="document.getElementById('messages').scrollIntoView(false)"></div>
<div sse-swap="message_status" ></div>
</div>
@@ -65,7 +66,7 @@
<!-- Message Input -->
<div class="p-4 border-t border-gray-200">
<input name="message" type="text" hx-post="/chat" hx-target="#results" hx-indicator=".htmx-indicator"
<input id="inputMessage" name="message" type="text" hx-post="/chat" hx-target="#results" hx-indicator=".htmx-indicator"
class="p-2 border rounded w-full" placeholder="Type a message..." _="on htmx:afterRequest set my value to ''">
<div class="my-2 htmx-indicator" >Loading...</div>
<div id="results" class="flex justify-center"></div>