spora 0.2.35 → 0.2.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web-chat/chat.html +8 -5
- package/package.json +1 -1
package/dist/web-chat/chat.html
CHANGED
|
@@ -672,6 +672,7 @@
|
|
|
672
672
|
const chatContainer = document.getElementById('chatContainer');
|
|
673
673
|
const messageInput = document.getElementById('messageInput');
|
|
674
674
|
const sendButton = document.getElementById('sendButton');
|
|
675
|
+
const sleepIndicator = document.getElementById('sleepIndicator');
|
|
675
676
|
|
|
676
677
|
let isLoading = false;
|
|
677
678
|
let agentName = 'Your Spore';
|
|
@@ -746,8 +747,10 @@
|
|
|
746
747
|
const response = await fetch('/api/messages');
|
|
747
748
|
const data = await response.json();
|
|
748
749
|
if (data.messages && data.messages.length > 0) {
|
|
749
|
-
// Clear welcome message if there are existing messages
|
|
750
|
-
chatContainer.
|
|
750
|
+
// Clear welcome message if there are existing messages (keep sleep indicator)
|
|
751
|
+
Array.from(chatContainer.children).forEach(child => {
|
|
752
|
+
if (child !== sleepIndicator) child.remove();
|
|
753
|
+
});
|
|
751
754
|
data.messages.forEach(msg => {
|
|
752
755
|
addMessage(msg.role, msg.content, false);
|
|
753
756
|
});
|
|
@@ -913,7 +916,8 @@
|
|
|
913
916
|
|
|
914
917
|
messageDiv.appendChild(contentDiv);
|
|
915
918
|
|
|
916
|
-
|
|
919
|
+
// Insert before sleep indicator so it always stays at the bottom
|
|
920
|
+
chatContainer.insertBefore(messageDiv, sleepIndicator);
|
|
917
921
|
chatContainer.scrollTop = chatContainer.scrollHeight;
|
|
918
922
|
}
|
|
919
923
|
|
|
@@ -947,7 +951,7 @@
|
|
|
947
951
|
loadingDiv.appendChild(avatar);
|
|
948
952
|
loadingDiv.appendChild(loadingContent);
|
|
949
953
|
|
|
950
|
-
chatContainer.
|
|
954
|
+
chatContainer.insertBefore(loadingDiv, sleepIndicator);
|
|
951
955
|
chatContainer.scrollTop = chatContainer.scrollHeight;
|
|
952
956
|
}
|
|
953
957
|
|
|
@@ -1079,7 +1083,6 @@
|
|
|
1079
1083
|
});
|
|
1080
1084
|
|
|
1081
1085
|
// --- Sleep indicator with countdown ---
|
|
1082
|
-
const sleepIndicator = document.getElementById('sleepIndicator');
|
|
1083
1086
|
const sleepCountdown = document.getElementById('sleepCountdown');
|
|
1084
1087
|
const statusDot = document.querySelector('.status-dot');
|
|
1085
1088
|
const statusLabel = document.querySelector('.status-label');
|