@@ -26,9 +26,7 @@ import {
2626 isPaintOnlyThreadTimeline ,
2727 peekHeldThreadTimeline ,
2828 peekRememberedThreadTimeline ,
29- rememberReadyThreadTimeline ,
3029 resolveThreadSwitchTimeline ,
31- timelineHasEphemeralPreviewUrls ,
3230 recallCheckoutIsRepo ,
3331 rememberCheckoutIsRepo ,
3432} from "./ChatView.logic" ;
@@ -235,11 +233,11 @@ import {
235233 resolveThreadDetailRef ,
236234 useEnvironmentSupportsServerBrowser ,
237235 useProject ,
238- useThreadProjection ,
236+ useQuietThreadProjection ,
237+ useQuietThreadVisibleTurnItems ,
239238 useThreadStatus ,
240239 useThreadHistory ,
241240 useQuietThreadShell ,
242- useThreadVisibleTurnItems ,
243241 useThreadCheckpointSummaries ,
244242} from "../state/entities" ;
245243import { useEnvironmentShellHasSnapshot } from "../state/shell" ;
@@ -254,7 +252,8 @@ import {
254252 RevertConfirmHost ,
255253} from "./chat/ChatOverlayHosts" ;
256254import type { AssistantCitationRequest } from "./chat/AssistantCitationSource" ;
257- import { MessagesTimeline , type MessagesTimelineHistoryControls } from "./chat/MessagesTimeline" ;
255+ import type { MessagesTimelineHistoryControls } from "./chat/MessagesTimeline" ;
256+ import { ThreadTimeline } from "./chat/ThreadTimeline" ;
258257import { ProviderSubagentBar } from "./chat/ProviderSubagentBar" ;
259258import { getTriggerDisplayModelName } from "./chat/providerIconUtils" ;
260259import {
@@ -461,7 +460,7 @@ export default function ChatView(props: ChatViewProps) {
461460 shellExists : serverThreadShell !== null ,
462461 waitForShell : draftThread !== null ,
463462 } ) ;
464- const serverThreadProjection = useThreadProjection ( routeThreadDetailRef ) ;
463+ const serverThreadProjection = useQuietThreadProjection ( routeThreadDetailRef ) ;
465464 const serverProjection = serverThreadProjection ?. projection ?? null ;
466465 const serverThread =
467466 serverThreadShell !== null || serverProjection === null
@@ -498,7 +497,7 @@ export default function ChatView(props: ChatViewProps) {
498497 serverProjection ,
499498 activeProviderThread ,
500499 ) ;
501- const serverVisibleTurnItems = useThreadVisibleTurnItems ( routeThreadDetailRef ) ;
500+ const serverVisibleTurnItems = useQuietThreadVisibleTurnItems ( routeThreadDetailRef ) ;
502501 const serverThreadHistory = useThreadHistory ( routeThreadDetailRef ) ;
503502 const threadHistoryControls = ( ( ) => {
504503 if ( routeThreadDetailRef === null || ! shouldShowLoadEarlierControl ( serverThreadHistory ) ) {
@@ -784,7 +783,7 @@ export default function ChatView(props: ChatViewProps) {
784783 thread : serverProjection . thread ,
785784 messages : serverProjection . messages ,
786785 } ) ;
787- const workflowOpeningParentProjection = useThreadProjection (
786+ const workflowOpeningParentProjection = useQuietThreadProjection (
788787 workflowOpeningParentId === null || parentSubagentEnvironmentId === null
789788 ? null
790789 : scopeThreadRef ( parentSubagentEnvironmentId , workflowOpeningParentId ) ,
@@ -1455,8 +1454,7 @@ export default function ChatView(props: ChatViewProps) {
14551454 { ...codexFeedbackMessage ( submission , "assistant" ) , runId : null } ,
14561455 ] ,
14571456 ) ;
1458- const serverTimelineEntries = useIncrementalTimelineEntries ( activeThreadKey , {
1459- visibleTurnItems : serverVisibleTurnItems ,
1457+ const timelineEntriesInput = {
14601458 optimisticMessages : optimisticUserMessages ,
14611459 anchoredMessages : anchoredTimelineMessages ,
14621460 attachmentUrlById : timelineAttachmentUrlById ,
@@ -1467,6 +1465,12 @@ export default function ChatView(props: ChatViewProps) {
14671465 nodes : serverProjection . nodes ,
14681466 plans : serverProjection . plans ,
14691467 } ) ,
1468+ } ;
1469+ // Held through streamed text, like serverVisibleTurnItems; ThreadTimeline
1470+ // derives the rows it renders from the live turn items.
1471+ const serverTimelineEntries = useIncrementalTimelineEntries ( activeThreadKey , {
1472+ ...timelineEntriesInput ,
1473+ visibleTurnItems : serverVisibleTurnItems ,
14701474 } ) ;
14711475 const draftTimelineEntries = optimisticUserMessages . map (
14721476 ( message ) =>
@@ -1636,21 +1640,6 @@ export default function ChatView(props: ChatViewProps) {
16361640 const activeProjectCwd = activeProject ?. workspaceRoot ?? null ;
16371641 const activeThreadWorktreePath = activeThread ?. worktreePath ?? null ;
16381642 const activeWorkspaceRoot = activeThreadWorktreePath ?? activeProjectCwd ?? undefined ;
1639- useLayoutEffect ( ( ) => {
1640- if (
1641- threadDetailLoading ||
1642- timelineEntries . length === 0 ||
1643- timelineHasEphemeralPreviewUrls ( timelineEntries )
1644- ) {
1645- return ;
1646- }
1647- rememberReadyThreadTimeline ( {
1648- threadKey : activeThreadKey ,
1649- entries : timelineEntries ,
1650- markdownCwd : gitCwd ,
1651- workspaceRoot : activeWorkspaceRoot ?? null ,
1652- } ) ;
1653- } , [ activeThreadKey , activeWorkspaceRoot , gitCwd , threadDetailLoading , timelineEntries ] ) ;
16541643 const heldPaintContext = paintOnlyDisplayedTimeline
16551644 ? peekHeldThreadTimeline < typeof timelineEntries > ( )
16561645 : null ;
@@ -3213,7 +3202,6 @@ export default function ChatView(props: ChatViewProps) {
32133202 thread : activeThreadRef ,
32143203 enabled :
32153204 isServerThread && serverConfig ?. threadFind === true && ! paintOnlyDisplayedTimeline ,
3216- content : serverProjection ?? undefined ,
32173205 } }
32183206 controlsRef = { threadFindControlsRef }
32193207 onOpenChange = { setIsThreadFindActive }
@@ -3244,7 +3232,15 @@ export default function ChatView(props: ChatViewProps) {
32443232 setThreadErrorBannerDismissTick = { setThreadErrorBannerDismissTick }
32453233 />
32463234 < div className = "relative flex min-h-0 flex-1 flex-col bg-background" >
3247- < MessagesTimeline
3235+ < ThreadTimeline
3236+ threadDetailRef = { routeThreadDetailRef }
3237+ entriesInput = { timelineEntriesInput }
3238+ draftEntries = { isServerThread ? null : draftTimelineEntries }
3239+ activeThreadKey = { activeThreadKey }
3240+ syncing = { threadSyncPhase !== null }
3241+ detailLoading = { threadDetailLoading }
3242+ readyMarkdownCwd = { gitCwd }
3243+ readyWorkspaceRoot = { activeWorkspaceRoot ?? null }
32483244 citationRequest = { paintOnlyDisplayedTimeline ? null : citationRequest }
32493245 citationHistoryLoading = { threadDetailLoading }
32503246 { ...( ! paintOnlyDisplayedTimeline
@@ -3298,7 +3294,6 @@ export default function ChatView(props: ChatViewProps) {
32983294 )
32993295 }
33003296 listRef = { legendListRef }
3301- timelineEntries = { displayedTimeline . entries }
33023297 runs = { paintOnlyDisplayedTimeline ? [ ] : ( serverProjection ?. runs ?? [ ] ) }
33033298 latestRun = { paintOnlyDisplayedTimeline ? null : activeActivityRun }
33043299 runningRunId = { paintOnlyDisplayedTimeline ? null : activeRunningTurnId }
0 commit comments