Skip to content

Commit 1805b36

Browse files
committed
fix(home-chat): only shimmer last text item in agent group
1 parent 919265e commit 1805b36

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/agent-group.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ export function AgentGroup({
3333
}: AgentGroupProps) {
3434
const AgentIcon = getAgentIcon(agentName)
3535
const hasItems = items.length > 0
36+
let lastTextIdx = -1
37+
for (let i = items.length - 1; i >= 0; i--) {
38+
if (items[i].type === 'text') {
39+
lastTextIdx = i
40+
break
41+
}
42+
}
3643
const toolItems = items.filter(
3744
(item): item is Extract<AgentGroupItem, { type: 'tool' }> => item.type === 'tool'
3845
)
@@ -108,7 +115,7 @@ export function AgentGroup({
108115
<SubagentThinkingBlock
109116
key={`text-${idx}`}
110117
content={item.content}
111-
isStreaming={!!isStreamingProp && duration === undefined}
118+
isStreaming={!!isStreamingProp && duration === undefined && idx === lastTextIdx}
112119
duration={duration}
113120
/>
114121
)

apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/subagent-thinking-block.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export function SubagentThinkingBlock({
8888
}
8989
if (!isStreaming) {
9090
setExpanded(false)
91+
// Reset so the next streaming session auto-expands by default
9192
userCollapsedRef.current = false
9293
}
9394
}, [isStreaming, hasContent])

0 commit comments

Comments
 (0)