+ {renderItems.map((item, index) => {
+ const cardsForItem = turnCardsByRenderIndex.get(index) ?? []
- return (
-
- {item.kind === 'tool_group' ? (
-
!toolResultMap.has(tc.toolUseId))
- }
- />
- ) : (
- {
- const result = toolResultMap.get(item.message.toolUseId)
- return result ? { content: result.content, isError: result.isError } : null
- })()
- : null
- }
- />
- )}
+ return (
+
+ {item.kind === 'tool_group' ? (
+ !toolResultMap.has(tc.toolUseId))
+ }
+ />
+ ) : (
+ {
+ const result = toolResultMap.get(item.message.toolUseId)
+ return result ? { content: result.content, isError: result.isError } : null
+ })()
+ : null
+ }
+ />
+ )}
- {resolvedSessionId && cardsForItem.map((card) => (
- {
- setTurnUndoConfirmTargetId(card.target.messageId)
- }}
- />
- ))}
+ {resolvedSessionId && cardsForItem.map((card) => (
+ {
+ setTurnUndoConfirmTargetId(card.target.messageId)
+ }}
+ />
+ ))}
+
+ )
+ })}
+
+ {streamingText.trim() && (
+
+ )}
+
+ {/* Show StreamingIndicator when:
+ - tool_executing: tool is running
+ - thinking but no active ThinkingBlock yet: the gap between
+ sending a message and receiving the first thinking delta */}
+ {(chatState === 'tool_executing' || (chatState === 'thinking' && !activeThinkingId)) && (
+
+ )}
+
+ {!isLoadingTurnChangeCards && turnChangeCards.length === 0 && turnChangeLoadError && (
+
+ {turnChangeLoadError}
- )
- })}
+ )}
- {streamingText.trim() && (
-
- )}
-
- {/* Show StreamingIndicator when:
- - tool_executing: tool is running
- - thinking but no active ThinkingBlock yet: the gap between
- sending a message and receiving the first thinking delta */}
- {(chatState === 'tool_executing' || (chatState === 'thinking' && !activeThinkingId)) && (
-
- )}
-
- {!isLoadingTurnChangeCards && turnChangeCards.length === 0 && turnChangeLoadError && (
-
- {turnChangeLoadError}
-
- )}
-
-
+
+