From 49ce4235ece709d45ad6cf354c4870cb6e990dbe Mon Sep 17 00:00:00 2001
From: Dustin Loring
Date: Mon, 9 Dec 2024 10:31:09 -0500
Subject: [PATCH 1/4] fixed toggle not displaying in feature tab
---
app/components/settings/SettingsWindow.tsx | 68 +++++++---------------
1 file changed, 22 insertions(+), 46 deletions(-)
diff --git a/app/components/settings/SettingsWindow.tsx b/app/components/settings/SettingsWindow.tsx
index c70238e..8b62a05 100644
--- a/app/components/settings/SettingsWindow.tsx
+++ b/app/components/settings/SettingsWindow.tsx
@@ -30,6 +30,8 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => {
const [searchTerm, setSearchTerm] = useState('');
const [isDeleting, setIsDeleting] = useState(false);
const [isJustSayEnabled, setIsJustSayEnabled] = useState(false);
+ const [isExperimentalFeature1Enabled, setIsExperimentalFeature1Enabled] = useState(false);
+ const [isExperimentalFeature2Enabled, setIsExperimentalFeature2Enabled] = useState(false);
// Load base URLs from cookies
const [baseUrls, setBaseUrls] = useState(() => {
@@ -339,57 +341,31 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => {
)}
{activeTab === 'features' && (
-
Feature Settings
-
-
Debug Info
-
-
- )}
- {activeTab === 'features' && (
-
-
Experimental Area
-
-
Replace with local models
-
)}
From 38c069988e4866576f08a4975933051381c01254 Mon Sep 17 00:00:00 2001
From: Dustin Loring
Date: Mon, 9 Dec 2024 10:42:42 -0500
Subject: [PATCH 2/4] moved local models to the experimental features
---
app/components/settings/SettingsWindow.tsx | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/app/components/settings/SettingsWindow.tsx b/app/components/settings/SettingsWindow.tsx
index 8b62a05..e429b2b 100644
--- a/app/components/settings/SettingsWindow.tsx
+++ b/app/components/settings/SettingsWindow.tsx
@@ -30,6 +30,7 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => {
const [searchTerm, setSearchTerm] = useState('');
const [isDeleting, setIsDeleting] = useState(false);
const [isJustSayEnabled, setIsJustSayEnabled] = useState(false);
+ const [isLocalModelsEnabled, setIsLocalModelsEnabled] = useState(false);
const [isExperimentalFeature1Enabled, setIsExperimentalFeature1Enabled] = useState(false);
const [isExperimentalFeature2Enabled, setIsExperimentalFeature2Enabled] = useState(false);
@@ -115,6 +116,10 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => {
};
const filteredProviders = providers
+ .filter((provider) => {
+ const isLocalModelProvider = ['OpenAILike', 'LMStudio', 'Ollama'].includes(provider.name);
+ return isLocalModelsEnabled || !isLocalModelProvider;
+ })
.filter((provider) => provider.name.toLowerCase().includes(searchTerm.toLowerCase()))
.sort((a, b) => a.name.localeCompare(b.name));
@@ -359,11 +364,11 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => {
Disclaimer: Experimental features may be unstable and are subject to change.
- Replace with local models
+ Enable Local Models
setIsJustSayEnabled(!isJustSayEnabled)}
+ checked={isLocalModelsEnabled}
+ onCheckedChange={() => setIsLocalModelsEnabled(!isLocalModelsEnabled)}
/>
From a203f2f86fcbb87bb8477940a0b43c741d6ad2a7 Mon Sep 17 00:00:00 2001
From: Dustin Loring
Date: Mon, 9 Dec 2024 12:39:55 -0500
Subject: [PATCH 3/4] Remembers Settings In Features
Uses cookies now
---
app/components/settings/SettingsWindow.tsx | 25 ++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/app/components/settings/SettingsWindow.tsx b/app/components/settings/SettingsWindow.tsx
index e429b2b..6301bfa 100644
--- a/app/components/settings/SettingsWindow.tsx
+++ b/app/components/settings/SettingsWindow.tsx
@@ -26,11 +26,17 @@ const URL_CONFIGURABLE_PROVIDERS = ['Ollama', 'LMStudio', 'OpenAILike'];
export const SettingsWindow = ({ open, onClose }: SettingsProps) => {
const navigate = useNavigate();
const [activeTab, setActiveTab] = useState('chat-history');
- const [isDebugEnabled, setIsDebugEnabled] = useState(false);
+ const [isDebugEnabled, setIsDebugEnabled] = useState(() => {
+ const savedDebugState = Cookies.get('isDebugEnabled');
+ return savedDebugState === 'true';
+ });
const [searchTerm, setSearchTerm] = useState('');
const [isDeleting, setIsDeleting] = useState(false);
const [isJustSayEnabled, setIsJustSayEnabled] = useState(false);
- const [isLocalModelsEnabled, setIsLocalModelsEnabled] = useState(false);
+ const [isLocalModelsEnabled, setIsLocalModelsEnabled] = useState(() => {
+ const savedLocalModelsState = Cookies.get('isLocalModelsEnabled');
+ return savedLocalModelsState === 'true';
+ });
const [isExperimentalFeature1Enabled, setIsExperimentalFeature1Enabled] = useState(false);
const [isExperimentalFeature2Enabled, setIsExperimentalFeature2Enabled] = useState(false);
@@ -199,6 +205,17 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => {
const versionHash = commit.commit; // Get the version hash from commit.json
+ // Update the toggle handlers to save to cookies
+ const handleToggleDebug = (enabled: boolean) => {
+ setIsDebugEnabled(enabled);
+ Cookies.set('isDebugEnabled', String(enabled));
+ };
+
+ const handleToggleLocalModels = (enabled: boolean) => {
+ setIsLocalModelsEnabled(enabled);
+ Cookies.set('isLocalModelsEnabled', String(enabled));
+ };
+
return (
@@ -353,7 +370,7 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => {
setIsDebugEnabled(!isDebugEnabled)}
+ onCheckedChange={handleToggleDebug}
/>
@@ -368,7 +385,7 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => {
setIsLocalModelsEnabled(!isLocalModelsEnabled)}
+ onCheckedChange={handleToggleLocalModels}
/>
From a6756f8fdafc44e907623ca3c222070743560321 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Mon, 9 Dec 2024 22:13:53 +0000
Subject: [PATCH 4/4] chore: update commit hash to
5aeb52ae01aee1bc98605f41a0c747ef26dc8739
---
app/commit.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/commit.json b/app/commit.json
index b1c1cf8..a8f3203 100644
--- a/app/commit.json
+++ b/app/commit.json
@@ -1 +1 @@
-{ "commit": "b4978ca8193afa277f6df0d80e5fbdf787a3524a" }
+{ "commit": "5aeb52ae01aee1bc98605f41a0c747ef26dc8739" }