From 1885f08012377bd41de7ed0aa09463d78e274ca3 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 22 Aug 2025 17:11:11 +0000 Subject: [PATCH] Complete graphical review and session manage for vers 1 --- frontend/src/App.css | 16 +++++++++- frontend/src/ChatHeader.jsx | 2 +- frontend/src/ChatLayout.jsx | 57 ++++++++++++++++++----------------- frontend/src/SessionTable.jsx | 27 +++++++++-------- frontend/src/UserMessage.jsx | 14 ++++++--- 5 files changed, 69 insertions(+), 47 deletions(-) diff --git a/frontend/src/App.css b/frontend/src/App.css index 0a287d3..fcb31c2 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -67,7 +67,21 @@ body.sessions-open .sessions-wrapper { box-shadow: 6px 0 20px rgba(0, 0, 0, 0.08); } -/* rest of your existing chat styles unchanged... */ +.offcanvas-left { + position: fixed; + top: 0; + left: -300px; /* panel width */ + width: 300px; + height: 100%; + background: var(--bs-body-bg, #fff); + box-shadow: 2px 0 5px rgba(0,0,0,0.3); + transition: left 0.3s ease; + z-index: 1050; +} + +.offcanvas-left.show { + left: 0; +} /* Chat styles */ diff --git a/frontend/src/ChatHeader.jsx b/frontend/src/ChatHeader.jsx index 3537950..2166512 100644 --- a/frontend/src/ChatHeader.jsx +++ b/frontend/src/ChatHeader.jsx @@ -54,7 +54,7 @@ export default function ChatHeader({ {/* Right column: theme toggle */} -
+
-
- setShowOffcanvas(false)} - /> +
+
diff --git a/frontend/src/SessionTable.jsx b/frontend/src/SessionTable.jsx index dbef407..4ce508d 100644 --- a/frontend/src/SessionTable.jsx +++ b/frontend/src/SessionTable.jsx @@ -60,10 +60,10 @@ export default function SessionTable({ userId, onSelectSession, onClosePanel }) - + + - - + @@ -77,6 +77,13 @@ export default function SessionTable({ userId, onSelectSession, onClosePanel }) key={s.session_id} className={s.session_id === activeSessionId ? "table-primary" : ""} > + - - - +
Session NameSession CreatedMessagesSize (bytes)# mess
+ + {editingSessionId === s.session_id ? ( {new Date(s.created_at).toLocaleString()}{s.message_count}{s.history_size_bytes} + + {s.message_count} + - diff --git a/frontend/src/UserMessage.jsx b/frontend/src/UserMessage.jsx index 9cca075..52a968e 100644 --- a/frontend/src/UserMessage.jsx +++ b/frontend/src/UserMessage.jsx @@ -3,18 +3,22 @@ import React from "react"; export default function UserMessage({ content, theme }) { return ( -
+ // This outer div aligns the *bubble* to the right +
 background
-            color: "inherit", // match bubble text color
+            backgroundColor: "transparent",
+            color: "inherit",
           }}
         >
           {content}