reasoning file click update

This commit is contained in:
Nate Kelley 2025-04-18 16:17:37 -06:00
parent 08d16d0897
commit 19199185d6
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
5 changed files with 5 additions and 32 deletions

View File

@ -36,10 +36,6 @@ export const MetricViewChartContent: React.FC<MetricViewChartContentProps> = Rea
return 'p-4';
}, [isTable, fetchedData]);
useMount(() => {
console.log('metricData');
});
return (
<div className={cn('flex h-full flex-col overflow-hidden', cardClassName, className)}>
<BusterChart

View File

@ -24,21 +24,10 @@ export const ChatResponseMessage_File: React.FC<ChatResponseMessageProps> = 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<ChatResponseMessageProps> = Reac
});
return (
<Link href={href} prefetch onClick={onLinkClick}>
<Link href={href} prefetch>
<StreamingMessage_File
isCompletedStream={isCompletedStream}
responseMessage={responseMessage}

View File

@ -33,7 +33,6 @@ export const ChatResponseReasoning: React.FC<{
const { data: finalReasoningMessage } = useGetChatMessage(messageId, {
select: (x) => 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 (
<Link href={href} onClick={onClickReasoningFile}>
<Link href={href}>
<AnimatePresence initial={!isCompletedStream} mode="wait">
<motion.div
{...animations}

View File

@ -45,10 +45,6 @@ export const useAutoChangeLayout = ({
const hasReasoning = !!reasoningMessagesLength;
useMount(() => {
console.log('MOUNTED?');
});
useEffect(() => {
console.log({
isCompletedStream,

View File

@ -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,