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

Function hasAnyExpandedBlocks

cli/src/utils/collapse-helpers.ts:119–135  ·  view source on GitHub ↗
(messages: ChatMessage[])

Source from the content-addressed store, hash-verified

117 * @returns true if any block is expanded, false if all are collapsed
118 */
119export function hasAnyExpandedBlocks(messages: ChatMessage[]): boolean {
120 for (const message of messages) {
121 // Handle agent variant messages
122 if (message.variant === 'agent') {
123 if (message.metadata?.isCollapsed === false) {
124 return true
125 }
126 }
127
128 // Handle blocks within messages
129 if (message.blocks && hasAnyExpandedBlocksRecursive(message.blocks)) {
130 return true
131 }
132 }
133
134 return false
135}
136
137/**
138 * Result type for recursive block update operation.

Callers 2

useChatMessagesFunction · 0.90

Calls 1

Tested by

no test coverage detected