From 601b0324b80a1d618e9e53978d7ce9baf2672b4a Mon Sep 17 00:00:00 2001 From: sageTheDM Date: Tue, 8 Oct 2024 07:22:09 +0200 Subject: [PATCH 01/12] Removed the empty account creation bug --- app/components/Login.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/components/Login.tsx b/app/components/Login.tsx index a2c0f7f..146e86c 100644 --- a/app/components/Login.tsx +++ b/app/components/Login.tsx @@ -79,12 +79,16 @@ const Login: React.FC = () => { // Function to handle account creation const handleCreateAccount = async () => { - const success = await createAccount(newAccountName, newAccountEmail, newAccountPassword); - if (success) { - alert('Account created successfully! You can now log in.'); - toggleSignUpPopup(); // Close sign-up popup + if (newAccountName !== "" && newAccountEmail !== "" && newAccountPassword !== "") { + const success = await createAccount(newAccountName, newAccountEmail, newAccountPassword); + if (success) { + alert('Account created successfully! You can now log in.'); + toggleSignUpPopup(); // Close sign-up popup + } else { + alert('Account creation failed. Please try again.'); + } } else { - alert('Account creation failed. Please try again.'); + alert('Account creation failed. Please do not leave any field empty.'); } }; From d1602e3ad7f6e50a683113d0df08a379acf0f0a9 Mon Sep 17 00:00:00 2001 From: sageTheDM Date: Tue, 8 Oct 2024 07:33:02 +0200 Subject: [PATCH 02/12] Input fields now do update the text color --- app/components/InputFrontend.tsx | 1 + app/components/settings/TextSettings.tsx | 1 + app/styles/input.css | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/app/components/InputFrontend.tsx b/app/components/InputFrontend.tsx index 9589096..fec7713 100644 --- a/app/components/InputFrontend.tsx +++ b/app/components/InputFrontend.tsx @@ -47,6 +47,7 @@ const InputFrontend = React.forwardRef( value={inputValue} onChange={handleInputChange} onKeyDown={handleKeyDown} + className='textInputField' /> - - - {/* Add Credits tab */} - {showToggle && showHistoryModelsToggle && ( - - )} - -
- {/* AI logo or text */} -
-
- -
- - - ); + // Effect to handle clicks outside of the dropdown + useEffect(() => { + const handleClickOutside = (event: MouseEvent) => { + // Check if the click is outside both the dropdown and the hamburger menu + if ( + dropdownRef.current && + !dropdownRef.current.contains(event.target as Node) && + toggleRef.current && + !toggleRef.current.contains(event.target as Node) + ) { + setMenuOpen(false); + } + }; + + document.addEventListener('mousedown', handleClickOutside); + + return () => { + document.removeEventListener('mousedown', handleClickOutside); + }; + }, []); + + return ( + <> +
+ {showToggle && showHistoryModelsToggle && ( + + )} + +
+ + + +
+
+ {/* AI logo or text */} +
+
+ +
+
+ + ); }; export default Header; diff --git a/app/styles/header.css b/app/styles/header.css index 9f30d31..53f536c 100644 --- a/app/styles/header.css +++ b/app/styles/header.css @@ -1,4 +1,4 @@ -header{ +header { position: relative; padding: 0 20px; width: 100%; @@ -10,15 +10,16 @@ header{ z-index: 999; } -.hamburger{ +/* Hamburger button styles */ +.hamburger { position: absolute; left: 5vw; - display: none; + display: flex; /* Always show hamburger button */ flex-direction: column; cursor: pointer; } -.hamburger span{ +.hamburger span { width: 25px; height: 3px; background-color: white; @@ -26,43 +27,53 @@ header{ transition: 0.3s; } -.hamburger.open span:nth-child(1){ +.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 10px); } -.hamburger.open span:nth-child(2){ +.hamburger.open span:nth-child(2) { opacity: 0; } -.hamburger.open span:nth-child(3){ +.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -10px); } - - -.nav-links{ +/* Navigation links (hidden in header, shown in dropdown) */ +.nav-links { + display: none; /* Default hidden */ position: absolute; - left: 1vw; - display: flex; - gap: 0.5vw; - width:max-content; - height: 100%; - align-items: center; + top: 10vh; /* Adjust as needed */ + left: 0; + background-color: var(--burger-menu-background-color); + width: 100%; + flex-direction: column; + align-items: flex-start; + padding: 10px; } -.nav-btn{ +.nav-links.active { + display: flex; /* Show when active */ + height: fit-content; +} + +.nav-btn { background-color: var(--input-button-color); border: none; font-size: 0.9em; - height: 50%; + height: 50px; /* Consistent height */ border-radius: 5px; - padding: 2px 15px; + padding: 10px; font-family: var(--font-family); + width: 100%; /* Full width */ + text-align: center; /* Center text */ + margin: 4px; } -.nav-btn:hover{ +.nav-btn:hover { background-color: var(--input-button-hover-color); } -.header-logo{ +/* Logo styles */ +.header-logo { width: 250px; height: 5vh; background-image: url(../../public/img/logo.png); @@ -73,7 +84,8 @@ header{ border: none; } -.login-button-container{ +/* Login button styles */ +.login-button-container { position: absolute; top: 0.1vh; right: 1vw; @@ -82,9 +94,9 @@ header{ align-items: center; } -.header-login-button{ +.header-login-button { height: 100%; - width:max-content; + width: max-content; font-size: var(--font-size); padding: 0.5vw 1vw; background-color: var(--input-button-color); @@ -101,4 +113,9 @@ header{ .header-login-button:hover { background-color: var(--input-button-hover-color); -} \ No newline at end of file +} + +.show-hide-btn{ + width: fit-content; + align-self: left; +} diff --git a/app/styles/responsive.css b/app/styles/responsive.css index ae65dfd..d09d21a 100644 --- a/app/styles/responsive.css +++ b/app/styles/responsive.css @@ -22,7 +22,7 @@ width: 100vw; overflow: hidden; margin: 0; - padding: 1dvh 0 0 0 ; + padding: 1dvh 0 0 0; } /* Left panel styles */ @@ -100,20 +100,20 @@ margin: 0; } - .header-logo{ + .header-logo { position: relative; margin-left: -40px; } - .hamburger.open{ + .hamburger.open { margin-top: 0.5vh; padding-left: 1vw; } - .nav-links{ - display: none; + .nav-links { + display: none; /* Hidden by default */ position: absolute; - top: 10vh; + top: 10vh; /* Adjust as needed */ left: 0; background-color: var(--burger-menu-background-color); width: 100%; @@ -123,24 +123,32 @@ height: fit-content; } - .nav-links.active{ - display: flex; + .nav-links.active { + display: flex; /* Show when active */ height: fit-content; } - .nav-btn{ + .nav-btn { width: 100%; text-align: center; padding: 10px; height: 50px; - } - - .hamburger { - display: flex; + background-color: var(--input-button-color); + border: none; + font-size: 0.9em; + border-radius: 5px; } - .header-login-button{ - right: 5vh; + .nav-btn:hover { + background-color: var(--input-button-hover-color); + } + + .hamburger { + display: flex; /* Always show hamburger button */ + } + + .header-login-button { + right: 5vh; /* Keep login button visible */ } } From 030e6a3dafd23329012e8e839dcab05e6e9597e0 Mon Sep 17 00:00:00 2001 From: Patrick_Pluto Date: Tue, 8 Oct 2024 09:57:04 +0200 Subject: [PATCH 07/12] ollama tweaks --- deployment_scripts/windows/scripts/prepare_ollama.bat | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deployment_scripts/windows/scripts/prepare_ollama.bat b/deployment_scripts/windows/scripts/prepare_ollama.bat index fc2de61..ce6187d 100644 --- a/deployment_scripts/windows/scripts/prepare_ollama.bat +++ b/deployment_scripts/windows/scripts/prepare_ollama.bat @@ -7,6 +7,9 @@ ollama.exe pull qwen2.5-coder:1.5b ollama.exe pull starcoder2:7b ollama.exe pull wizard-math ollama.exe pull llama3.1 +ollama.exe pull llama3.2 +ollama.exe pull dolphin-phi +ollama.exe pull dolphin-llama3 ollama.exe pull llava ollama.exe pull qwen2.5 ollama.exe pull mathstral From 0b2bbaccad09f46269e4714248c67bbe00883ca5 Mon Sep 17 00:00:00 2001 From: Patrick_Pluto Date: Tue, 8 Oct 2024 10:14:12 +0200 Subject: [PATCH 08/12] pip changes --- deployment_scripts/windows/scripts/prepare_py.bat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deployment_scripts/windows/scripts/prepare_py.bat b/deployment_scripts/windows/scripts/prepare_py.bat index 8337c91..dc9c8eb 100644 --- a/deployment_scripts/windows/scripts/prepare_py.bat +++ b/deployment_scripts/windows/scripts/prepare_py.bat @@ -1,5 +1,7 @@ cd python-bin set PATH=%PATH%;%CD% +curl -O https://bootstrap.pypa.io/get-pip.py +python get-pip.py cd Scripts set PATH=%PATH%;%CD% cd .. From 7ba4d2925384ce256823fd4ff01a5c0a8a4d41ef Mon Sep 17 00:00:00 2001 From: sageTheDM Date: Tue, 8 Oct 2024 10:24:13 +0200 Subject: [PATCH 09/12] Fixed the responsive design and the header --- app/components/Header.tsx | 8 ++++---- app/styles/header.css | 5 ++++- app/styles/responsive.css | 11 ++++++++++- public/img/logo-small.png | Bin 0 -> 34571 bytes 4 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 public/img/logo-small.png diff --git a/app/components/Header.tsx b/app/components/Header.tsx index ba6b92f..5a02425 100644 --- a/app/components/Header.tsx +++ b/app/components/Header.tsx @@ -57,7 +57,7 @@ const Header: React.FC = ({
{showToggle && showHistoryModelsToggle && ( )}