From 19199185d66dc27541dd814e8df9fd5752c18307 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Fri, 18 Apr 2025 16:17:37 -0600 Subject: [PATCH] reasoning file click update --- .../MetricViewChart/MetricViewChartContent.tsx | 4 ---- .../ChatResponseMessage_File.tsx | 13 +------------ .../ChatResponseMessages/ChatResponseReasoning.tsx | 11 +---------- .../ChatLayout/ChatContext/useAutoChangeLayout.ts | 4 ---- .../useLayoutConfig/useLayoutConfig.ts | 5 +++-- 5 files changed, 5 insertions(+), 32 deletions(-) diff --git a/web/src/controllers/MetricController/MetricViewChart/MetricViewChartContent.tsx b/web/src/controllers/MetricController/MetricViewChart/MetricViewChartContent.tsx index 28ec70e74..5aa6c770c 100644 --- a/web/src/controllers/MetricController/MetricViewChart/MetricViewChartContent.tsx +++ b/web/src/controllers/MetricController/MetricViewChart/MetricViewChartContent.tsx @@ -36,10 +36,6 @@ export const MetricViewChartContent: React.FC = Rea return 'p-4'; }, [isTable, fetchedData]); - useMount(() => { - console.log('metricData'); - }); - return (
= Reac }); const responseMessage = data as BusterChatResponseMessage_file; - const { file_type, id } = responseMessage as BusterChatResponseMessage_file; - const { isSelectedFile } = useGetIsSelectedFile({ responseMessage }); - const onSetSelectedFile = useChatLayoutContextSelector((x) => x.onSetSelectedFile); const href = useGetFileHref({ responseMessage, isSelectedFile, chatId }); - const onLinkClick = useMemoizedFn(() => { - if (isSelectedFile) { - return onSetSelectedFile(null); - } - - onSetSelectedFile({ id, type: file_type, versionNumber: responseMessage.version_number }); - }); - useMount(() => { if (href) { router.prefetch(href); @@ -46,7 +35,7 @@ export const ChatResponseMessage_File: React.FC = Reac }); return ( - + x?.final_reasoning_message }); - const onSetSelectedFile = useChatLayoutContextSelector((x) => x.onSetSelectedFile); const selectedFileType = useChatLayoutContextSelector((x) => x.selectedFileType); const isReasonginFileSelected = selectedFileType === 'reasoning'; const showShimmerText = isReasonginFileSelected ? false : !isCompletedStream; @@ -50,14 +49,6 @@ export const ChatResponseReasoning: React.FC<{ return lastMessageTitle || 'Thinking...'; }, [lastMessageTitle, finalReasoningMessage, blackBoxMessage]); - const onClickReasoningFile = useMemoizedFn(() => { - onSetSelectedFile( - isReasonginFileSelected - ? null - : { id: messageId, type: 'reasoning', versionNumber: undefined } - ); - }); - const href = useMemo(() => { if (isReasonginFileSelected) { return createBusterRoute({ @@ -74,7 +65,7 @@ export const ChatResponseReasoning: React.FC<{ }, [isReasonginFileSelected, messageId, chatId]); return ( - + { - console.log('MOUNTED?'); - }); - useEffect(() => { console.log({ isCompletedStream, diff --git a/web/src/layouts/ChatLayout/ChatLayoutContext/useLayoutConfig/useLayoutConfig.ts b/web/src/layouts/ChatLayout/ChatLayoutContext/useLayoutConfig/useLayoutConfig.ts index ed9178f42..156bb5a49 100644 --- a/web/src/layouts/ChatLayout/ChatLayoutContext/useLayoutConfig/useLayoutConfig.ts +++ b/web/src/layouts/ChatLayout/ChatLayoutContext/useLayoutConfig/useLayoutConfig.ts @@ -25,7 +25,8 @@ export const useLayoutConfig = ({ dashboardId, currentRoute, secondaryView, - appSplitterRef + appSplitterRef, + messageId }: { selectedFile: SelectedFile | null; chatId: string | undefined; @@ -189,7 +190,7 @@ export const useLayoutConfig = ({ fileView, secondaryView: secondaryViewFromSelected }); - }, [metricId, secondaryView, chatId, dashboardId, currentRoute]); + }, [metricId, secondaryView, chatId, dashboardId, messageId, currentRoute]); return { selectedLayout,