diff --git a/backend/danswer/chat/personas.yaml b/backend/danswer/chat/personas.yaml
index bafaf2d788c..e628b32e6f7 100644
--- a/backend/danswer/chat/personas.yaml
+++ b/backend/danswer/chat/personas.yaml
@@ -5,7 +5,7 @@ personas:
# this is for DanswerBot to use when tagged in a non-configured channel
# Careful setting specific IDs, this won't autoincrement the next ID value for postgres
- id: 0
- name: "Knowledge"
+ name: "Search"
description: >
Assistant with access to documents from your Connected Sources.
# Default Prompt objects attached to the persona, see prompts.yaml
diff --git a/web/src/app/chat/ChatPage.tsx b/web/src/app/chat/ChatPage.tsx
index 81884105a9c..ca44448297b 100644
--- a/web/src/app/chat/ChatPage.tsx
+++ b/web/src/app/chat/ChatPage.tsx
@@ -132,8 +132,9 @@ export function ChatPage({
const {
chatSessions,
- availableSources,
- availableDocumentSets,
+ ccPairs,
+ tags,
+ documentSets,
llmProviders,
folders,
openedFolders,
@@ -153,6 +154,12 @@ export function ChatPage({
router.push("/search");
}
+ const [documentSidebarToggled, setDocumentSidebarToggled] = useState(false);
+
+ const toggleDocumentSidebar = () => {
+ setDocumentSidebarToggled((prev) => !prev);
+ };
+
const { assistants: availableAssistants, finalAssistants } = useAssistants();
const [showApiKeyModal, setShowApiKeyModal] = useState(
@@ -268,6 +275,16 @@ export function ChatPage({
const noAssistants = liveAssistant == null || liveAssistant == undefined;
+ const availableSources = ccPairs.map((ccPair) => ccPair.source);
+ const [finalAvailableSources, finalAvailableDocumentSets] =
+ computeAvailableFilters({
+ selectedPersona: availableAssistants.find(
+ (assistant) => assistant.id === liveAssistant?.id
+ ),
+ availableSources: availableSources,
+ availableDocumentSets: documentSets,
+ });
+
// always set the model override for the chat session, when an assistant, llm provider, or user preference exists
useEffect(() => {
const personaDefault = getLLMProviderOverrideForPersona(
@@ -1804,6 +1821,11 @@ export function ChatPage({
setDocumentSelection((documentSelection) => !documentSelection);
setShowDocSidebar(false);
};
+ const [filtersToggled, setFiltersToggled] = useState(false);
+ const toggleFilters = () => {
+ setFiltersToggled((filtersToggled) => !filtersToggled);
+ setDocumentSidebarToggled(true);
+ };
interface RegenerationRequest {
messageId: number;
@@ -1965,6 +1987,53 @@ export function ChatPage({
+ {!settings?.isMobile && (
+
+ setDocumentSidebarToggled(false)}
+ selectedMessage={aiMessage}
+ selectedDocuments={selectedDocuments}
+ toggleDocumentSelection={toggleDocumentSelection}
+ clearSelectedDocuments={clearSelectedDocuments}
+ selectedDocumentTokens={selectedDocumentTokens}
+ maxTokens={maxTokens}
+ isLoading={isFetchingChatMessages}
+ initialWidth={300}
+ isOpen={documentSidebarToggled}
+ />
+
+ )}
{
+ toggleDocumentSelectionAspects();
+ setDocumentSidebarToggled(
+ !documentSidebarToggled
+ );
+ }}
docs={message.documents}
currentPersona={liveAssistant}
alternativeAssistant={
@@ -2446,6 +2521,7 @@ export function ChatPage({
)}
setShowApiKeyModal(true)
}
@@ -2500,6 +2576,20 @@ export function ChatPage({
+ {!settings?.isMobile && (
+
+ )}
)}
@@ -2519,8 +2609,9 @@ export function ChatPage({
+ {/* Right Sidebar - DocumentSidebar */}
- setDocumentSelection(false)}
@@ -2532,7 +2623,7 @@ export function ChatPage({
maxTokens={maxTokens}
isLoading={isFetchingChatMessages}
isOpen={documentSelection}
- />
+ /> */}
>
);
}
diff --git a/web/src/app/chat/documentSidebar/ChatDocumentDisplay.tsx b/web/src/app/chat/documentSidebar/ChatDocumentDisplay.tsx
index 8fc6c3e4af6..9fbc35697dc 100644
--- a/web/src/app/chat/documentSidebar/ChatDocumentDisplay.tsx
+++ b/web/src/app/chat/documentSidebar/ChatDocumentDisplay.tsx
@@ -30,104 +30,68 @@ export function ChatDocumentDisplay({
tokenLimitReached,
}: DocumentDisplayProps) {
const isInternet = document.is_internet;
- // Consider reintroducing null scored docs in the future
if (document.score === null) {
return null;
}
+ const faviconUrl =
+ isInternet && document.link
+ ? `https://www.google.com/s2/favicons?domain=${
+ new URL(document.link).hostname
+ }&sz=32`
+ : null;
+
return (
-
-
+
+
);
diff --git a/web/src/app/chat/documentSidebar/DocumentSidebar.tsx b/web/src/app/chat/documentSidebar/DocumentSidebar.tsx
index 5a6ed956fe6..1225761b3cd 100644
--- a/web/src/app/chat/documentSidebar/DocumentSidebar.tsx
+++ b/web/src/app/chat/documentSidebar/DocumentSidebar.tsx
@@ -6,8 +6,15 @@ import { removeDuplicateDocs } from "@/lib/documentUtils";
import { Message } from "../interfaces";
import { ForwardedRef, forwardRef } from "react";
import { Separator } from "@/components/ui/separator";
+import {
+ HorizontalSourceSelector,
+ SourceSelector,
+} from "@/components/search/filtering/Filters";
+import { FilterManager } from "@/lib/hooks";
+import { CCPairBasicInfo, DocumentSet, Tag } from "@/lib/types";
interface DocumentSidebarProps {
+ filterManager: FilterManager;
closeSidebar: () => void;
selectedMessage: Message | null;
selectedDocuments: DanswerDocument[] | null;
@@ -18,6 +25,10 @@ interface DocumentSidebarProps {
isLoading: boolean;
initialWidth: number;
isOpen: boolean;
+ filtersToggled: boolean;
+ ccPairs: CCPairBasicInfo[];
+ tags: Tag[];
+ documentSets: DocumentSet[];
}
export const DocumentSidebar = forwardRef
(
@@ -26,6 +37,7 @@ export const DocumentSidebar = forwardRef(
closeSidebar,
selectedMessage,
selectedDocuments,
+ filterManager,
toggleDocumentSelection,
clearSelectedDocuments,
selectedDocumentTokens,
@@ -33,6 +45,10 @@ export const DocumentSidebar = forwardRef(
isLoading,
initialWidth,
isOpen,
+ filtersToggled,
+ ccPairs,
+ tags,
+ documentSets,
},
ref: ForwardedRef
) => {
@@ -51,12 +67,12 @@ export const DocumentSidebar = forwardRef(
// space
const tokenLimitReached = selectedDocumentTokens > maxTokens - 75;
+ const hasSelectedDocuments = selectedDocumentIds.length > 0;
+
return (