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,14 +1,12 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <link rel="icon" href="%PUBLIC_URL%/favicon.jpg" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta <meta name="description" content="Chat app by AI ML Operations, LLC" />
name="description"
content="Chat app by AI ML Operations, LLC"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!-- <!--
manifest.json provides metadata used when your web app is installed on a manifest.json provides metadata used when your web app is installed on a
@@ -26,6 +24,7 @@
--> -->
<title>Chat by AI ML Operations. LCC</title> <title>Chat by AI ML Operations. LCC</title>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<!-- <!--
@@ -39,4 +38,5 @@
To create a production bundle, use `npm run build` or `yarn build`. To create a production bundle, use `npm run build` or `yarn build`.
--> -->
</body> </body>
</html> </html>

View File

@@ -69,7 +69,9 @@ function WebSocketProvider({ children }) {
/* WS initialization and cleanup */ /* WS initialization and cleanup */
if (account) { if (account) {
ws.current = new WebSocket(`ws://localhost:8011/ws/chat_again/`); 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/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 = process.env.REACT_APP_BACKEND_WS_API_BASE_URL;
ws.current.onopen = () => { ws.current.onopen = () => {

View File

@@ -2,7 +2,7 @@ import React, { useContext, useEffect, useRef, useState } from "react";
import styled, { ThemeContext } from "styled-components"; import styled, { ThemeContext } from "styled-components";
import { Formik, Form, Field, ErrorMessage } from "formik"; import { Formik, Form, Field, ErrorMessage } from "formik";
import * as Yup from "yup"; 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 Markdown from "markdown-to-jsx";
import { import {
@@ -155,10 +155,10 @@ const ConversationItem = styled.div<{ $active: boolean }>`
background: ${(props) => (props.$active ? props.theme.main + "33" : "transparent")}; 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)")}; 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; transition: all 0.2s ease;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
border: 1px solid ${(props) => (props.$active ? props.theme.main + "66" : "transparent")}; border: 1px solid ${(props) => (props.$active ? props.theme.main + "66" : "transparent")};
display: flex;
justify-content: space-between;
align-items: center;
&:hover { &:hover {
background: ${({ theme }) => theme.darkMode ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)'}; 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` const NewChatButton = styled.button`
width: 100%; width: 100%;
padding: 0.8rem; padding: 0.8rem;
@@ -221,7 +230,7 @@ const AsyncDashboardInner = ({ }): JSX.Element => {
useContext(WebSocketContext); useContext(WebSocketContext);
const { account } = useContext(AccountContext); const { account } = useContext(AccountContext);
const { conversations, selectedConversation, setSelectedConversation } = const { conversations, selectedConversation, setSelectedConversation, deleteConversation } =
useContext(ConversationContext); useContext(ConversationContext);
const { const {
@@ -284,7 +293,19 @@ const AsyncDashboardInner = ({ }): JSX.Element => {
$active={convo.id === selectedConversation} $active={convo.id === selectedConversation}
onClick={() => setSelectedConversation(convo.id)} 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> </ConversationItem>
))} ))}
</div> </div>
@@ -345,7 +366,7 @@ const AsyncDashboardInner = ({ }): JSX.Element => {
<VisuallyHiddenInput <VisuallyHiddenInput
id="file-upload" id="file-upload"
type="file" type="file"
accept=".csv,.xlsx,.txt" accept=".csv,.xlsx,.txt,.pdf,.PDF"
onChange={(event) => { onChange={(event) => {
const file = event.target.files?.[0]; const file = event.target.files?.[0];
if (file) { if (file) {