MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / hasAnyExpandedBlocksRecursive

Function hasAnyExpandedBlocksRecursive

cli/src/utils/collapse-helpers.ts:95–110  ·  view source on GitHub ↗

* Checks if any collapsible block in the given blocks array is expanded. * Recursively checks nested blocks within agent blocks.

(blocks: ContentBlock[])

Source from the content-addressed store, hash-verified

93 * Recursively checks nested blocks within agent blocks.
94 */
95function hasAnyExpandedBlocksRecursive(blocks: ContentBlock[]): boolean {
96 for (const block of blocks) {
97 if (isCollapsibleBlock(block)) {
98 if (isBlockExpanded(block)) {
99 return true
100 }
101 // Recursively check nested blocks in agent blocks
102 if (block.type === 'agent' && block.blocks) {
103 if (hasAnyExpandedBlocksRecursive(block.blocks)) {
104 return true
105 }
106 }
107 }
108 }
109 return false
110}
111
112/**
113 * Checks if any collapsible block in the messages array is expanded.

Callers 1

hasAnyExpandedBlocksFunction · 0.85

Calls 2

isCollapsibleBlockFunction · 0.85
isBlockExpandedFunction · 0.85

Tested by

no test coverage detected