From a50c2e30ec6a9828de0faf2cbd4b4d01c17c9f53 Mon Sep 17 00:00:00 2001 From: pablodanswer Date: Sat, 14 Sep 2024 10:54:29 -0700 Subject: [PATCH] Very minor polish (#2445) * fix minor polish * cleaner chat flow * remove keys * slight robustification to copying --- backend/danswer/db/search_settings.py | 2 +- web/src/app/chat/ChatBanner.tsx | 1 + web/src/app/chat/ChatPage.tsx | 4 ++-- web/src/app/chat/lib.tsx | 3 ++- web/src/app/chat/message/Messages.tsx | 8 ++------ 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/backend/danswer/db/search_settings.py b/backend/danswer/db/search_settings.py index bb869c471..e3f35e310 100644 --- a/backend/danswer/db/search_settings.py +++ b/backend/danswer/db/search_settings.py @@ -183,7 +183,7 @@ def update_current_search_settings( # Whenever we update the current search settings, we should ensure that the local reranking model is warmed up. if ( - current_settings.provider_type is None + search_settings.rerank_provider_type is None and search_settings.rerank_model_name is not None and current_settings.rerank_model_name != search_settings.rerank_model_name ): diff --git a/web/src/app/chat/ChatBanner.tsx b/web/src/app/chat/ChatBanner.tsx index 8f51d1743..72a2cac56 100644 --- a/web/src/app/chat/ChatBanner.tsx +++ b/web/src/app/chat/ChatBanner.tsx @@ -45,6 +45,7 @@ export function ChatBanner() { shadow-sm rounded border-l-8 border-l-400 + bg-background border-r-4 border-r-200 border-border border diff --git a/web/src/app/chat/ChatPage.tsx b/web/src/app/chat/ChatPage.tsx index 28c15dd96..a08425bd9 100644 --- a/web/src/app/chat/ChatPage.tsx +++ b/web/src/app/chat/ChatPage.tsx @@ -1124,9 +1124,9 @@ export function ChatPage({ await delay(50); while (!stack.isComplete || !stack.isEmpty()) { - await delay(2); + await delay(0.5); - if (!stack.isEmpty()) { + if (!stack.isEmpty() && !controller.signal.aborted) { const packet = stack.nextPacket(); if (!packet) { continue; diff --git a/web/src/app/chat/lib.tsx b/web/src/app/chat/lib.tsx index 370a7e59b..f9b101090 100644 --- a/web/src/app/chat/lib.tsx +++ b/web/src/app/chat/lib.tsx @@ -698,7 +698,8 @@ export async function useScrollonStream({ ) { // catch up if necessary! const scrollAmount = scrollDist.current + 10000; - if (scrollDist.current > 140) { + if (scrollDist.current > 300) { + // if (scrollDist.current > 140) { endDivRef.current.scrollIntoView(); } else { blockActionRef.current = true; diff --git a/web/src/app/chat/message/Messages.tsx b/web/src/app/chat/message/Messages.tsx index 03042304b..ec3fd2190 100644 --- a/web/src/app/chat/message/Messages.tsx +++ b/web/src/app/chat/message/Messages.tsx @@ -383,17 +383,13 @@ export const AIMessage = ({ // TODO: fix the fact that you have to double click to follow link // for the first link return ( - + {rest.children} ); } else { return ( rest.href ? window.open(rest.href, "_blank") @@ -570,8 +566,8 @@ export const AIMessage = ({