@@ -71,6 +71,7 @@ import { useAssistantCitationTarget } from "./useAssistantCitationTarget";
7171import { worktreeSetupAgentStarted } from "@t3tools/client-runtime/worktree-setup" ;
7272import { resolveCitationPhase , type CitedHistory } from "./citationProcedure" ;
7373import {
74+ assistantMetaRow ,
7475 resolveTimelineIsAtEnd ,
7576 resolveTimelineMinimapHasPersistentGutter ,
7677 resolveTimelineMinimapCurrentIndex ,
@@ -232,6 +233,8 @@ interface MessagesTimelineProps {
232233 /** Which request is waiting, so a second one of the same kind is announced too. */
233234 awaitingRequestId ?: string | null ;
234235 footer ?: ReactNode ;
236+ /** The footer continues the last message, so that message's actions follow it. */
237+ footerContinuesMessage ?: boolean ;
235238
236239 listRef : React . RefObject < LegendListRef | null > ;
237240 timelineEntries : ReadonlyArray < TimelineEntry > ;
@@ -330,6 +333,7 @@ const ConversationTimeline = memo(function ConversationTimeline({
330333 activeTurnStartedAt = null ,
331334 worktreeSetup = null ,
332335 footer = null ,
336+ footerContinuesMessage = false ,
333337 onCancelWorktreeSetup,
334338 retryableWorkspacePreparationRunIds = EMPTY_RUN_IDS ,
335339 onRetryWorkspacePreparation,
@@ -683,6 +687,20 @@ const ConversationTimeline = memo(function ConversationTimeline({
683687 worktreeSetup,
684688 } ) ;
685689 const rows = useStableRows ( rawRows , listIdentityKey ) ;
690+ const lastRow = rows . at ( - 1 ) ;
691+ // A message reserves an invisible hover row for its actions, which would hold the footer away.
692+ const messageBeforeFooter =
693+ footerContinuesMessage &&
694+ lastRow ?. kind === "message" &&
695+ lastRow . message . role === "assistant" &&
696+ lastRow . showAssistantMeta
697+ ? lastRow
698+ : null ;
699+ const messageBeforeFooterRow = messageBeforeFooter && {
700+ ...messageBeforeFooter ,
701+ showAssistantMeta : false ,
702+ showAssistantCopyButton : false ,
703+ } ;
686704 const unmatchedPendingApprovals = new Map ( pendingApprovalsByRequestId ) ;
687705 if ( unmatchedPendingApprovals . size > 0 ) {
688706 for ( const row of rows ) {
@@ -1225,19 +1243,35 @@ const ConversationTimeline = memo(function ConversationTimeline({
12251243 data-timeline-root = "true"
12261244 >
12271245 < AudioPreviewUnmountContext value = { onAudioUnmount } >
1228- < TimelineRowContent row = { item } />
1246+ < TimelineRowContent
1247+ row = { item . id === messageBeforeFooterRow ?. id ? messageBeforeFooterRow : item }
1248+ />
12291249 </ AudioPreviewUnmountContext >
12301250 </ div >
12311251 </ div >
12321252 </ TimelineRowCtx >
12331253 ) ;
1234- const listExtraData = { identity : listIdentityKey , rowCount : rows . length , sharedState } ;
1254+ const listExtraData = {
1255+ identity : listIdentityKey ,
1256+ rowCount : rows . length ,
1257+ sharedState,
1258+ messageBeforeFooterRow,
1259+ } ;
12351260 const timelineListFooter = (
12361261 < TimelineListFooter
12371262 composerInset = { anchoredEndSpace ? 0 : contentInsetEndAdjustment }
12381263 onGrow = { onFooterGrow }
12391264 >
12401265 { footer }
1266+ { messageBeforeFooter ? (
1267+ < TimelineRowCtx value = { sharedState } >
1268+ < div className = "chat-content-lane" >
1269+ < AssistantMetaTimelineRow
1270+ row = { assistantMetaRow ( messageBeforeFooter , messageBeforeFooter . message . updatedAt ) }
1271+ />
1272+ </ div >
1273+ </ TimelineRowCtx >
1274+ ) : null }
12411275 { unmatchedPendingApprovals . size > 0 ? (
12421276 < TimelineRowCtx value = { sharedState } >
12431277 < div className = "messages-timeline-row-frame" >
0 commit comments