From 8bd544cdfd22aa38ab82bc1adc0b851755a299ef Mon Sep 17 00:00:00 2001 From: maria Date: Thu, 3 Sep 2026 14:04:10 -0400 Subject: [PATCH] fix(web): keep agent images collapsed (#9460) Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com> --- apps/web/src/components/chat/MessagesTimeline.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/chat/MessagesTimeline.tsx b/apps/web/src/components/chat/MessagesTimeline.tsx index c85f85cac12211f8ec7759b5e64b11797045f8d9..2b02190129713bf8a10fea47409542bd3629afd3 100644 --- a/apps/web/src/components/chat/MessagesTimeline.tsx +++ b/apps/web/src/components/chat/MessagesTimeline.tsx @@ -3049,16 +3049,17 @@ const PlainWorkEntryRow = memo(function PlainWorkEntryRow(props: { const previewText = displayLabel ?? workEntryDisplayLabel(workEntry, workspaceRoot); const displayText = !toolPresentation && expanded && workEntry.command?.trim() ? "Command" : previewText; + const viewedImagePath = workEntryViewedImagePath(workEntry); const canExpand = (workEntry.itemType === "mcp_tool_call" && workEntry.toolData !== undefined) || Boolean( workEntryRawCommand(workEntry) || workEntry.command?.trim() || workEntry.detail?.trim() || - workEntry.changedFiles?.length, + workEntry.changedFiles?.length || + viewedImagePath, ); const expandedBody = expanded ? buildToolCallExpandedBody(workEntry, workspaceRoot) : null; - const viewedImagePath = workEntryViewedImagePath(workEntry); const viewedImage = viewedImagePath && threadRef ? resolveViewedImageAsset(viewedImagePath, { @@ -3159,7 +3160,7 @@ const PlainWorkEntryRow = memo(function PlainWorkEntryRow(props: { - {viewedImage && threadRef ? ( + {expanded && viewedImage && threadRef ? (