(msg_8: RenderableMessage, index: number)
| 612 | }, [progress]); |
| 613 | const messageKey = useCallback((msg_7: RenderableMessage) => `${msg_7.uuid}-${conversationId}`, [conversationId]); |
| 614 | const renderMessageRow = (msg_8: RenderableMessage, index: number) => { |
| 615 | const prevType = index > 0 ? renderableMessages[index - 1]?.type : undefined; |
| 616 | const isUserContinuation = msg_8.type === 'user' && prevType === 'user'; |
| 617 | // hasContentAfter is only consumed for collapsed_read_search groups; |
| 618 | // skip the scan for everything else. streamingText is rendered as a |
| 619 | // sibling after this map, so it's never in renderableMessages — OR it |
| 620 | // in explicitly so the group flips to past tense as soon as text starts |
| 621 | // streaming instead of waiting for the block to finalize. |
| 622 | const hasContentAfter = msg_8.type === 'collapsed_read_search' && (!!streamingText || hasContentAfterIndex(renderableMessages, index, tools, streamingToolUseIDs)); |
| 623 | const k_0 = messageKey(msg_8); |
| 624 | const row = <MessageRow key={k_0} message={msg_8} isUserContinuation={isUserContinuation} hasContentAfter={hasContentAfter} tools={tools} commands={commands} verbose={verbose || isItemExpanded(msg_8) || cursor?.expanded === true && index === selectedIdx} inProgressToolUseIDs={inProgressToolUseIDs} streamingToolUseIDs={streamingToolUseIDs} screen={screen} canAnimate={canAnimate} onOpenRateLimitOptions={onOpenRateLimitOptions} lastThinkingBlockId={lastThinkingBlockId} latestBashOutputUUID={latestBashOutputUUID} columns={columns} isLoading={isLoading} lookups={lookups_0} />; |
| 625 | |
| 626 | // Per-row Provider — only 2 rows re-render on selection change. |
| 627 | // Wrapped BEFORE divider branch so both return paths get it. |
| 628 | const wrapped = <MessageActionsSelectedContext.Provider key={k_0} value={index === selectedIdx}> |
| 629 | {row} |
| 630 | </MessageActionsSelectedContext.Provider>; |
| 631 | if (unseenDivider && index === dividerBeforeIndex) { |
| 632 | return [<Box key="unseen-divider" marginTop={1}> |
| 633 | <Divider title={`${unseenDivider.count} new ${plural(unseenDivider.count, 'message')}`} width={columns} color="inactive" /> |
| 634 | </Box>, wrapped]; |
| 635 | } |
| 636 | return wrapped; |
| 637 | }; |
| 638 | |
| 639 | // Search indexing: for tool_result messages, look up the Tool and use |
| 640 | // its extractSearchText — tool-owned, precise, matches what |
nothing calls this directly
no test coverage detected