From 79b1fef5b6d7895b264c6370a0fb87d437735fbe Mon Sep 17 00:00:00 2001 From: Josako Date: Tue, 16 Sep 2025 11:14:09 +0200 Subject: [PATCH] - TRA-77 - Scroll behaviour in the Message History adapted to support both scrolling by the end user, and ensuring the last message is shown when new messages are added, or resizing is done. --- .../static/assets/css/chat-components.css | 50 ----- eveai_chat_client/static/assets/css/chat.css | 9 - .../static/assets/vue-components/ChatApp.vue | 20 ++ .../assets/vue-components/MessageHistory.vue | 205 ++++++++++++------ .../assets/css/eveai-chat-style.css | 25 ++- 5 files changed, 168 insertions(+), 141 deletions(-) diff --git a/eveai_chat_client/static/assets/css/chat-components.css b/eveai_chat_client/static/assets/css/chat-components.css index db868c8..96ed506 100644 --- a/eveai_chat_client/static/assets/css/chat-components.css +++ b/eveai_chat_client/static/assets/css/chat-components.css @@ -1,45 +1,3 @@ - -/* Chat App Container Layout */ -.chat-app-container { - display: flex; - flex-direction: column; - height: 100%; - width: 100%; - min-height: 0; /* Belangrijk voor flexbox overflow */ - padding: 20px; /* Algemene padding voor alle kanten */ - box-sizing: border-box; -} - -/* Gemeenschappelijke container voor consistente breedte */ -.chat-component-container { - width: 100%; - max-width: 1000px; /* Optimale breedte */ - margin-left: auto; - margin-right: auto; - display: flex; - flex-direction: column; - flex: 1; /* Neemt beschikbare verticale ruimte in */ -} - -/* Message Area - neemt alle beschikbare ruimte */ -.chat-messages-area { - flex: 1; /* Neemt alle beschikbare ruimte */ - overflow: hidden; /* Voorkomt dat het groter wordt dan container */ - display: flex; - flex-direction: column; - min-height: 0; /* Belangrijk voor nested flexbox */ - margin-bottom: 20px; /* Ruimte tussen messages en input */ - border-radius: 15px; - background: var(--history-background); - backdrop-filter: blur(10px); - box-shadow: 0 4px 20px rgba(0,0,0,0.1); - width: 100%; - max-width: 1000px; /* Optimale breedte */ - margin-left: auto; - margin-right: auto; /* Horizontaal centreren */ - align-self: center; /* Extra centrering in flexbox context */ -} - /* Chat Input - altijd onderaan */ .chat-input-area { flex: none; /* Neemt alleen benodigde ruimte */ @@ -56,14 +14,6 @@ align-self: center; /* Extra centrering in flexbox context */ } -.chat-messages { - flex: 1; - overflow-y: auto; - padding-right: 10px; /* Ruimte voor scrollbar */ - margin-right: -10px; /* Compenseer voor scrollbar */ - scroll-behavior: smooth; -} - /* Chat Input styling */ .chat-input { diff --git a/eveai_chat_client/static/assets/css/chat.css b/eveai_chat_client/static/assets/css/chat.css index 5d78776..9449b6d 100644 --- a/eveai_chat_client/static/assets/css/chat.css +++ b/eveai_chat_client/static/assets/css/chat.css @@ -99,15 +99,6 @@ body { width: 100%; } -/* Chat layout */ -.chat-container { - display: flex; - height: 100%; - flex: 1; - flex-direction: column; - min-height: 0; -} - .sidebar { width: 280px; background-color: var(--sidebar-background); diff --git a/eveai_chat_client/static/assets/vue-components/ChatApp.vue b/eveai_chat_client/static/assets/vue-components/ChatApp.vue index b41cc5f..7dc6619 100644 --- a/eveai_chat_client/static/assets/vue-components/ChatApp.vue +++ b/eveai_chat_client/static/assets/vue-components/ChatApp.vue @@ -549,20 +549,40 @@ export default {