diff --git a/electron/servers/nextjs/app/(presentation-generator)/(dashboard)/Components/DashboardSidebar.tsx b/electron/servers/nextjs/app/(presentation-generator)/(dashboard)/Components/DashboardSidebar.tsx index f5d893ef..4ff5f30d 100644 --- a/electron/servers/nextjs/app/(presentation-generator)/(dashboard)/Components/DashboardSidebar.tsx +++ b/electron/servers/nextjs/app/(presentation-generator)/(dashboard)/Components/DashboardSidebar.tsx @@ -1,7 +1,7 @@ "use client"; import React from "react"; -import { LayoutDashboard, Star, Brain, Settings, Palette } from "lucide-react"; +import { LayoutDashboard, Star, Brain, Settings, Palette, HelpCircle } from "lucide-react"; import { usePathname } from "next/navigation"; import Link from "next/link"; import { useRouter } from "next/navigation"; @@ -105,11 +105,16 @@ const DashboardSidebar = () => {
+
+ + Help +
DiscordCommunity
+ {BelongingNavItems.map(({ key, label: itemLabel, icon: Icon }) => { const isActive = activeTab === key; return ( diff --git a/electron/servers/nextjs/app/(presentation-generator)/(dashboard)/settings/TextProvider.tsx b/electron/servers/nextjs/app/(presentation-generator)/(dashboard)/settings/TextProvider.tsx index 9f5531de..2d1626cf 100644 --- a/electron/servers/nextjs/app/(presentation-generator)/(dashboard)/settings/TextProvider.tsx +++ b/electron/servers/nextjs/app/(presentation-generator)/(dashboard)/settings/TextProvider.tsx @@ -17,6 +17,13 @@ interface OpenAIConfigProps { onInputChange: (value: string | boolean, field: string) => void; llmConfig: LLMConfig; } + +interface ModelOption { + value: string; + label: string; + size?: string; +} + const TextProvider = ({ onInputChange, @@ -26,7 +33,7 @@ const TextProvider = ({ ) => { const [openProviderSelect, setOpenProviderSelect] = useState(false); const [openModelSelect, setOpenModelSelect] = useState(false); - const [availableModels, setAvailableModels] = useState([]); + const [availableModels, setAvailableModels] = useState([]); const [modelsLoading, setModelsLoading] = useState(false); const [modelsChecked, setModelsChecked] = useState(false); const [showApiKey, setShowApiKey] = useState(false); @@ -157,19 +164,48 @@ const TextProvider = ({ if (response.ok) { const data = await response.json(); - const normalizedModels: string[] = selectedProvider === 'ollama' + const normalizedModels: ModelOption[] = selectedProvider === 'ollama' ? Array.isArray(data) - ? data.map((model: { value?: string; label?: string }) => model.value || model.label || '').filter(Boolean) + ? data + .map((model) => { + if (typeof model === 'string') { + return { + value: model, + label: model, + }; + } + + if (model && typeof model === 'object') { + const typedModel = model as { value?: string; label?: string; size?: string }; + return { + value: typedModel.value || typedModel.label || '', + label: typedModel.label || typedModel.value || '', + size: typedModel.size, + }; + } + + return { + value: '', + label: '', + }; + }) + .filter((model: ModelOption) => Boolean(model.value)) : [] : Array.isArray(data) ? data + .filter((model): model is string => typeof model === 'string') + .map((model) => ({ + value: model, + label: model, + })) : []; setAvailableModels(normalizedModels); setModelsChecked(true); if (normalizedModels.length > 0 && currentModelField) { - if (currentModel && normalizedModels.includes(currentModel)) { + const modelValues = normalizedModels.map((model) => model.value); + if (currentModel && modelValues.includes(currentModel)) { onInputChange(currentModel, currentModelField); return; } @@ -181,9 +217,9 @@ const TextProvider = ({ ? 'models/gemini-2.5-flash' : selectedProvider === 'anthropic' ? 'claude-sonnet-4-20250514' - : normalizedModels[0]; + : modelValues[0]; - const nextModel = normalizedModels.includes(preferredDefault) ? preferredDefault : normalizedModels[0]; + const nextModel = modelValues.includes(preferredDefault) ? preferredDefault : modelValues[0]; onInputChange(nextModel, currentModelField); } } else { @@ -401,8 +437,6 @@ const TextProvider = ({
- - {selectedProvider !== 'ollama' && selectedProvider !== 'codex' && (!modelsChecked || (modelsChecked && availableModels.length === 0)) && (