update some logging

This commit is contained in:
Nate Kelley 2025-03-05 12:21:28 -07:00
parent 2800e4a389
commit 88a467168d
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
6 changed files with 20 additions and 12 deletions

View File

@ -1,6 +1,7 @@
import type { Meta, StoryObj } from '@storybook/react';
import { StreamingMessage_File } from './StreamingMessage_File';
import type { BusterChatResponseMessage_file } from '@/api/asset_interfaces';
import { fn } from '@storybook/test';
const meta: Meta<typeof StreamingMessage_File> = {
title: 'UI/Streaming/StreamingMessage_File',
@ -48,7 +49,7 @@ export const Default: Story = {
isSelectedFile: false,
isCompletedStream: true,
responseMessage: mockResponseMessage,
onClick: () => console.log('File clicked')
onClick: fn()
}
};
@ -57,7 +58,7 @@ export const Selected: Story = {
isSelectedFile: true,
isCompletedStream: true,
responseMessage: mockResponseMessage,
onClick: () => console.log('File clicked')
onClick: fn()
}
};
@ -66,7 +67,7 @@ export const Streaming: Story = {
isSelectedFile: false,
isCompletedStream: false,
responseMessage: mockResponseMessage,
onClick: () => console.log('File clicked')
onClick: fn()
}
};
@ -78,6 +79,6 @@ export const LongFileName: Story = {
...mockResponseMessage,
file_name: 'very_long_file_name_that_should_truncate_in_the_ui.txt'
},
onClick: () => console.log('File clicked')
onClick: fn()
}
};

View File

@ -37,8 +37,8 @@ export const useChatStreamMessage = () => {
(iChatMessage: Parameters<typeof onUpdateChatMessage>[0]) => {
onUpdateChatMessage(iChatMessage);
console.log(
iChatMessage.reasoning_message_ids,
Object.keys(iChatMessage.reasoning_messages || {})
iChatMessage.reasoning_message_ids?.length,
Object.keys(iChatMessage.reasoning_messages || {}).length
);
startTransition(() => {
//
@ -191,6 +191,9 @@ export const useChatStreamMessage = () => {
const _generatingReasoningMessageCallback = useMemoizedFn(
(_: null, d: ChatEvent_GeneratingReasoningMessage) => {
const { message_id, reasoning, chat_id } = d;
if (!reasoning?.id) {
console.log(d);
}
const reasoningMessageId = reasoning.id;
const existingMessage =
chatRef.current[chat_id]?.messages?.[message_id]?.reasoning_messages?.[reasoningMessageId];

View File

@ -4,6 +4,7 @@ import React from 'react';
import { useChatIndividualContextSelector } from '@chatLayout/ChatContext';
import { ReasoningMessageContainer } from './ReasoningMessageContainer';
import { useMessageIndividual } from '@/context/Chats';
import { useWhyDidYouUpdate } from 'ahooks';
interface ReasoningControllerProps {
chatId: string;
@ -15,7 +16,13 @@ export const ReasoningController: React.FC<ReasoningControllerProps> = ({ chatId
const reasoningMessageIds = useMessageIndividual(messageId, (x) => x?.reasoning_message_ids);
const isCompletedStream = useMessageIndividual(messageId, (x) => x?.isCompletedStream);
console.log('here!', hasChat, reasoningMessageIds);
useWhyDidYouUpdate('ReasoningController', {
hasChat,
reasoningMessageIds,
isCompletedStream,
chatId,
messageId
});
if (!hasChat || !reasoningMessageIds) return <></>;

View File

@ -30,7 +30,7 @@ const createMockReasoningFile = (
version_id: 'v1',
status: 'completed',
file: {
text: 'console.log("Hello World") \nconsole.log("Hello World") \nconsole.log("Hello World") \n',
text: 'console.test("Hello World") \nconsole.test("Hello World") \nconsole.test("Hello World") \n',
modified: [[1, 1]]
},
...overrides
@ -48,7 +48,7 @@ export const Default: Story = {
export const Loading: Story = {
render: () => {
const [text, setText] = React.useState(
'function example() {\n console.log("Hello, world!");\n'
'function example() {\n console.test("Hello, world!");\n'
);
const addLine = () => {

View File

@ -130,8 +130,6 @@ export const ReasoningMessage_File: React.FC<ReasoningMessageFileProps> = React.
processText();
}, [text, modified]);
console.log(lineSegments);
return (
<AppCodeBlockWrapper
title={<ReasoningFileTitle file_name={file_name} version_number={version_number} />}

View File

@ -9,7 +9,6 @@ export const ReasoningMessage_Text: React.FC<ReasoningMessageProps> = React.memo
const { message, status, id, type, title, secondary_title } =
reasoningMessage as BusterChatMessageReasoning_text;
console.log('here', message?.length);
return (
<BarContainer
showBar={true}