From 5f8a18878dd9f48819f56fd3594d6520953bd465 Mon Sep 17 00:00:00 2001 From: YasinOnm08 Date: Wed, 2 Oct 2024 14:05:06 +0200 Subject: [PATCH 1/4] settings button visual fix --- app/styles/header.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/styles/header.css b/app/styles/header.css index af4c1c0..9f30d31 100644 --- a/app/styles/header.css +++ b/app/styles/header.css @@ -84,9 +84,9 @@ header{ .header-login-button{ height: 100%; - width:4vw; + width:max-content; font-size: var(--font-size); - padding: 3px; + padding: 0.5vw 1vw; background-color: var(--input-button-color); color: var(--text-color); border: none; From 9373fa8e593e8763fa15a116c837cc4b3922faff Mon Sep 17 00:00:00 2001 From: YasinOnm08 Date: Thu, 3 Oct 2024 13:32:27 +0200 Subject: [PATCH 2/4] lol --- app/backend/ChatHistory.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/backend/ChatHistory.ts b/app/backend/ChatHistory.ts index 62c9a50..8d768ed 100644 --- a/app/backend/ChatHistory.ts +++ b/app/backend/ChatHistory.ts @@ -6,7 +6,7 @@ type ChatMessage = { let chatHistory: ChatMessage[] = []; -function addMessageHistory(name: string, message: any): void { +function addMessageToHistory(name: string, message: any): void { const newMessage: ChatMessage = { name: name, messages: message, @@ -16,7 +16,7 @@ function addMessageHistory(name: string, message: any): void { console.log(`Added message from ${name}: ${message}`); } -function removeMessageHistory(timestamp: number): void { +function removeMessageFromHistory(timestamp: number): void { const index = chatHistory.findIndex((msg) => msg.timestamp === timestamp); if (index > -1) { chatHistory.splice(index, 1); From ce4dac8227940bd62e9c60e8518a9ec5841313c6 Mon Sep 17 00:00:00 2001 From: Patrick_Pluto Date: Thu, 3 Oct 2024 13:33:07 +0200 Subject: [PATCH 3/4] HelloWorld --- app/components/Models.tsx | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/app/components/Models.tsx b/app/components/Models.tsx index 24ba852..7c22ab7 100644 --- a/app/components/Models.tsx +++ b/app/components/Models.tsx @@ -154,15 +154,15 @@ const modelDropdown = { }; const selectedAIFunction = [ - 'Code', - 'Math', - 'Language', - 'Character', - 'Finance', - 'Weather', - 'Time', - 'Image', - 'Custom1', + 'Code', + 'Math', + 'Language', + 'Character', + 'Finance', + 'Weather', + 'Time', + 'Image', + 'Custom1', 'Custom2' ] @@ -172,25 +172,29 @@ const ModelSection: React.FC = () => { const [radioSelection, setRadioSelection] = useState("") const [activeSelectedAIFunction, setActiveSelectedAIFunction] = useState(''); const [currentSelectedAIFunction, setCurrentSelectedAIFunction] = useState(""); - + useEffect(() => { var temp = localStorage.getItem("activeSelectedAIFunction") || "" setActiveSelectedAIFunction(temp) if (!localStorage.getItem('selectedModelDropdown')) { - localStorage.setItem("selectedModelDropdown", "Offline Fast" ) + localStorage.setItem("selectedModelDropdown", "Offline Fast") } if (!localStorage.getItem("activeSelectedAIFunction")) { setActiveSelectedAIFunction('Code') - localStorage.setItem('activeSelectedAIFunction' ,'Code') + localStorage.setItem('activeSelectedAIFunction', 'Code') } if (!localStorage.getItem("model")) { - localStorage.setItem("model" ,'starcoder2') + localStorage.setItem("model", 'starcoder2') } if (!localStorage.getItem("radioSelection")) { - localStorage.setItem("radioSelection" ,'None') + localStorage.setItem("radioSelection", 'None') + } + + if (!localStorage.getItem("type")) { + localStorage.setItem("type", 'local') } const handleStorageChange = () => { @@ -277,7 +281,7 @@ const ModelSection: React.FC = () => { modelDropdown.offlineNonFoss.includes(model) || modelDropdown.offlineFoss.includes(model); const modelClicked = (model: string) => { - localStorage.setItem('activeSelectedAIFunction' , model) + localStorage.setItem('activeSelectedAIFunction', model) setActiveSelectedAIFunction(model) const selectedAIFunction = selectedModelDropdown as keyof typeof modelList; localStorage.setItem("model", modelList[selectedAIFunction][model as keyof typeof modelList[typeof selectedAIFunction]]) @@ -309,7 +313,7 @@ const ModelSection: React.FC = () => { (displayedCategory) => (