diff --git a/web/src/app/chat/ChatPage.tsx b/web/src/app/chat/ChatPage.tsx index bb1d8b62df6..d015a405df4 100644 --- a/web/src/app/chat/ChatPage.tsx +++ b/web/src/app/chat/ChatPage.tsx @@ -362,10 +362,7 @@ export function ChatPage({ const chatSession = (await response.json()) as BackendChatSession; setSelectedAssistantFromId(chatSession.persona_id); - console.log("GETTING CHAT SESSION"); - console.log("legnth is ", chatSession.messages.length); const newMessageMap = processRawChatHistory(chatSession.messages); - console.log(chatSession.messages.length); const newMessageHistory = buildLatestMessageChain(newMessageMap); // Update message history except for edge where where @@ -1572,14 +1569,11 @@ export function ChatPage({ return new Map([[chatSessionIdRef.current, initialRange]]); }); - console.log(visibleRange); - const updateVisibleRangeForCurrentSession = (newRange: { start: number; end: number; mostVisibleMessageId: number | null; }) => { - console.log("Updating visible range for current session:", newRange); setVisibleRange((prevState) => { const newState = new Map(prevState); newState.set(currentSessionId(), newRange); @@ -1588,13 +1582,11 @@ export function ChatPage({ }; useEffect(() => { - console.log("HII"); if ( messageHistory.length > 0 && (!visibleRange.get(currentSessionId()) || visibleRange.get(currentSessionId())?.end == 0) ) { - console.log("Udpating"); const newEnd = Math.max(messageHistory.length, 40); const newStart = Math.max(0, newEnd - 40); const newMostVisibleMessageId = messageHistory[newEnd - 1].messageId; @@ -1606,13 +1598,6 @@ export function ChatPage({ }); hasBeenInitialized.current = true; } else { - console.log("Not updating because", { - messageHistoryLength: messageHistory.length, - currentVisibleRange: visibleRange.get(currentSessionId()), - hasBeenInitialized: hasBeenInitialized.current, - }); - console.log("Not updating"); - console.log(messageHistory.length); } }, [router, messageHistory, currentSessionId()]); @@ -1677,9 +1662,6 @@ export function ChatPage({ useEffect(() => { if (currentVisibleRange.mostVisibleMessageId !== null) { - // Update any necessary state or perform actions based on the most visible message - // console.log("Most visible message ID:", visibleRange.mostVisibleMessageId); - // For example, you might want to update the selected message for document display: setSelectedMessageForDocDisplay(currentVisibleRange.mostVisibleMessageId); } }, [currentVisibleRange.mostVisibleMessageId]); @@ -1982,17 +1964,6 @@ export function ChatPage({ ? messageMap.get(message.parentMessageId) : null; - { - /* {messageHistory.map((message, i) => { - const messageMap = currentMessageMap( - completeMessageDetail - ); - const messageReactComponentKey = `${i}-${currentSessionId()}`; - const parentMessage = message.parentMessageId - ? messageMap.get(message.parentMessageId) - : null; */ - } - if ( currentSessionRegenerationState?.regenerating && message.messageId >