MCPcopy Index your code
hub / github.com/codeaashu/claude-code / hasVisibleAssistantContent

Function hasVisibleAssistantContent

src/utils/sessionStorage.ts:2430–2443  ·  view source on GitHub ↗

* Checks if an assistant message has visible text content (not just tool_use blocks). * Tool uses are displayed as grouped/collapsed UI elements, not as standalone messages.

(message: TranscriptMessage)

Source from the content-addressed store, hash-verified

2428 * Tool uses are displayed as grouped/collapsed UI elements, not as standalone messages.
2429 */
2430function hasVisibleAssistantContent(message: TranscriptMessage): boolean {
2431 if (message.type !== 'assistant') return false
2432
2433 const content = message.message?.content
2434 if (!content || !Array.isArray(content)) return false
2435
2436 // Check for text block (not just tool_use/thinking blocks)
2437 return content.some(
2438 block =>
2439 block.type === 'text' &&
2440 typeof block.text === 'string' &&
2441 block.text.trim().length > 0,
2442 )
2443}
2444
2445/**
2446 * Counts visible messages that would appear as conversation turns in the UI.

Callers 1

countVisibleMessagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected