diff --git a/app/components/chat/Chat.client.tsx b/app/components/chat/Chat.client.tsx index dfe8912..8c8d36b 100644 --- a/app/components/chat/Chat.client.tsx +++ b/app/components/chat/Chat.client.tsx @@ -589,6 +589,8 @@ export const ChatImpl = memo( textareaRef.current?.blur(); }; + console.log(messages); + /** * Handles the change event for the textarea and updates the input state. * @param event - The change event from the textarea. diff --git a/app/components/chat/Messages.client.tsx b/app/components/chat/Messages.client.tsx index e221f4b..17600f0 100644 --- a/app/components/chat/Messages.client.tsx +++ b/app/components/chat/Messages.client.tsx @@ -71,7 +71,7 @@ export const Messages = forwardRef( >
{isUserMessage ? ( - + ) : ( ; + parts: + | (TextUIPart | ReasoningUIPart | ToolInvocationUIPart | SourceUIPart | FileUIPart | StepStartUIPart)[] + | undefined; } -export function UserMessage({ content }: UserMessageProps) { +export function UserMessage({ content, parts }: UserMessageProps) { + const profile = useStore(profileStore); + + // Extract images from parts - look for file parts with image mime types + const images = + parts?.filter( + (part): part is FileUIPart => part.type === 'file' && 'mimeType' in part && part.mimeType.startsWith('image/'), + ) || []; + if (Array.isArray(content)) { const textItem = content.find((item) => item.type === 'text'); const textContent = stripMetadata(textItem?.text || ''); - const images = content.filter((item) => item.type === 'image' && item.image); - const profile = useStore(profileStore); return (
@@ -43,7 +60,7 @@ export function UserMessage({ content }: UserMessageProps) { {images.map((item, index) => ( {`Image +
+
+ {images.map((item, index) => ( +
+
+ {`Image +
+
+ ))} +
{textContent}
);