Compare commits

..

9 Commits

Author SHA1 Message Date
18490df072 feat: gamer group chat 2025-05-02 17:51:51 +01:00
a3f445216d chore: add mod_wsgi, flask-cors packages 2025-05-02 17:51:51 +01:00
aea2b4d12e chore: use older version of python
necessary for my crusty old debian 11 vps
2025-05-02 17:51:51 +01:00
e27d4ff587 feat: win/loss conditions 2025-05-02 17:51:51 +01:00
edcc60b517 feat: split response and score generation 2025-05-02 17:51:51 +01:00
4831e5096c feat: conversation history 2025-05-02 17:51:51 +01:00
dcac2b6ba2 feat: update input style 2025-05-02 17:51:51 +01:00
34c5b35194 fix: improve panel behaviour at small screen sizes 2025-05-02 17:51:02 +01:00
a07c269f15 feat: scroll to new message 2025-05-02 17:18:02 +01:00
2 changed files with 15 additions and 8 deletions

18
main.js
View File

@ -24,6 +24,15 @@ class Conversation {
this.messages = initialMessages;
}
addMessage(message) {
this.messages.push(message);
this.render();
var elements = document.getElementById("messages").children;
var lastElement = elements[elements.length - 1];
lastElement.scrollIntoView();
}
// for the user to send their own messages
sendUserMessage(text) {
@ -76,7 +85,7 @@ class Conversation {
messageText = json.message;
//}
this.messages.push(new AgentMessage(messageText));
this.addMessage(new AgentMessage(messageText));
this.render();
setTimeout(() => {
if (score == 1) {
@ -95,12 +104,7 @@ class Conversation {
});
setTimeout(() => {
message.updateStatus("delivered");
this.render();
//setTimeout(() => {
// message.updateStatus("read");
// this.render();
//}, 5000);
this.addMessage(message);
}, 1000);
}

View File

@ -72,6 +72,9 @@ body {
max-width: 300px;
}
#main-panel {
width: calc(100% - 300px);
}
}
#side-panel .conversation {
@ -105,7 +108,7 @@ body {
display: flex;
flex-direction: column;
justify-content: flex-end;
width: calc(100% - 300px);
width: 100%;
}
#page {