@@ -31,7 +31,6 @@ import {
3131 ZapIcon ,
3232} from "lucide-react" ;
3333import { Button } from "../ui/button" ;
34- import { AssistantMessageBubbleShell , UserMessageBubbleShell } from "./chatBubbleShells" ;
3534import { buildExpandedImagePreview , ExpandedImagePreview } from "./ExpandedImagePreview" ;
3635import { ProposedPlanCard } from "./ProposedPlanCard" ;
3736import { ChangedFilesTree } from "./ChangedFilesTree" ;
@@ -311,70 +310,74 @@ function TimelineRowContent({ row }: { row: TimelineRow }) {
311310 const terminalContexts = displayedUserMessage . contexts ;
312311 const canRevertAgentWork = typeof row . revertTurnCount === "number" ;
313312 return (
314- < UserMessageBubbleShell >
315- { userImages . length > 0 && (
316- < div className = "mb-2 grid max-w-[420px] grid-cols-2 gap-2" >
317- { userImages . map ( ( image : NonNullable < TimelineMessage [ "attachments" ] > [ number ] ) => (
318- < div
319- key = { image . id }
320- className = "overflow-hidden rounded-lg border border-border/80 bg-background/70"
321- >
322- { image . previewUrl ? (
323- < button
324- type = "button"
325- className = "h-full w-full cursor-zoom-in"
326- aria-label = { `Preview ${ image . name } ` }
327- onClick = { ( ) => {
328- const preview = buildExpandedImagePreview ( userImages , image . id ) ;
329- if ( ! preview ) return ;
330- ctx . onImageExpand ( preview ) ;
331- } }
313+ < div className = "flex justify-end" >
314+ < div className = "group relative max-w-[80%] rounded-2xl rounded-br-sm border border-border bg-secondary px-4 py-3" >
315+ { userImages . length > 0 && (
316+ < div className = "mb-2 grid max-w-[420px] grid-cols-2 gap-2" >
317+ { userImages . map (
318+ ( image : NonNullable < TimelineMessage [ "attachments" ] > [ number ] ) => (
319+ < div
320+ key = { image . id }
321+ className = "overflow-hidden rounded-lg border border-border/80 bg-background/70"
332322 >
333- < img
334- src = { image . previewUrl }
335- alt = { image . name }
336- className = "block h-auto max-h-[220px] w-full object-cover"
337- />
338- </ button >
339- ) : (
340- < div className = "flex min-h-[72px] items-center justify-center px-2 py-3 text-center text-chat-xxs text-muted-foreground/70" >
341- { image . name }
323+ { image . previewUrl ? (
324+ < button
325+ type = "button"
326+ className = "h-full w-full cursor-zoom-in"
327+ aria-label = { `Preview ${ image . name } ` }
328+ onClick = { ( ) => {
329+ const preview = buildExpandedImagePreview ( userImages , image . id ) ;
330+ if ( ! preview ) return ;
331+ ctx . onImageExpand ( preview ) ;
332+ } }
333+ >
334+ < img
335+ src = { image . previewUrl }
336+ alt = { image . name }
337+ className = "block h-auto max-h-[220px] w-full object-cover"
338+ />
339+ </ button >
340+ ) : (
341+ < div className = "flex min-h-[72px] items-center justify-center px-2 py-3 text-center text-chat-xxs text-muted-foreground/70" >
342+ { image . name }
343+ </ div >
344+ ) }
342345 </ div >
343- ) }
344- </ div >
345- ) ) }
346- </ div >
347- ) }
348- { ( displayedUserMessage . visibleText . trim ( ) . length > 0 ||
349- terminalContexts . length > 0 ) && (
350- < UserMessageBody
351- text = { displayedUserMessage . visibleText }
352- terminalContexts = { terminalContexts }
353- />
354- ) }
355- < div className = "mt-1.5 flex items-center justify-end gap-2" >
356- < div className = "flex items-center gap-1.5 opacity-0 transition-opacity duration-200 focus-within:opacity-100 group-hover:opacity-100" >
357- { displayedUserMessage . copyText && (
358- < MessageCopyButton text = { displayedUserMessage . copyText } />
359- ) }
360- { canRevertAgentWork && (
361- < Button
362- type = "button"
363- size = "xs"
364- variant = "outline"
365- disabled = { ctx . isRevertingCheckpoint || ctx . isWorking }
366- onClick = { ( ) => ctx . onRevertUserMessage ( row . message . id ) }
367- title = "Revert to this message"
368- >
369- < Undo2Icon className = "size-3" />
370- </ Button >
371- ) }
346+ ) ,
347+ ) }
348+ </ div >
349+ ) }
350+ { ( displayedUserMessage . visibleText . trim ( ) . length > 0 ||
351+ terminalContexts . length > 0 ) && (
352+ < UserMessageBody
353+ text = { displayedUserMessage . visibleText }
354+ terminalContexts = { terminalContexts }
355+ />
356+ ) }
357+ < div className = "mt-1.5 flex items-center justify-end gap-2" >
358+ < div className = "flex items-center gap-1.5 opacity-0 transition-opacity duration-200 focus-within:opacity-100 group-hover:opacity-100" >
359+ { displayedUserMessage . copyText && (
360+ < MessageCopyButton text = { displayedUserMessage . copyText } />
361+ ) }
362+ { canRevertAgentWork && (
363+ < Button
364+ type = "button"
365+ size = "xs"
366+ variant = "outline"
367+ disabled = { ctx . isRevertingCheckpoint || ctx . isWorking }
368+ onClick = { ( ) => ctx . onRevertUserMessage ( row . message . id ) }
369+ title = "Revert to this message"
370+ >
371+ < Undo2Icon className = "size-3" />
372+ </ Button >
373+ ) }
374+ </ div >
375+ < p className = "text-right text-chat-xs text-muted-foreground/50" >
376+ { formatTimestamp ( row . message . createdAt , ctx . timestampFormat ) }
377+ </ p >
372378 </ div >
373- < p className = "text-right text-chat-xs text-muted-foreground/50" >
374- { formatTimestamp ( row . message . createdAt , ctx . timestampFormat ) }
375- </ p >
376379 </ div >
377- </ UserMessageBubbleShell >
380+ </ div >
378381 ) ;
379382 } ) ( ) }
380383
@@ -403,7 +406,7 @@ function TimelineRowContent({ row }: { row: TimelineRow }) {
403406 < span className = "h-px flex-1 bg-border" />
404407 </ div >
405408 ) }
406- < AssistantMessageBubbleShell >
409+ < div className = "min-w-0 px-1 py-0.5" >
407410 < ChatMarkdown
408411 text = { messageText }
409412 cwd = { ctx . markdownCwd }
@@ -442,7 +445,7 @@ function TimelineRowContent({ row }: { row: TimelineRow }) {
442445 </ div >
443446 ) : null }
444447 </ div >
445- </ AssistantMessageBubbleShell >
448+ </ div >
446449 </ >
447450 ) ;
448451 } ) ( ) }
0 commit comments