History

fix(web): keep agent images collapsed (#9460)

maria committed 2 months ago

Commit 8bd544c1 parent c78f05a1 file · +4 −3Browse files

Unified · Split

apps/web/src/components/chat/MessagesTimeline.tsx+4−3
@@ -3049,16 +3049,17 @@ const PlainWorkEntryRow = memo(function PlainWorkEntryRow(props: { · 3048 unmodified lines
30493049 const previewText = displayLabel ?? workEntryDisplayLabel(workEntry, workspaceRoot);
30503050 const displayText =
30513051 !toolPresentation && expanded && workEntry.command?.trim() ? "Command" : previewText;
3052+ const viewedImagePath = workEntryViewedImagePath(workEntry);
30523053 const canExpand =
30533054 (workEntry.itemType === "mcp_tool_call" && workEntry.toolData !== undefined) ||
30543055 Boolean(
30553056 workEntryRawCommand(workEntry) ||
30563057 workEntry.command?.trim() ||
30573058 workEntry.detail?.trim() ||
3058− workEntry.changedFiles?.length,
3059+ workEntry.changedFiles?.length ||
3060+ viewedImagePath,
30593061 );
30603062 const expandedBody = expanded ? buildToolCallExpandedBody(workEntry, workspaceRoot) : null;
3061− const viewedImagePath = workEntryViewedImagePath(workEntry);
30623063 const viewedImage =
30633064 viewedImagePath && threadRef
30643065 ? resolveViewedImageAsset(viewedImagePath, {
@@ -3159,7 +3160,7 @@ const PlainWorkEntryRow = memo(function PlainWorkEntryRow(props: { · 94 unmodified lines
31593160 </span>
31603161 </div>
31613162 </div>
3162− {viewedImage && threadRef ? (
3163+ {expanded && viewedImage && threadRef ? (
31633164 <div
31643165 className="mt-1 ms-7 cursor-default"
31653166 onClick={stopRowToggle}