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
3049 const previewText = displayLabel ?? workEntryDisplayLabel(workEntry, workspaceRoot);3049 const previewText = displayLabel ?? workEntryDisplayLabel(workEntry, workspaceRoot);
3050 const displayText =3050 const displayText =
3051 !toolPresentation && expanded && workEntry.command?.trim() ? "Command" : previewText;3051 !toolPresentation && expanded && workEntry.command?.trim() ? "Command" : previewText;
3052 const viewedImagePath = workEntryViewedImagePath(workEntry);
3052 const canExpand =3053 const canExpand =
3053 (workEntry.itemType === "mcp_tool_call" && workEntry.toolData !== undefined) ||3054 (workEntry.itemType === "mcp_tool_call" && workEntry.toolData !== undefined) ||
3054 Boolean(3055 Boolean(
3055 workEntryRawCommand(workEntry) ||3056 workEntryRawCommand(workEntry) ||
3056 workEntry.command?.trim() ||3057 workEntry.command?.trim() ||
3057 workEntry.detail?.trim() ||3058 workEntry.detail?.trim() ||
3058 workEntry.changedFiles?.length,3059 workEntry.changedFiles?.length ||
3060 viewedImagePath,
3059 );3061 );
3060 const expandedBody = expanded ? buildToolCallExpandedBody(workEntry, workspaceRoot) : null;3062 const expandedBody = expanded ? buildToolCallExpandedBody(workEntry, workspaceRoot) : null;
3061 const viewedImagePath = workEntryViewedImagePath(workEntry);
3062 const viewedImage =3063 const viewedImage =
3063 viewedImagePath && threadRef3064 viewedImagePath && threadRef
3064 ? resolveViewedImageAsset(viewedImagePath, {3065 ? resolveViewedImageAsset(viewedImagePath, {
@@ -3159,7 +3160,7 @@ const PlainWorkEntryRow = memo(function PlainWorkEntryRow(props: { · 94 unmodified lines
3159 </span>3160 </span>
3160 </div>3161 </div>
3161 </div>3162 </div>
3162 {viewedImage && threadRef ? (3163 {expanded && viewedImage && threadRef ? (
3163 <div3164 <div
3164 className="mt-1 ms-7 cursor-default"3165 className="mt-1 ms-7 cursor-default"
3165 onClick={stopRowToggle}3166 onClick={stopRowToggle}