Skip to content

Commit 8b3ccd5

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
improvement(chat): show live search sources by default
1 parent 5a1a4f3 commit 8b3ccd5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export function ToolActivityGroup({
220220
autoScrollActivity = true,
221221
isLive = false,
222222
}: ToolActivityGroupProps) {
223-
const [expanded, setExpanded] = useState(false)
223+
const [manualExpanded, setManualExpanded] = useState<boolean | null>(null)
224224
const tools = withoutRetriedSearchFailures(calls)
225225
const statusTool = getActivityStatusTool(tools)
226226
if (!statusTool) return null
@@ -236,6 +236,7 @@ export function ToolActivityGroup({
236236
const attentionKey = getActivityAttentionKey(tools)
237237
const entries = tools.map((tool) => ({ tool, sources: getSearchActivitySources(tool) }))
238238
const hasSearchDetails = entries.some(({ sources }) => sources !== undefined)
239+
const expanded = manualExpanded ?? (isLive && hasSearchDetails)
239240

240241
return (
241242
<ToolCallComponent
@@ -262,7 +263,7 @@ export function ToolActivityGroup({
262263
expandedLabel={tools.length > 1 ? groupedActivity?.title : undefined}
263264
collapsible={tools.length > 1 || hasSearchDetails}
264265
expanded={expanded}
265-
onToggle={() => setExpanded(!expanded)}
266+
onToggle={() => setManualExpanded(!expanded)}
266267
isStreaming={working && autoScrollActivity}
267268
unbounded={entries.some(({ sources }) => (sources?.length ?? 0) > 0)}
268269
>

0 commit comments

Comments
 (0)