@@ -115,6 +115,7 @@ interface ChatMessageRowProps {
115115 autoExpandTools : boolean ;
116116 animatingGroupKeys : Set < string > ;
117117 continuationIds : Set < string > ;
118+ sendNextId ?: string | null ;
118119 onRevert ?: ( checkpointId : string ) => void ;
119120 onFullRevert ?: ( checkpointId : string ) => void ;
120121 onSendQueuedNow ?: ( messageId : string ) => void ;
@@ -127,6 +128,7 @@ const ChatMessageRow = memo(function ChatMessageRow({
127128 autoExpandTools,
128129 animatingGroupKeys,
129130 continuationIds,
131+ sendNextId,
130132 onRevert,
131133 onFullRevert,
132134 onSendQueuedNow,
@@ -191,6 +193,7 @@ const ChatMessageRow = memo(function ChatMessageRow({
191193 message = { msg }
192194 showThinking = { showThinking }
193195 isContinuation = { continuationIds . has ( msg . id ) }
196+ isSendNextQueued = { sendNextId === msg . id }
194197 onRevert = { onRevert }
195198 onFullRevert = { onFullRevert }
196199 onSendQueuedNow = { onSendQueuedNow }
@@ -204,6 +207,7 @@ const ChatMessageRow = memo(function ChatMessageRow({
204207 prev . autoExpandTools === next . autoExpandTools &&
205208 prev . animatingGroupKeys === next . animatingGroupKeys &&
206209 prev . continuationIds === next . continuationIds &&
210+ prev . sendNextId === next . sendNextId &&
207211 prev . onRevert === next . onRevert &&
208212 prev . onFullRevert === next . onFullRevert &&
209213 prev . onSendQueuedNow === next . onSendQueuedNow &&
@@ -485,11 +489,21 @@ function ChatViewContent({
485489 } , [ isProcessing , nonQueuedMessages ] ) ;
486490
487491 // ── Build rows (single O(n) pass — js-combine-iterations) ──
488- const rows = useMemo (
492+ const baseRows = useMemo (
489493 ( ) => buildRows ( nonQueuedMessages , toolGroups , groupedIndices , turnSummaryByEndIndex , showProcessingIndicator ) ,
490494 [ nonQueuedMessages , toolGroups , groupedIndices , turnSummaryByEndIndex , showProcessingIndicator ] ,
491495 ) ;
492496
497+ const rows = useMemo ( ( ) => {
498+ if ( queuedMessages . length === 0 ) return baseRows ;
499+ const queuedRows = queuedMessages . map ( ( msg , index ) => ( {
500+ kind : "message" as const ,
501+ msg,
502+ originalIndex : nonQueuedMessages . length + index ,
503+ } ) ) ;
504+ return [ ...baseRows , ...queuedRows ] ;
505+ } , [ baseRows , nonQueuedMessages . length , queuedMessages ] ) ;
506+
493507 // ── Virtualizer ──
494508 const virtualizer = useVirtualizer ( {
495509 count : rows . length ,
@@ -680,6 +694,7 @@ function ChatViewContent({
680694 autoExpandTools = { autoExpandTools }
681695 animatingGroupKeys = { animatingGroupKeys }
682696 continuationIds = { continuationIds }
697+ sendNextId = { sendNextId }
683698 onRevert = { onRevert }
684699 onFullRevert = { onFullRevert }
685700 onSendQueuedNow = { onSendQueuedNow }
@@ -689,25 +704,6 @@ function ChatViewContent({
689704 ) ) }
690705 </ div >
691706
692- { /* Queued messages rendered below virtual list (always small count) */ }
693- { queuedMessages . length > 0 && (
694- < div >
695- { queuedMessages . map ( ( msg ) => (
696- < div key = { msg . id } data-message-id = { msg . id } >
697- < MessageBubble
698- message = { msg }
699- isSendNextQueued = { sendNextId === msg . id }
700- showThinking = { showThinking }
701- isContinuation = { continuationIds . has ( msg . id ) }
702- onRevert = { onRevert }
703- onFullRevert = { onFullRevert }
704- onSendQueuedNow = { onSendQueuedNow }
705- onUnqueueQueued = { onUnqueueQueuedMessage }
706- />
707- </ div >
708- ) ) }
709- </ div >
710- ) }
711707 </ div >
712708 ) ;
713709}
0 commit comments