({
messages,
tools,
commands,
verbose,
toolJSX,
toolUseConfirmQueue,
inProgressToolUseIDs,
isMessageSelectorVisible,
conversationId,
screen,
streamingToolUses,
showAllInTranscript = false,
agentDefinitions,
onOpenRateLimitOptions,
hideLogo = false,
isLoading,
hidePastThinking = false,
streamingThinking,
streamingText,
isBriefOnly = false,
unseenDivider,
scrollRef,
trackStickyPrompt,
jumpRef,
onSearchMatchesChange,
scanElement,
setPositions,
disableRenderCap = false,
cursor = null,
setCursor,
cursorNavRef,
renderRange
}: Props)
| 339 | return start; |
| 340 | } |
| 341 | const MessagesImpl = ({ |
| 342 | messages, |
| 343 | tools, |
| 344 | commands, |
| 345 | verbose, |
| 346 | toolJSX, |
| 347 | toolUseConfirmQueue, |
| 348 | inProgressToolUseIDs, |
| 349 | isMessageSelectorVisible, |
| 350 | conversationId, |
| 351 | screen, |
| 352 | streamingToolUses, |
| 353 | showAllInTranscript = false, |
| 354 | agentDefinitions, |
| 355 | onOpenRateLimitOptions, |
| 356 | hideLogo = false, |
| 357 | isLoading, |
| 358 | hidePastThinking = false, |
| 359 | streamingThinking, |
| 360 | streamingText, |
| 361 | isBriefOnly = false, |
| 362 | unseenDivider, |
| 363 | scrollRef, |
| 364 | trackStickyPrompt, |
| 365 | jumpRef, |
| 366 | onSearchMatchesChange, |
| 367 | scanElement, |
| 368 | setPositions, |
| 369 | disableRenderCap = false, |
| 370 | cursor = null, |
| 371 | setCursor, |
| 372 | cursorNavRef, |
| 373 | renderRange |
| 374 | }: Props): React.ReactNode => { |
| 375 | const { |
| 376 | columns |
| 377 | } = useTerminalSize(); |
| 378 | const toggleShowAllShortcut = useShortcutDisplay('transcript:toggleShowAll', 'Transcript', 'Ctrl+E'); |
| 379 | const normalizedMessages = useMemo(() => normalizeMessages(messages).filter(isNotEmptyMessage), [messages]); |
| 380 | |
| 381 | // Check if streaming thinking should be visible (streaming or within 30s timeout) |
| 382 | const isStreamingThinkingVisible = useMemo(() => { |
| 383 | if (!streamingThinking) return false; |
| 384 | if (streamingThinking.isStreaming) return true; |
| 385 | if (streamingThinking.streamingEndedAt) { |
| 386 | return Date.now() - streamingThinking.streamingEndedAt < 30000; |
| 387 | } |
| 388 | return false; |
| 389 | }, [streamingThinking]); |
| 390 | |
| 391 | // Find the last thinking block (message UUID + content index) for hiding past thinking in transcript mode |
| 392 | // When streaming thinking is visible, use a special ID that won't match any completed thinking block |
| 393 | // With adaptive thinking, only consider thinking blocks from the current turn and stop searching once we |
| 394 | // hit the last user message. |
| 395 | const lastThinkingBlockId = useMemo(() => { |
| 396 | if (!hidePastThinking) return null; |
| 397 | // If streaming thinking is visible, hide all completed thinking blocks by using a non-matching ID |
| 398 | if (isStreamingThinkingVisible) return 'streaming'; |
nothing calls this directly
no test coverage detected