ChatMessage: render system images below user images

This commit is contained in:
Enrico Ros
2025-09-12 22:30:51 -07:00
parent 05a96c5aca
commit 7607b8fec5
@@ -760,8 +760,8 @@ export function ChatMessage(props: {
<InReferenceToList items={messageMetadata.inReferenceTo} />
)}
{/* Image Attachment Fragments - just for a prettier display on top of the message */}
{imageAttachments.length >= 1 && (
{/* [NOT SYSTEM, UNREAL] Image Attachment Fragments - just for a prettier display on top of the message, but is "WRONG" logically as the text comes before the image */}
{!fromSystem && imageAttachments.length >= 1 && (
<ImageAttachmentFragments
imageAttachments={imageAttachments}
contentScaling={adjContentScaling}
@@ -826,6 +826,17 @@ export function ChatMessage(props: {
/>
)}
{/* [SYSTEM, REAL] Image Attachment Fragments - just for a realistic display below the system instruction text/docs */}
{fromSystem && imageAttachments.length >= 1 && (
<ImageAttachmentFragments
imageAttachments={imageAttachments}
contentScaling={adjContentScaling}
messageRole={messageRole}
disabled={isEditingText}
onFragmentDelete={!props.onMessageFragmentDelete ? undefined : handleFragmentDelete}
/>
)}
{/* Continue... */}
{props.isBottom && messageGenerator?.tokenStopReason === 'out-of-tokens' && !!props.onMessageContinue && (
<BlockOpContinue