diff --git a/ui-component/components/documents/FolderList.tsx b/ui-component/components/documents/FolderList.tsx
index c7a1f32..d57bcb8 100644
--- a/ui-component/components/documents/FolderList.tsx
+++ b/ui-component/components/documents/FolderList.tsx
@@ -2,7 +2,7 @@
import React from 'react';
import { Button } from '@/components/ui/button';
-import { PlusCircle, ArrowLeft } from 'lucide-react';
+import { PlusCircle, ArrowLeft, MessageSquare } from 'lucide-react';
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog';
import { Label } from '@/components/ui/label';
import { Input } from '@/components/ui/input';
@@ -131,15 +131,51 @@ const FolderList: React.FC = ({
- {/* Show delete button if documents are selected */}
- {selectedDocuments.length > 0 && handleDeleteMultipleDocuments && (
-
- Delete {selectedDocuments.length} selected
-
+ {/* Show action buttons if documents are selected */}
+ {selectedDocuments && selectedDocuments.length > 0 && (
+
+ {/* Chat with selected button */}
+ {
+ // Build proper URL path
+ let path = '/';
+ if (typeof window !== 'undefined') {
+ const currentPath = window.location.pathname;
+ if (currentPath !== '/') {
+ path = currentPath;
+ }
+ }
+
+ // Create filter with external_id which is the correct field name
+ const filter = JSON.stringify({ external_id: selectedDocuments });
+ const filtersParam = encodeURIComponent(filter);
+
+ // Navigate to chat with selected documents
+ // Use window.location to force a full page reload
+ if (typeof window !== 'undefined') {
+ window.location.href = `${path}?section=chat&filters=${filtersParam}`;
+ } else {
+ router.push(`${path}?section=chat&filters=${filtersParam}`);
+ }
+ }}
+ className="border-primary text-primary hover:bg-primary/10 flex items-center gap-1"
+ >
+
+ Chat with {selectedDocuments.length} selected
+
+
+ {/* Delete button */}
+ {handleDeleteMultipleDocuments && (
+
+ Delete {selectedDocuments.length} selected
+
+ )}
+
)}
diff --git a/ui-component/components/search/SearchResultCard.tsx b/ui-component/components/search/SearchResultCard.tsx
index 816c7ab..3f3491b 100644
--- a/ui-component/components/search/SearchResultCard.tsx
+++ b/ui-component/components/search/SearchResultCard.tsx
@@ -83,4 +83,4 @@ const SearchResultCard: React.FC