* Checks if any collapsible block in the given blocks array is expanded. * Recursively checks nested blocks within agent blocks.
(blocks: ContentBlock[])
| 93 | * Recursively checks nested blocks within agent blocks. |
| 94 | */ |
| 95 | function 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. |
no test coverage detected