From 7663a917dabda969cf69e6e4408d7bebce3843aa Mon Sep 17 00:00:00 2001 From: Zacharias-Brohn Date: Wed, 14 Jan 2026 22:08:19 +0100 Subject: [PATCH] changes --- components/Chat/ChatLayout.tsx | 242 ++++++++++++++++----------------- 1 file changed, 119 insertions(+), 123 deletions(-) diff --git a/components/Chat/ChatLayout.tsx b/components/Chat/ChatLayout.tsx index 96262ba..f83d225 100644 --- a/components/Chat/ChatLayout.tsx +++ b/components/Chat/ChatLayout.tsx @@ -22,6 +22,7 @@ import { Container, Group, Menu, + NavLink, Paper, ScrollArea, Select, @@ -31,7 +32,6 @@ import { TextInputProps, Title, Tooltip, - UnstyledButton, useMantineTheme, } from '@mantine/core'; import { useDisclosure } from '@mantine/hooks'; @@ -619,106 +619,102 @@ export default function ChatLayout() { - + {chats.length > 0 ? ( - chats.map((chat) => ( - - {editingChatId === chat.id ? ( - // Inline editing mode - - {chat.pinned ? ( - - ) : ( - - )} - setEditingTitle(e.currentTarget.value)} - onBlur={saveRenamedChat} - onKeyDown={handleRenameKeyDown} - size="xs" - variant="unstyled" - styles={{ - input: { - padding: 0, - height: 'auto', - minHeight: 'unset', - fontSize: 'var(--mantine-font-size-sm)', - }, - }} - style={{ flex: 1 }} - /> - - ) : ( - // Normal display mode - handleSelectChat(chat)} - p="sm" - style={{ flex: 1, minWidth: 0 }} - > - - {chat.pinned ? ( - + chats.map((chat) => + editingChatId === chat.id ? ( + // Inline editing mode + + {chat.pinned ? ( + + ) : ( + + )} + setEditingTitle(e.currentTarget.value)} + onBlur={saveRenamedChat} + onKeyDown={handleRenameKeyDown} + size="xs" + style={{ flex: 1 }} + /> + + ) : ( + // Normal display mode with NavLink + + ) : ( - - )} - - {chat.title} - - - - )} - - - - e.stopPropagation()} - > - - - - - } - onClick={() => handleRenameChat(chat.id)} - > - Rename - - } - onClick={() => handlePinChat(chat.id)} - > - {chat.pinned ? 'Unpin' : 'Pin'} - - - } - onClick={() => handleRemoveChat(chat.id)} - > - Remove - - - - - )) + + ) + } + onClick={() => handleSelectChat(chat)} + noWrap + styles={{ + root: { + flex: 1, + minWidth: 0, + borderRadius: 'var(--mantine-radius-sm)', + padding: '6px 10px', + }, + label: { + overflow: 'hidden', + textOverflow: 'ellipsis', + }, + }} + /> + + + e.stopPropagation()} + > + + + + + } + onClick={() => handleRenameChat(chat.id)} + > + Rename + + } + onClick={() => handlePinChat(chat.id)} + > + {chat.pinned ? 'Unpin' : 'Pin'} + + + } + onClick={() => handleRemoveChat(chat.id)} + > + Remove + + + + + ) + ) ) : ( {isLoadingChats ? 'Loading...' : 'No saved chats'} @@ -744,49 +740,49 @@ export default function ChatLayout() { onScrollPositionChange={handleScroll} classNames={{ viewport: classes.chatScrollViewport }} > - + {messages.map((message) => ( {message.role === 'assistant' && ( - - + + )} - - {message.role === 'assistant' ? ( + {message.role === 'assistant' ? ( + // Assistant message - no bubble, just text aligned with avatar +
- ) : ( - +
+ ) : ( + // User message - colored bubble + + {message.content} - )} - +
+ )} {message.role === 'user' && ( - - + + )}