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" } diff --git a/app/components/settings/SettingsWindow.tsx b/app/components/settings/SettingsWindow.tsx index 8f3a6f4..d274baa 100644 --- a/app/components/settings/SettingsWindow.tsx +++ b/app/components/settings/SettingsWindow.tsx @@ -26,12 +26,18 @@ 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 [githubUsername, setGithubUsername] = useState(Cookies.get('githubUsername') || ''); const [githubToken, setGithubToken] = useState(Cookies.get('githubToken') || ''); + const [isLocalModelsEnabled, setIsLocalModelsEnabled] = useState(() => { + const savedLocalModelsState = Cookies.get('isLocalModelsEnabled'); + return savedLocalModelsState === 'true'; + }); // Load base URLs from cookies const [baseUrls, setBaseUrls] = useState(() => { @@ -116,6 +122,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)); @@ -195,10 +205,21 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => { const versionHash = commit.commit; // Get the version hash from commit.json + const handleSaveConnection = () => { Cookies.set('githubUsername', githubUsername); Cookies.set('githubToken', githubToken); toast.success('GitHub credentials saved successfully!'); + + // 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 ( @@ -348,57 +369,31 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => { )} {activeTab === 'features' && (
-

Feature Settings

-
- Debug Info -
-
- )} - {activeTab === 'features' && ( -
-

Experimental Area

-
- Replace with local models -
)}