@@ -32,14 +32,7 @@ import { THREAD_FIND_BAR_RESERVED_HEIGHT } from "./chat/ThreadFindBar"; |
32 | 32 | import { usageLimitRecoveryBannerItem } from "./chat/UsageLimitRecoveryBanner"; |
33 | 33 | import { resolveDraftHeroState } from "./ChatView.logic"; |
34 | 34 | import { useQueuedRunEdit } from "./chat/useQueuedRunEdit"; |
35 | | -import { |
36 | | - isPaintOnlyThreadTimeline, |
37 | | - peekHeldThreadTimeline, |
38 | | - peekRememberedThreadTimeline, |
39 | | - resolveThreadSwitchTimeline, |
40 | | - recallCheckoutIsRepo, |
41 | | - rememberCheckoutIsRepo, |
42 | | -} from "./ChatView.logic"; |
| 35 | +import { recallCheckoutIsRepo, rememberCheckoutIsRepo } from "./ChatView.logic"; |
43 | 36 | import { useLogicalProjectEnvironments } from "../hooks/useLogicalProjectEnvironments"; |
44 | 37 | import { useStableCallback } from "../hooks/useStableCallback"; |
45 | 38 | import { useProjectScriptEditing } from "./chat/useProjectScriptEditing"; |
@@ -74,7 +67,6 @@ import { |
74 | 67 | type ServerProvider, |
75 | 68 | type ScopedThreadRef, |
76 | 69 | type ThreadId, |
77 | | - type RunId, |
78 | 70 | ProviderInteractionMode, |
79 | 71 | resolveIdleCompaction, |
80 | 72 | RuntimeMode, |
@@ -405,11 +397,6 @@ type ChatViewProps = |
405 | 397 | draftId: DraftId; |
406 | 398 | }; |
407 | 399 |
|
408 | | -const EMPTY_HELD_TURN_DIFF_SUMMARIES: readonly never[] = []; |
409 | | -const noopHeldTurnDiff = (_turnId: RunId, _filePath?: string) => {}; |
410 | | -const noopHeldRevert = (_targetTurnCount: number) => {}; |
411 | | -const noopHeldAttachment = (_attachment: ChatFileAttachment) => {}; |
412 | | - |
413 | 400 | export default function ChatView(props: ChatViewProps) { |
414 | 401 | const { |
415 | 402 | environmentId, |
@@ -1469,17 +1456,7 @@ export default function ChatView(props: ChatViewProps) { |
1469 | 1456 | entry.kind === "message" ? [entry.message] : [], |
1470 | 1457 | ); |
1471 | 1458 | const timelineEmpty = timelineEntries.length === 0 && !hasStreamedTimelineRows; |
1472 | | - const displayedTimeline = resolveThreadSwitchTimeline({ |
1473 | | - loading: timelineEmpty && threadSyncPhase !== null, |
1474 | | - activeThreadKey, |
1475 | | - nextEntries: timelineEntries, |
1476 | | - rememberedForActive: peekRememberedThreadTimeline<typeof timelineEntries>(activeThreadKey), |
1477 | | - }); |
1478 | | - const displayedTimelineKey = displayedTimeline.displayThreadKey ?? routeThreadKey; |
1479 | | - const paintOnlyDisplayedTimeline = isPaintOnlyThreadTimeline( |
1480 | | - displayedTimeline.displayThreadKey, |
1481 | | - activeThreadKey, |
1482 | | - ); |
| 1459 | + const displayedTimelineKey = activeThreadKey ?? routeThreadKey; |
1483 | 1460 | const displayedThreadRef = parseScopedThreadKey(displayedTimelineKey); |
1484 | 1461 | const { |
1485 | 1462 | worktreeSetup, |
@@ -1624,9 +1601,6 @@ export default function ChatView(props: ChatViewProps) { |
1624 | 1601 | const activeProjectCwd = activeProject?.workspaceRoot ?? null; |
1625 | 1602 | const activeThreadWorktreePath = activeThread?.worktreePath ?? null; |
1626 | 1603 | const activeWorkspaceRoot = activeThreadWorktreePath ?? activeProjectCwd ?? undefined; |
1627 | | - const heldPaintContext = paintOnlyDisplayedTimeline |
1628 | | - ? peekHeldThreadTimeline<typeof timelineEntries>() |
1629 | | - : null; |
1630 | 1604 | const activeTerminalLaunchContext = |
1631 | 1605 | terminalUiLaunchContext?.threadId === activeThreadId ? terminalUiLaunchContext : null; |
1632 | 1606 | const liveIsGitRepo = gitStatusQuery.data?.isRepo; |
@@ -2590,8 +2564,7 @@ export default function ChatView(props: ChatViewProps) { |
2590 | 2564 | const timelineSkills = activeProviderStatus |
2591 | 2565 | ? resolveProviderSkillsForCwd(activeProviderStatus, gitCwd) |
2592 | 2566 | : EMPTY_PROVIDER_SKILLS; |
2593 | | - const threadFindEnabled = |
2594 | | - isServerThread && serverConfig?.threadFind === true && !paintOnlyDisplayedTimeline; |
| 2567 | + const threadFindEnabled = isServerThread && serverConfig?.threadFind === true; |
2595 | 2568 | const isThreadFindActive = useThreadFindOpen(activeThreadRef, threadFindEnabled); |
2596 | 2569 |
|
2597 | 2570 | useChatShortcuts({ |
@@ -2669,7 +2642,6 @@ export default function ChatView(props: ChatViewProps) { |
2669 | 2642 | serverProjection, |
2670 | 2643 | activeThread, |
2671 | 2644 | timelineMessages, |
2672 | | - paintOnlyDisplayedTimeline, |
2673 | 2645 | phase, |
2674 | 2646 | isConnecting, |
2675 | 2647 | isSendBusy, |
@@ -3249,126 +3221,79 @@ export default function ChatView(props: ChatViewProps) { |
3249 | 3221 | activeThreadKey={activeThreadKey} |
3250 | 3222 | syncing={threadSyncPhase !== null} |
3251 | 3223 | detailLoading={threadDetailLoading} |
3252 | | - readyMarkdownCwd={gitCwd} |
3253 | | - readyWorkspaceRoot={activeWorkspaceRoot ?? null} |
3254 | | - citationRequest={paintOnlyDisplayedTimeline ? null : citationRequest} |
| 3224 | + citationRequest={citationRequest} |
3255 | 3225 | citationHistory={citationHistory} |
3256 | | - {...(!paintOnlyDisplayedTimeline |
3257 | | - ? { |
3258 | | - onCiteAssistantText: citeAssistantTextStable, |
3259 | | - ...(activeProject ? { onRunShellCommand: runShellCommandStable } : {}), |
3260 | | - } |
3261 | | - : {})} |
3262 | | - isWorking={!paintOnlyDisplayedTimeline && isWorking} |
| 3226 | + onCiteAssistantText={citeAssistantTextStable} |
| 3227 | + {...(activeProject ? { onRunShellCommand: runShellCommandStable } : {})} |
| 3228 | + isWorking={isWorking} |
3263 | 3229 | runlessWorkActive={runlessWorkStartedAt !== null} |
3264 | | - activeTurnInProgress={ |
3265 | | - !paintOnlyDisplayedTimeline && (isWorking || !latestRunSettled) |
3266 | | - } |
3267 | | - isCompacting={!paintOnlyDisplayedTimeline && isCompacting} |
| 3230 | + activeTurnInProgress={isWorking || !latestRunSettled} |
| 3231 | + isCompacting={isCompacting} |
3268 | 3232 | awaitingUser={ |
3269 | | - paintOnlyDisplayedTimeline |
3270 | | - ? null |
3271 | | - : activePendingApproval !== null |
3272 | | - ? "approval" |
3273 | | - : activePendingUserInput !== null || |
3274 | | - // A secret request has no runtime request; the shell carries it. |
3275 | | - activeThreadShell?.hasPendingUserInput === true |
3276 | | - ? "input" |
3277 | | - : null |
| 3233 | + activePendingApproval !== null |
| 3234 | + ? "approval" |
| 3235 | + : activePendingUserInput !== null || |
| 3236 | + // A secret request has no runtime request; the shell carries it. |
| 3237 | + activeThreadShell?.hasPendingUserInput === true |
| 3238 | + ? "input" |
| 3239 | + : null |
3278 | 3240 | } |
3279 | 3241 | awaitingRequestId={ |
3280 | | - paintOnlyDisplayedTimeline |
3281 | | - ? null |
3282 | | - : (activePendingApproval?.requestId ?? |
3283 | | - activePendingUserInput?.requestId ?? |
3284 | | - null) |
| 3242 | + activePendingApproval?.requestId ?? activePendingUserInput?.requestId ?? null |
3285 | 3243 | } |
3286 | | - activeTurnStartedAt={paintOnlyDisplayedTimeline ? null : activeWorkStartedAt} |
3287 | | - worktreeSetup={paintOnlyDisplayedTimeline ? null : worktreeSetup} |
| 3244 | + activeTurnStartedAt={activeWorkStartedAt} |
| 3245 | + worktreeSetup={worktreeSetup} |
3288 | 3246 | onCancelWorktreeSetup={onCancelWorktreeSetupStable} |
3289 | | - {...(paintOnlyDisplayedTimeline |
3290 | | - ? {} |
3291 | | - : { |
3292 | | - retryableWorkspacePreparationRunIds, |
3293 | | - onRetryWorkspacePreparation: onRetryWorkspacePreparationStable, |
3294 | | - })} |
| 3247 | + retryableWorkspacePreparationRunIds={retryableWorkspacePreparationRunIds} |
| 3248 | + onRetryWorkspacePreparation={onRetryWorkspacePreparationStable} |
3295 | 3249 | {...(draftId |
3296 | 3250 | ? { onWorktreeSetupWorkLocally: onWorktreeSetupWorkLocallyStable } |
3297 | 3251 | : {})} |
3298 | 3252 | {...(onOpenWorktreeSetupTerminal ? { onOpenWorktreeSetupTerminal } : {})} |
3299 | | - isPreparingWorktree={!paintOnlyDisplayedTimeline && isPreparingWorktree} |
3300 | | - footer={paintOnlyDisplayedTimeline ? null : timelineFooter} |
| 3253 | + isPreparingWorktree={isPreparingWorktree} |
| 3254 | + footer={timelineFooter} |
3301 | 3255 | listRef={legendListRef} |
3302 | | - runs={paintOnlyDisplayedTimeline ? [] : (serverProjection?.runs ?? [])} |
3303 | | - latestRun={paintOnlyDisplayedTimeline ? null : activeActivityRun} |
3304 | | - announcedRun={ |
3305 | | - paintOnlyDisplayedTimeline |
3306 | | - ? null |
3307 | | - : announcedRun(activeActivityRun, serverProjection?.runs ?? []) |
3308 | | - } |
3309 | | - detailBehindShell={ |
3310 | | - !paintOnlyDisplayedTimeline && |
3311 | | - isDetailBehindShell(activeLatestRun, activeThreadShell?.latestRun ?? null) |
3312 | | - } |
3313 | | - runningRunId={paintOnlyDisplayedTimeline ? null : activeRunningTurnId} |
3314 | | - turnDiffSummaries={ |
3315 | | - paintOnlyDisplayedTimeline ? EMPTY_HELD_TURN_DIFF_SUMMARIES : turnDiffSummaries |
3316 | | - } |
| 3256 | + runs={serverProjection?.runs ?? []} |
| 3257 | + latestRun={activeActivityRun} |
| 3258 | + announcedRun={announcedRun(activeActivityRun, serverProjection?.runs ?? [])} |
| 3259 | + detailBehindShell={isDetailBehindShell( |
| 3260 | + activeLatestRun, |
| 3261 | + activeThreadShell?.latestRun ?? null, |
| 3262 | + )} |
| 3263 | + runningRunId={activeRunningTurnId} |
| 3264 | + turnDiffSummaries={turnDiffSummaries} |
3317 | 3265 | activeThreadEnvironmentId={ |
3318 | 3266 | displayedThreadRef?.environmentId ?? activeThread.environmentId |
3319 | 3267 | } |
3320 | 3268 | routeThreadKey={displayedTimelineKey} |
3321 | 3269 | displayThreadKey={displayedTimelineKey} |
3322 | | - paintOnly={paintOnlyDisplayedTimeline} |
3323 | 3270 | announceTurnStatus={!isProviderSubagent} |
3324 | | - onOpenTurnDiff={ |
3325 | | - paintOnlyDisplayedTimeline ? noopHeldTurnDiff : onOpenTurnDiffStable |
3326 | | - } |
| 3271 | + onOpenTurnDiff={onOpenTurnDiffStable} |
3327 | 3272 | onOpenThread={onOpenRelatedThreadStable} |
3328 | | - parentThreadLink={paintOnlyDisplayedTimeline ? null : parentThreadLink} |
3329 | | - workflowOpening={paintOnlyDisplayedTimeline ? null : workflowOpening} |
3330 | | - onForkFromRun={paintOnlyDisplayedTimeline ? async () => {} : onForkFromRunStable} |
| 3273 | + parentThreadLink={parentThreadLink} |
| 3274 | + workflowOpening={workflowOpening} |
| 3275 | + onForkFromRun={onForkFromRunStable} |
3331 | 3276 | onRollbackCheckpoint={onTimelineRollbackCheckpointStable} |
3332 | | - supportsConversationRollback={ |
3333 | | - !paintOnlyDisplayedTimeline && supportsConversationRollback |
3334 | | - } |
| 3277 | + supportsConversationRollback={supportsConversationRollback} |
3335 | 3278 | threadStartCheckpointReady={threadStartCheckpointReady} |
3336 | 3279 | availableRevertTurnCounts={availableRevertTurnCounts} |
3337 | | - onRevertToTurnCount={ |
3338 | | - paintOnlyDisplayedTimeline ? noopHeldRevert : onRevertTimelineTurnStable |
3339 | | - } |
3340 | | - {...(!paintOnlyDisplayedTimeline |
3341 | | - ? { |
3342 | | - onUseArtifactTemplate: insertArtifactTemplateStable, |
3343 | | - onSendAppMessage: sendAppMessageStable, |
3344 | | - } |
3345 | | - : {})} |
| 3280 | + onRevertToTurnCount={onRevertTimelineTurnStable} |
| 3281 | + onUseArtifactTemplate={insertArtifactTemplateStable} |
| 3282 | + onSendAppMessage={sendAppMessageStable} |
3346 | 3283 | isRevertingCheckpoint={isRevertingCheckpoint} |
3347 | 3284 | onImageExpand={onExpandTimelineImageStable} |
3348 | | - onFileOpen={ |
3349 | | - paintOnlyDisplayedTimeline ? noopHeldAttachment : openFileAttachmentStable |
3350 | | - } |
3351 | | - onFileDownload={ |
3352 | | - paintOnlyDisplayedTimeline ? noopHeldAttachment : downloadFileAttachmentStable |
3353 | | - } |
3354 | | - markdownCwd={ |
3355 | | - paintOnlyDisplayedTimeline |
3356 | | - ? (heldPaintContext?.markdownCwd ?? undefined) |
3357 | | - : (gitCwd ?? undefined) |
3358 | | - } |
| 3285 | + onFileOpen={openFileAttachmentStable} |
| 3286 | + onFileDownload={downloadFileAttachmentStable} |
| 3287 | + markdownCwd={gitCwd ?? undefined} |
3359 | 3288 | resolvedTheme={resolvedTheme} |
3360 | 3289 | timestampFormat={timestampFormat} |
3361 | | - workspaceRoot={ |
3362 | | - paintOnlyDisplayedTimeline |
3363 | | - ? (heldPaintContext?.workspaceRoot ?? undefined) |
3364 | | - : activeWorkspaceRoot |
3365 | | - } |
| 3290 | + workspaceRoot={activeWorkspaceRoot} |
3366 | 3291 | skills={timelineSkills} |
3367 | | - anchorMessageId={paintOnlyDisplayedTimeline ? null : timelineAnchorMessageId} |
| 3292 | + anchorMessageId={timelineAnchorMessageId} |
3368 | 3293 | onAnchorReady={onTimelineAnchorReadyStable} |
3369 | 3294 | onAnchorSizeChanged={onTimelineAnchorSizeChangedStable} |
3370 | 3295 | contentInsetEndAdjustment={composerTimelineInset} |
3371 | | - liveFollowEnabled={!paintOnlyDisplayedTimeline && timelineLiveFollowEnabled} |
| 3296 | + liveFollowEnabled={timelineLiveFollowEnabled} |
3372 | 3297 | onIsAtEndChange={onIsAtEndChangeStable} |
3373 | 3298 | onContentOverflowChange={setTimelineOverflows} |
3374 | 3299 | onToolOutputCollapsedAtEnd={onToolOutputCollapsedAtEndStable} |
@@ -3377,7 +3302,7 @@ export default function ChatView(props: ChatViewProps) { |
3377 | 3302 | hideEmptyPlaceholder={isDraftHeroState || threadDetailLoading} |
3378 | 3303 | emptyPlaceholderInset={composerReservedHeight} |
3379 | 3304 | topFadeEnabled={!hasTimelineTopBanner} |
3380 | | - {...(paintOnlyDisplayedTimeline || threadHistoryControls === undefined |
| 3305 | + {...(threadHistoryControls === undefined |
3381 | 3306 | ? {} |
3382 | 3307 | : { historyControls: threadHistoryControls })} |
3383 | 3308 | /> |
|