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

Function hasContentAfterIndex

src/components/MessageRow.tsx:50–92  ·  view source on GitHub ↗
(messages: RenderableMessage[], index: number, tools: Tools, streamingToolUseIDs: Set<string>)

Source from the content-addressed store, hash-verified

48 * accumulating every historical version of the array ≈ 1-2MB over a 7-turn session).
49 */
50export function hasContentAfterIndex(messages: RenderableMessage[], index: number, tools: Tools, streamingToolUseIDs: Set<string>): boolean {
51 for (let i = index + 1; i < messages.length; i++) {
52 const msg = messages[i];
53 if (msg?.type === 'assistant') {
54 const content = msg.message.content[0];
55 if (content?.type === 'thinking' || content?.type === 'redacted_thinking') {
56 continue;
57 }
58 if (content?.type === 'tool_use') {
59 if (getToolSearchOrReadInfo(content.name, content.input, tools).isCollapsible) {
60 continue;
61 }
62 // Non-collapsible tool uses appear in syntheticStreamingToolUseMessages
63 // before their ID is added to inProgressToolUseIDs. Skip while streaming
64 // to avoid briefly finalizing the read group.
65 if (streamingToolUseIDs.has(content.id)) {
66 continue;
67 }
68 }
69 return true;
70 }
71 if (msg?.type === 'system' || msg?.type === 'attachment') {
72 continue;
73 }
74 // Tool results arrive while the collapsed group is still being built
75 if (msg?.type === 'user') {
76 const content = msg.message.content[0];
77 if (content?.type === 'tool_result') {
78 continue;
79 }
80 }
81 // Collapsible grouped_tool_use messages arrive transiently before being
82 // merged into the current collapsed group on the next render cycle
83 if (msg?.type === 'grouped_tool_use') {
84 const firstInput = msg.messages[0]?.message.content[0]?.input;
85 if (getToolSearchOrReadInfo(msg.toolName, firstInput, tools).isCollapsible) {
86 continue;
87 }
88 }
89 return true;
90 }
91 return false;
92}
93function MessageRowImpl(t0) {
94 const $ = _c(64);
95 const {

Callers 1

renderMessageRowFunction · 0.85

Calls 2

getToolSearchOrReadInfoFunction · 0.85
hasMethod · 0.45

Tested by

no test coverage detected