@@ -1047,7 +1089,6 @@ export function ChatPage({
newCompleteMessageMap
);
setSelectedMessageForDocDisplay(messageId);
-
// set message as latest so we can edit this message
// and so it sticks around on page reload
setMessageAsLatest(messageId);
@@ -1076,9 +1117,7 @@ export function ChatPage({
citedDocuments={getCitedDocumentsFromMessage(
message
)}
- toolCall={
- message.toolCalls && message.toolCalls[0]
- }
+ toolCall={message?.toolCalls?.[0]}
isComplete={
i !== messageHistory.length - 1 ||
!isStreaming
@@ -1273,21 +1312,31 @@ export function ChatPage({
) : // Another option is to use a div with the width set to the initial width, so that the
// chat section appears in the same place as before
//
diff --git a/web/src/app/chat/ChatPersonaSelector.tsx b/web/src/app/chat/ChatPersonaSelector.tsx
index 33ef61ef1..55cb8086f 100644
--- a/web/src/app/chat/ChatPersonaSelector.tsx
+++ b/web/src/app/chat/ChatPersonaSelector.tsx
@@ -130,8 +130,8 @@ export function ChatPersonaSelector({
}
>
-
-
+
+
{currentlySelectedPersona?.name || "Default"}
diff --git a/web/src/app/chat/documentSidebar/DocumentSidebar.tsx b/web/src/app/chat/documentSidebar/DocumentSidebar.tsx
index c5913d406..aa962a1f9 100644
--- a/web/src/app/chat/documentSidebar/DocumentSidebar.tsx
+++ b/web/src/app/chat/documentSidebar/DocumentSidebar.tsx
@@ -7,33 +7,41 @@ import { SelectedDocumentDisplay } from "./SelectedDocumentDisplay";
import { removeDuplicateDocs } from "@/lib/documentUtils";
import { BasicSelectable } from "@/components/BasicClickable";
import { Message, RetrievalType } from "../interfaces";
+import { SIDEBAR_WIDTH } from "@/lib/constants";
import { HoverPopup } from "@/components/HoverPopup";
-import { HEADER_PADDING } from "@/lib/constants";
+import { TbLayoutSidebarLeftExpand } from "react-icons/tb";
+import { ForwardedRef, forwardRef } from "react";
function SectionHeader({
name,
icon,
+ closeHeader,
}: {
name: string;
icon: React.FC<{ className: string }>;
+ closeHeader?: () => void;
}) {
return (
-
+ // NOTE: do not allow selection if less than 75 tokens are left
+ // this is to prevent the case where they are able to select the doc
+ // but it basically is unused since it's truncated right at the very
+ // start of the document (since title + metadata + misc overhead) takes up
+ // space
+ const tokenLimitReached = selectedDocumentTokens > maxTokens - 75;
- {currentDocuments ? (
-