final set of updates for the upgrade

This commit is contained in:
2025-12-07 06:17:48 -06:00
parent 5c449e1036
commit 95f351c5aa
5 changed files with 90 additions and 67 deletions

BIN
llm-fe/public/favicon.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

View File

@@ -1,21 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Chat app by AI ML Operations, LLC"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.jpg" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Chat app by AI ML Operations, LLC" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
@@ -24,11 +22,12 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Chat by AI ML Operations. LCC</title>
</head>
<body>
<div id="root"></div>
<!--
<title>Chat by AI ML Operations. LCC</title>
</head>
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
@@ -38,5 +37,6 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</body>
</html>

View File

@@ -9,12 +9,12 @@ type ConversationCardProps = {
title: string,
conversation_id: number | undefined,
setSelectConversation: Dispatch<SetStateAction<number | undefined>>; // state function to set the selected conversation
deleteConversation: (conversation_id: number | undefined)=>void;
deleteConversation: (conversation_id: number | undefined) => void;
selectedConversation: number | undefined;
};
const ConversationCard = ({title, conversation_id, setSelectConversation, deleteConversation, selectedConversation}: ConversationCardProps): JSX.Element => {
const backgroundColor = selectedConversation===conversation_id ? '#ffffff' : 'lightgray';
const ConversationCard = ({ title, conversation_id, setSelectConversation, deleteConversation, selectedConversation }: ConversationCardProps): JSX.Element => {
const backgroundColor = selectedConversation === conversation_id ? '#ffffff' : 'lightgray';
return (
// <Row>
@@ -32,37 +32,37 @@ const ConversationCard = ({title, conversation_id, setSelectConversation, delete
<Col className="col-8">
<MDTypography
onClick={() => {setSelectConversation(conversation_id)}}
key={conversation_id}
color={'white'}
fontWeight={selectedConversation===conversation_id ? 'bold' : 'regular'}
display="block"
variant="caption"
textTransform="uppercase"
mt={2}
mb={1}
ml={1}
noWrap
>
{title}
</MDTypography>
<MDTypography
onClick={() => { setSelectConversation(conversation_id) }}
key={conversation_id}
color={'white'}
fontWeight={selectedConversation === conversation_id ? 'bold' : 'regular'}
display="block"
variant="caption"
textTransform="uppercase"
mt={2}
mb={1}
ml={1}
noWrap
>
{title}
</MDTypography>
</Col>
<Col className="col-4">
<IconButton
aria-label="delete ${conversation_id}"
onClick={() => deleteConversation(conversation_id)}
</Col>
<Col className="col-4">
<IconButton
aria-label="delete ${conversation_id}"
onClick={() => deleteConversation(conversation_id)}
>
<Delete sx={{color:backgroundColor}}/>
</IconButton>
</Col>
>
<Delete sx={{ color: backgroundColor }} />
</IconButton>
</Col>
</Row>
// <Card style={{width: "100%", margin:'0px'}}

View File

@@ -69,13 +69,15 @@ function WebSocketProvider({ children }) {
/* WS initialization and cleanup */
if (account) {
ws.current = new WebSocket(`ws://localhost:8011/ws/chat_again/`);
//ws.current = new WebSocket(`ws://localhost:8011/ws/conditional_chat/`);
//ws.current = new WebSocket('wss://chatbackend.aimloperations.com/ws/chat_again/')
//ws.current = new WebSocket('wss://chatbackend.aimloperations.com/ws/conditional_chat/')
//ws.current = process.env.REACT_APP_BACKEND_WS_API_BASE_URL;
ws.current.onopen = () => {
setSocket(ws.current);
};
ws.current.onclose = () => {};
ws.current.onclose = () => { };
ws.current.onmessage = (message) => {
const data = message.data;
// lookup for an existing chat in which this message belongs

View File

@@ -2,7 +2,7 @@ import React, { useContext, useEffect, useRef, useState } from "react";
import styled, { ThemeContext } from "styled-components";
import { Formik, Form, Field, ErrorMessage } from "formik";
import * as Yup from "yup";
import { AttachFile, Send } from "@mui/icons-material"; // Keeping icons for now, can replace later if needed
import { AttachFile, Delete, Send } from "@mui/icons-material"; // Keeping icons for now, can replace later if needed
import Markdown from "markdown-to-jsx";
import {
@@ -155,10 +155,10 @@ const ConversationItem = styled.div<{ $active: boolean }>`
background: ${(props) => (props.$active ? props.theme.main + "33" : "transparent")};
color: ${(props) => (props.$active ? props.theme.colors.text : props.theme.darkMode ? "rgba(255, 255, 255, 0.7)" : "rgba(0, 0, 0, 0.7)")};
transition: all 0.2s ease;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
border: 1px solid ${(props) => (props.$active ? props.theme.main + "66" : "transparent")};
display: flex;
justify-content: space-between;
align-items: center;
&:hover {
background: ${({ theme }) => theme.darkMode ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)'};
@@ -166,6 +166,15 @@ const ConversationItem = styled.div<{ $active: boolean }>`
}
`;
const ConversationTitle = styled.span`
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 1;
min-width: 0;
margin-right: 8px;
`;
const NewChatButton = styled.button`
width: 100%;
padding: 0.8rem;
@@ -221,7 +230,7 @@ const AsyncDashboardInner = ({ }): JSX.Element => {
useContext(WebSocketContext);
const { account } = useContext(AccountContext);
const { conversations, selectedConversation, setSelectedConversation } =
const { conversations, selectedConversation, setSelectedConversation, deleteConversation } =
useContext(ConversationContext);
const {
@@ -284,7 +293,19 @@ const AsyncDashboardInner = ({ }): JSX.Element => {
$active={convo.id === selectedConversation}
onClick={() => setSelectedConversation(convo.id)}
>
{convo.title || "New Conversation"}
<ConversationTitle>{convo.title || "New Conversation"}</ConversationTitle>
{convo.id === selectedConversation && (
<IconButton
as="div"
onClick={(e) => {
e.stopPropagation();
deleteConversation(convo.id);
}}
style={{ padding: 4, width: 'auto', height: 'auto' }}
>
<Delete fontSize="small" />
</IconButton>
)}
</ConversationItem>
))}
</div>
@@ -345,7 +366,7 @@ const AsyncDashboardInner = ({ }): JSX.Element => {
<VisuallyHiddenInput
id="file-upload"
type="file"
accept=".csv,.xlsx,.txt"
accept=".csv,.xlsx,.txt,.pdf,.PDF"
onChange={(event) => {
const file = event.target.files?.[0];
if (file) {