Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

feat: chat assistant selection only shown for more than two assistants

markmeheree0e7d4459d8a
diff --git a/.gitignore b/.gitignore
index ca807a51f..a3f14a17f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,7 @@ core/lib/**
*.tsbuildinfo
test_results.html
pre-install
+.build
# docs
docs/yarn.lock
diff --git a/web-app/src/containers/ChatInput.tsx b/web-app/src/containers/ChatInput.tsx
index 4820eb08e..d4f0411af 100644
--- a/web-app/src/containers/ChatInput.tsx
+++ b/web-app/src/containers/ChatInput.tsx
@@ -205,6 +205,8 @@ const ChatInput = memo(function ChatInput({
const avatar = assistants.find((a) => a.id === selectedAssistantId)?.avatar
+ const assistantCount = assistants?.length || 0
+
// No auto-selection: let the user explicitly pick an assistant
// Jan Browser Extension hook
@@ -1627,7 +1629,7 @@ const ChatInput = memo(function ChatInput({
</span>
</DropdownMenuItem>
{/* Use Assistant - only show when no projectId */}
- {!projectId && !initialMessage && (
+ {!projectId && (!initialMessage || assistantCount < 2) && (
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<IconUser size={18} className="text-muted-foreground" />
@@ -1649,7 +1651,7 @@ const ChatInput = memo(function ChatInput({
</DropdownMenuContent>
</DropdownMenu>
)}
- {!projectId && initialMessage && (
+ {!projectId && initialMessage && assistantCount >= 2 && (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button