Project NOMAD is an offline-first knowledge and education server. Wikipedia, thousands of books, courses, maps, and optional local AI, all running on hardware you own with no internet required.
TypeScript
fix(AI): leave chat suggestions disabled by default
Jake Turner43ebaa93c131
diff --git a/admin/app/services/chat_service.ts b/admin/app/services/chat_service.tsindex 3bfb5d06..d395e530 100644--- a/admin/app/services/chat_service.ts+++ b/admin/app/services/chat_service.ts@@ -32,7 +32,7 @@ export class ChatService {async getChatSuggestions() {try {const models = await this.ollamaService.getModels()- if (!models) {+ if (!models || models.length === 0) {return [] // If no models are available, return empty suggestions}diff --git a/admin/app/services/docker_service.ts b/admin/app/services/docker_service.tsindex 96a4ffb1..7ba1e2e1 100644--- a/admin/app/services/docker_service.ts+++ b/admin/app/services/docker_service.ts@@ -545,8 +545,8 @@ export class DockerService {// If Ollama was just installed, trigger Nomad docs discovery and embeddingif (service.service_name === SERVICE_NAMES.OLLAMA) {- logger.info('[DockerService] Ollama installation complete. Enabling chat suggestions by default.')- await KVStore.setValue('chat.suggestionsEnabled', "true")+ logger.info('[DockerService] Ollama installation complete. Default behavior is to not enable chat suggestions.')+ await KVStore.setValue('chat.suggestionsEnabled', "false")logger.info('[DockerService] Ollama installation complete. Triggering Nomad docs discovery...')diff --git a/admin/inertia/components/chat/ChatInterface.tsx b/admin/inertia/components/chat/ChatInterface.tsxindex 60acf32e..27d44c13 100644--- a/admin/inertia/components/chat/ChatInterface.tsx+++ b/admin/inertia/components/chat/ChatInterface.tsx@@ -11,6 +11,7 @@ interface ChatInterfaceProps {onSendMessage: (message: string) => voidisLoading?: booleanchatSuggestions?: string[]+ chatSuggestionsEnabled?: booleanchatSuggestionsLoading?: boolean}@@ -19,6 +20,7 @@ export default function ChatInterface({onSendMessage,isLoading = false,chatSuggestions = [],+ chatSuggestionsEnabled = false,chatSuggestionsLoading = false,}: ChatInterfaceProps) {const [input, setInput] = useState('')@@ -69,7 +71,7 @@ export default function ChatInterface({<p className="text-gray-500 text-sm">Interact with your installed language models directly in the Command Center.</p>- {chatSuggestions && chatSuggestions.length > 0 && !chatSuggestionsLoading && (+ {chatSuggestionsEnabled && chatSuggestions && chatSuggestions.length > 0 && !chatSuggestionsLoading && (<div className="mt-8"><h4 className="text-sm font-medium text-gray-600 mb-2">Suggestions:</h4><div className="flex flex-col gap-2">@@ -92,7 +94,12 @@ export default function ChatInterface({</div>)}{/* Display bouncing dots while loading suggestions */}- {chatSuggestionsLoading && <BouncingDots text="Thinking" containerClassName="mt-8" />}+ {chatSuggestionsEnabled && chatSuggestionsLoading && <BouncingDots text="Thinking" containerClassName="mt-8" />}+ {!chatSuggestionsEnabled && (+ <div className="mt-8 text-sm text-gray-500">+ Need some inspiration? Enable chat suggestions in settings to get started with example prompts.+ </div>+ )}</div></div>) : (diff --git a/admin/inertia/components/chat/index.tsx b/admin/inertia/components/chat/index.tsxindex 8359d2c4..1d6cb5fd 100644--- a/admin/inertia/components/chat/index.tsx+++ b/admin/inertia/components/chat/index.tsx@@ -284,6 +284,7 @@ export default function Chat({onSendMessage={handleSendMessage}isLoading={chatMutation.isPending}chatSuggestions={chatSuggestions}+ chatSuggestionsEnabled={suggestionsEnabled}chatSuggestionsLoading={chatSuggestionsLoading}/></div>