File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
cli/src/components/blocks Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,19 @@ export const ToolBranch = memo(
4545 }
4646
4747 const displayInfo = getToolDisplayInfo ( toolBlock . toolName )
48- const isCollapsed = toolBlock . isCollapsed ?? shouldCollapseToolByDefault ( toolBlock . toolName )
48+
49+ // Check if there's a registered custom component for this tool
50+ const toolRenderConfig = renderToolComponent ( toolBlock , theme , {
51+ availableWidth,
52+ indentationOffset : 0 ,
53+ previewPrefix : '' ,
54+ labelWidth : 0 ,
55+ } )
56+
57+ // Tools without a registered component (fallback rendering) should be collapsed by default
58+ const hasRegisteredComponent = toolRenderConfig !== undefined
59+ const isCollapsed = toolBlock . isCollapsed ??
60+ ( hasRegisteredComponent ? shouldCollapseToolByDefault ( toolBlock . toolName ) : true )
4961
5062 const inputContent = `\`\`\`json\n${ JSON . stringify ( toolBlock . input , null , 2 ) } \n\`\`\``
5163 const codeBlockLang =
@@ -67,13 +79,6 @@ export const ToolBranch = memo(
6779 ? `$ ${ toolBlock . input . command . trim ( ) } `
6880 : null
6981
70- let toolRenderConfig = renderToolComponent ( toolBlock , theme , {
71- availableWidth,
72- indentationOffset : 0 ,
73- previewPrefix : '' ,
74- labelWidth : 0 ,
75- } )
76-
7782 const streamingPreview = isStreaming
7883 ? commandPreview ?? `${ sanitizePreview ( firstLine ) } ...`
7984 : ''
You can’t perform that action at this time.
0 commit comments