TypeScript
feat(web): thread state lives at the end of the timeline, not stacked on the composer (#25401)
Theo Brownebd3287b640a7
diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsxindex 6d608595848..8bf2ab68558 100644--- a/apps/web/src/components/ChatView.tsx+++ b/apps/web/src/components/ChatView.tsx@@ -86,7 +86,10 @@ import {resolveWorkflowOpening,workflowOpeningParentThreadId,} from "@t3tools/client-runtime/state/subagentRuntime";-import { threadSupportsProviderHandoff } from "@t3tools/client-runtime/state/thread-workflows";+import {+ getUserQueuedThreadRuns,+ threadSupportsProviderHandoff,+} from "@t3tools/client-runtime/state/thread-workflows";import { resolvePendingHandoff } from "@t3tools/client-runtime/handoff";import { HandoffRow } from "./chat/V2LifecycleRow";import {@@ -126,8 +129,6 @@ import { useActiveThreadRef } from "../hooks/useActiveThreadRef";import { composerRequiresModifier } from "../composer-logic";import {derivePhase,- deriveActivePlanState,- selectComposerTasksPlan,deriveActiveWorkStartedAt,deriveCanInterruptRunningThread,findLatestProposedPlan,@@ -352,6 +353,8 @@ import { ChatTerminalDrawers } from "./chat/ChatTerminalDrawers";import { ChatRightPanel } from "./chat/ChatRightPanel";import { useDraftEnvironmentRouting } from "./chat/useDraftEnvironmentRouting";import { branchMismatchBannerItem } from "./chat/ThreadActivityBanners";+import { ThreadNow } from "./chat/ThreadNow";+import { useDelayedStatus } from "../hooks/useDelayedStatus";import { useTimelineFollow } from "./chat/useTimelineFollow";import {type EnvironmentUnavailableState,@@ -512,6 +515,8 @@ export default function ChatView(props: ChatViewProps) {status: threadStatus,});const threadDetailLoading = threadSyncPhase === "loading";+ // Held back briefly, so a quick sync does not flash a status line at the end of the timeline.+ const delayedThreadSyncPhase = useDelayedStatus(routeThreadKey, threadSyncPhase);const activeProviderThread = serverProjection?.providerThreads.find((thread) => thread.id === serverProjection.thread.activeProviderThreadId,);@@ -989,30 +994,6 @@ export default function ChatView(props: ChatViewProps) {);const latestRunSettled = isLatestRunSettled(activeLatestRun, activeRuntime);- const activePlan = deriveActivePlanState(serverProjection, activeActivityRun?.runId);- const activeActivityRunSettled = isLatestRunSettled(activeActivityRun, activeRuntime);- const composerTasksPlan = selectComposerTasksPlan(- serverProjection,- activePlan,- activeActivityRun?.runId ?? null,- activeActivityRunSettled,- );- const activeComposerTasksProgress = (() => {- if (!composerTasksPlan) return null;- const live = !activeActivityRunSettled && composerTasksPlan.runId === activeActivityRun?.runId;- const totalSteps = composerTasksPlan.steps.length;- if (totalSteps === 0) return null;- const completedSteps = composerTasksPlan.steps.filter(- (step) => step.status === "completed",- ).length;- const step =- composerTasksPlan.steps.find((candidate) => candidate.status === "inProgress")?.step ??- composerTasksPlan.steps.find((candidate) => candidate.status === "pending")?.step ??- composerTasksPlan.steps.at(-1)!.step;- return { step, completedSteps, totalSteps, live };- })();- const activeComposerTaskSteps =- activeComposerTasksProgress && composerTasksPlan ? composerTasksPlan.steps : null;const activeThreadEnvironmentId = activeThread?.environmentId;const activeThreadProjectId = activeThread?.projectId;const activeProjectRef =@@ -2007,6 +1988,7 @@ export default function ChatView(props: ChatViewProps) {onTimelineAnchorReadyStable,onTimelineAnchorSizeChangedStable,onToolOutputCollapsedAtEndStable,+ onTimelineFooterGrowStable,onIsAtEndChangeStable,anchorNewTurn,attachTimelineViewport,@@ -2185,22 +2167,11 @@ export default function ChatView(props: ChatViewProps) {modelStrip.offsetHeight + Number.parseFloat(getComputedStyle(modelStrip).marginTop),): 0;- const noticeStack = composerOverlayElement?.querySelector<HTMLElement>(- '[data-composer-banner-stack="true"]',- );- const expandedNoticesHeight = noticeStack- ? Math.max(- 0,- noticeStack.getBoundingClientRect().height -- Number.parseFloat(getComputedStyle(noticeStack).minHeight),- )- : 0;const nextInset = resolveComposerTimelineInset({currentInset: composerTimelineInsetRef.current,overlayHeight: height,isResting,restingOnlyHeight,- expandedNoticesHeight,});if (composerTimelineInsetRef.current !== nextInset) {composerTimelineInsetRef.current = nextInset;@@ -2226,9 +2197,8 @@ export default function ChatView(props: ChatViewProps) {const mainSurface = composerOverlayElement?.querySelector<HTMLElement>('[data-chat-composer-main-surface="true"]',);- const button = composerOverlayElement?.parentElement?.querySelector<HTMLElement>(- 'button[aria-label="Scroll to end"]',- );+ const button =+ composerOverlayElement?.parentElement?.querySelector<HTMLElement>("[data-scroll-to-end]");const clearance =composerOverlayElement && mainSurface && button? resolveScrollToEndClearance({@@ -2383,9 +2353,9 @@ export default function ChatView(props: ChatViewProps) {const {acknowledgeActiveThreadWoke,activeBranchMismatchKey,- backgroundWorkBanner,- childInputBanner,- goalBanner,+ backgroundWorkNow,+ childInputNow,+ goalNow,handleSwitchCheckoutToThread,handleSwitchCheckoutToThreadStable,isRestoringThreadBranch,@@ -2550,9 +2520,6 @@ export default function ChatView(props: ChatViewProps) {: null;const composerBannerItems = (() => {const limitRecoveryItems = limitRecoveryBanner === null ? [] : [limitRecoveryBanner];- const backgroundWorkItems = [childInputBanner, goalBanner, backgroundWorkBanner].filter(- (item) => item !== null,- );const usageLimitsItems = usageLimitsBanner === null ? [] : [usageLimitsBanner];const projectCloneItems = projectCloneBannerItem === null ? [] : [projectCloneBannerItem];if (!localCheckoutBranchMismatch || !showBranchMismatchBanner || !activeBranchMismatchKey) {@@ -2562,7 +2529,6 @@ export default function ChatView(props: ChatViewProps) {...usageLimitsItems,...projectCloneItems,...systemComposerBannerItems,- ...backgroundWorkItems,];}return [@@ -2571,7 +2537,6 @@ export default function ChatView(props: ChatViewProps) {...usageLimitsItems,...projectCloneItems,...systemComposerBannerItems,- ...backgroundWorkItems,branchMismatchBannerItem({mismatchKey: activeBranchMismatchKey,mismatch: localCheckoutBranchMismatch,@@ -2979,6 +2944,66 @@ export default function ChatView(props: ChatViewProps) {openExpandedImagePreview(routeThreadKey, preview);};const onExpandTimelineImageStable = useStableCallback(onExpandTimelineImage);+ const shownThreadSyncPhase = activeEnvironmentUnavailable ? null : delayedThreadSyncPhase;+ const hasThreadNow =+ childInputNow !== null ||+ backgroundWorkNow !== null ||+ goalNow !== null ||+ shownThreadSyncPhase !== null;+ const queuedRunCount = serverProjection ? getUserQueuedThreadRuns(serverProjection).length : 0;+ // The queue control is mounted for every server thread but joins the footer only while it shows+ // something, by its own rule: an optimistic message stops counting once the server has it.+ const hasQueuedTurns =+ queuedRunCount > 0 ||+ optimisticUserMessages.some(+ (message) =>+ message.inputIntent === "queued_turn" &&+ !serverProjection?.messages.some((committed) => committed.id === message.id),+ );+ const scrollToEndSummary =+ [+ childInputNow === null ? null : "Subagent waiting",+ queuedRunCount === 0 ? null : `${queuedRunCount} queued`,+ ]+ .filter((part) => part !== null)+ .join(" · ") || null;+ // The end of the timeline holds the thread's present and next turns: what it is doing now,+ // its lifecycle status, guest messages awaiting you, then your queued messages.+ const timelineFooter =+ pendingHandoff === null &&+ !hasThreadNow &&+ threadStatusLine === null &&+ pendingGuestMessageCount === 0 &&+ !hasQueuedTurns ? null : (+ <>+ {pendingHandoff === null ? null : (+ <div className="chat-content-lane">+ <HandoffRow+ environmentId={environmentId}+ endpoints={pendingHandoff}+ providers={providerStatuses}+ pending+ />+ </div>+ )}+ <ThreadNow+ key={routeThreadKey}+ attention={childInputNow}+ work={backgroundWorkNow}+ syncPhase={shownThreadSyncPhase}+ goal={goalNow}+ />+ {threadStatusLine}+ {pendingGuestMessageCount > 0 && isServerThread && activeThread ? (+ <GuestPendingMessages+ threadRef={scopeThreadRef(activeThread.environmentId, activeThread.id)}+ onImageExpand={onExpandTimelineImageStable}+ onFileOpen={openFileAttachmentStable}+ />+ ) : null}+ {hasQueuedTurns ? queuedRunsControl : null}+ </>+ );const pendingSidebarFileDrops = useSidebarPendingFileDropStore((state) => state.pending);const consumePendingFileDrop = useSidebarPendingFileDropStore(@@ -3265,33 +3290,7 @@ export default function ChatView(props: ChatViewProps) {: {})}{...(onOpenWorktreeSetupTerminal ? { onOpenWorktreeSetupTerminal } : {})}isPreparingWorktree={!paintOnlyDisplayedTimeline && isPreparingWorktree}- footer={- paintOnlyDisplayedTimeline ||- (pendingHandoff === null &&- pendingGuestMessageCount === 0 &&- threadStatusLine === null) ? null : (- <>- {pendingHandoff === null ? null : (- <div className="chat-content-lane">- <HandoffRow- environmentId={environmentId}- endpoints={pendingHandoff}- providers={providerStatuses}- pending- />- </div>- )}- {pendingGuestMessageCount > 0 && isServerThread && activeThread ? (- <GuestPendingMessages- threadRef={scopeThreadRef(activeThread.environmentId, activeThread.id)}- onImageExpand={onExpandTimelineImageStable}- onFileOpen={openFileAttachmentStable}- />- ) : null}- {threadStatusLine}- </>- )- }+ footer={paintOnlyDisplayedTimeline ? null : timelineFooter}listRef={legendListRef}runs={paintOnlyDisplayedTimeline ? [] : (serverProjection?.runs ?? [])}latestRun={paintOnlyDisplayedTimeline ? null : activeActivityRun}@@ -3367,6 +3366,7 @@ export default function ChatView(props: ChatViewProps) {onContentOverflowChange={setTimelineOverflows}onToolOutputCollapsedAtEnd={onToolOutputCollapsedAtEndStable}onViewportAttach={attachTimelineViewport}+ onFooterGrow={onTimelineFooterGrowStable}hideEmptyPlaceholder={isDraftHeroState || threadDetailLoading}emptyPlaceholderInset={composerReservedHeight}topFadeEnabled={!hasTimelineTopBanner}@@ -3378,6 +3378,7 @@ export default function ChatView(props: ChatViewProps) {{showScrollToBottom && !isThreadFindActive && (<ScrollToEndButtonbottom={scrollToEndClearance + 4}+ summary={scrollToEndSummary}onScrollToEnd={() => {composerRef.current?.restoreAfterTimelineReachedEnd();scrollToEnd(true);@@ -3521,7 +3522,6 @@ export default function ChatView(props: ChatViewProps) {: projectCloneSendBlockReason}isPreparingWorktree={isPreparingWorktree && !sendQueuesBehindSetup}- queuedRunsControl={queuedRunsControl}bannerItems={composerBannerItems}resumeCompactionTokens={resumeCompactionTokens}keepFullHistory={keepFullHistory}@@ -3559,8 +3559,6 @@ export default function ChatView(props: ChatViewProps) {activeThreadModelSelection={activeThread?.modelSelection}activeProjectId={activeProject?.id ?? null}activeContextWindow={activeContextWindow}- activeTasksProgress={activeComposerTasksProgress}- activeTaskSteps={activeComposerTaskSteps}compactThreadUnavailable={compactThreadUnavailable}compactDisabled={compactDisabled}compactDisabledReason={compactDisabledReason}diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsxindex caae00048fc..d7b46eea0ab 100644--- a/apps/web/src/components/chat/ChatComposer.tsx+++ b/apps/web/src/components/chat/ChatComposer.tsx@@ -48,7 +48,6 @@ import { createModelSelection, normalizeModelSlug } from "@t3tools/shared/model"import { USAGE_LIMITS_COMMAND } from "@t3tools/shared/usageLimits";import {memo,- type ReactNode,useEffect,useEffectEvent,useId,@@ -105,14 +104,6 @@ import { useComposerTriggerState } from "./useComposerTriggerState";import { useComposerMenuItems } from "./useComposerMenuItems";import { useComposerFocusState } from "./useComposerFocusState";import { useComposerMultilinePrompt } from "./useComposerMultilinePrompt";-import {- ComposerTasksBadge,- ComposerTasksContent,- ComposerTasksDrawer,- type ComposerTaskStep,- type ComposerTasksProgress,-} from "./ComposerTasksBadge";-import { ComposerActivityRow } from "./ComposerActivityStatus";import {reconcileAttachmentContextReferences,useRetainedContextPayloads,@@ -120,11 +111,7 @@ import {import type { ThreadSyncPhase } from "../../threadSync";import { ComposerBanner } from "./ComposerBanner";import { ComposerSurface } from "./ComposerSurface";-import {- ComposerBannerStack,- type ComposerBannerStackContent,- type ComposerBannerStackItem,-} from "./ComposerBannerStack";+import { ComposerBannerStack, type ComposerBannerStackItem } from "./ComposerBannerStack";import {attachmentsToReleaseOnUploadCapabilityLoss,composerOtherFilesForPresentation,@@ -274,7 +261,6 @@ import {resolveProviderSkillsForCwd,resolveProviderSlashCommandsForCwd,} from "@t3tools/client-runtime/providerSkills";-import { useDelayedStatus } from "../../hooks/useDelayedStatus";import { useMediaQuery } from "../../hooks/useMediaQuery";import { useSoftwareKeyboardOpen } from "../../hooks/useSoftwareKeyboardOpen";import { useStableCallback } from "../../hooks/useStableCallback";@@ -435,8 +421,6 @@ export interface ChatComposerProps {showPlanFollowUpPrompt: boolean;activeProposedPlan: LatestProposedPlanState | null;- activeTasksProgress: ComposerTasksProgress | null;- activeTaskSteps: readonly ComposerTaskStep[] | null;threadSyncPhase: ThreadSyncPhase | null;runtimeMode: RuntimeMode;@@ -481,7 +465,6 @@ export interface ChatComposerProps {onPageScrollKeyUp: (key: string) => void;onPageScrollRelease: () => void;- queuedRunsControl?: ReactNode;editingQueuedAttachments: ReadonlyArray<{readonly attachment: ContractChatAttachment;readonly url: string | null;@@ -663,9 +646,6 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)const activePendingProgress = holdingUserInput ? null : incomingPendingProgress;const activePendingIsResponding = !holdingUserInput && incomingPendingIsResponding;const isLiteralPendingAnswer = activePendingProgress?.activeQuestion?.initialAnswer !== undefined;- const shownSyncPhase = useDelayedStatus(composerDraftTargetKey, props.threadSyncPhase);- const activeTasksProgress = shownSyncPhase === null ? props.activeTasksProgress : null;- const activeTaskSteps = shownSyncPhase === null ? props.activeTaskSteps : null;const isEditingQueuedMessage = editingQueuedAttachments !== null;const composerDraft = useComposerThreadDraft(composerDraftTarget);const composerDraftTargetKeyRef = useRef("");@@ -1097,7 +1077,6 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)const [composerMenuAnchor, setComposerMenuAnchor] = useState<HTMLDivElement | null>(null);const [hasWrappedPrompt, observeWrappedPrompt] = useComposerMultilinePrompt();const hasMultilinePrompt = prompt.includes("\n") || hasWrappedPrompt;- const [isTasksDrawerOpen, setIsTasksDrawerOpen] = useState(false);// A pending question stays expanded: its card moves into the banner dock,// so collapsing would leave the surface empty and squashed beneath it.const isComposerCollapsedMobile =@@ -2309,28 +2288,8 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)importContextRecords,expandMobileComposer: expandMobileComposerStable,});- const toggleTasksDrawer = () => {- setIsTasksDrawerOpen((open) => !open);- };- const toggleTasksDrawerStable = useStableCallback(toggleTasksDrawer);- const hasBannerItems = props.bannerItems.length > 0;const hasBlockingComposerTopDrawer =activePendingApproval !== null || pendingUserInputs.length > 0;- const showInlineTasksBadge =- activeTasksProgress !== null &&- activeTaskSteps !== null &&- !isTasksDrawerOpen &&- !hasBlockingComposerTopDrawer &&- (hasBannerItems || showComposerTopDrawer || isComposerCollapsedMobile);- const inlineTasksBadge = showInlineTasksBadge ? (- <ComposerTasksBadge- expanded={false}- onToggle={toggleTasksDrawerStable}- placement="inline"- progress={activeTasksProgress}- steps={activeTaskSteps}- />- ) : null;const hasImageAttachmentAttention = standaloneComposerImages.some((image) => {const upload = uploadsByImageId[image.id];const failedInCurrentEnvironment =@@ -2341,7 +2300,6 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)});const composerHasExpandedChrome =showComposerTopDrawer ||- isTasksDrawerOpen ||composerMenuOpen ||isStashMenuOpen ||isDragOverComposer ||@@ -2421,8 +2379,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)canTrackComposerScrollGesture &&settings.composerCollapseOnScroll &&!hasMultilinePrompt &&- !composerHasExpandedChrome &&- !showInlineTasksBadge;+ !composerHasExpandedChrome;const composerScrollCollapseEligible = canScrollCollapseComposer && !isComposerResting;useLayoutEffect(() => {composerScrollCollapseEligibleRef.current = composerScrollCollapseEligible;@@ -2586,48 +2543,14 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)getModelDisabledReason={getModelDisabledReason}/>);- const showTasksTab =- !hasBannerItems &&- !showComposerTopDrawer &&- !isTasksDrawerOpen &&- !isComposerCollapsedMobile &&- activeTasksProgress !== null &&- activeTaskSteps !== null &&- activeTasksProgress.totalSteps > 0;- const activityStackContent = hasBannerItems ? (- shownSyncPhase ? (- <ComposerActivityRow phase={shownSyncPhase} />- ) : !hasBlockingComposerTopDrawer && activeTasksProgress && activeTaskSteps ? (- <ComposerTasksContent- expanded={isTasksDrawerOpen}- onToggle={toggleTasksDrawerStable}- progress={activeTasksProgress}- steps={activeTaskSteps}- />- ) : null- ) : null;- const activityStackItem: ComposerBannerStackContent | null = activityStackContent- ? {- id: "composer-activity",- variant: "default",- priority: "activity",- content: activityStackContent,- }- : null;- const bannerStackItems = activityStackItem- ? [activityStackItem, ...props.bannerItems]+ // An open approval or question owns the space above the composer. Only a machine problem,+ // which is why an answer could not go through, stays beside it.+ const shelfItems = hasBlockingComposerTopDrawer+ ? props.bannerItems.filter(+ (item) =>+ item.group === "environment" && (item.variant === "error" || item.variant === "warning"),+ ): props.bannerItems;- const [tasksDrawerThreadId, setTasksDrawerThreadId] = useState(activeThreadId);- if (- isTasksDrawerOpen &&- (activeTasksProgress === null ||- activeTaskSteps === null ||- hasBlockingComposerTopDrawer ||- tasksDrawerThreadId !== activeThreadId)- ) {- setIsTasksDrawerOpen(false);- }- if (tasksDrawerThreadId !== activeThreadId) setTasksDrawerThreadId(activeThreadId);const insertComposerText = (text: string,@@ -3478,20 +3401,8 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps): null}<ComposerBanner.Dock><ComposerBanner.Column>- <ComposerBannerStack- key={activeThreadId}- className="relative z-0"- items={bannerStackItems}- attachedAbove={props.queuedRunsControl}- />- {!activityStackItem && (shownSyncPhase || inlineTasksBadge) ? (- <ComposerBanner.Attachment>- <ComposerBanner.Root data-chat-composer-activity-strip="true">- {shownSyncPhase ? <ComposerActivityRow phase={shownSyncPhase} /> : inlineTasksBadge}- </ComposerBanner.Root>- </ComposerBanner.Attachment>- ) : null}- {showComposerTopDrawer && (!isTasksDrawerOpen || hasBlockingComposerTopDrawer) ? (+ <ComposerBannerStack items={shelfItems} />+ {showComposerTopDrawer ? (<ComposerBanner.Attachment><ComposerBanner.Rootdata-chat-composer-top-drawer="true"@@ -3551,27 +3462,6 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)</ComposerBanner.Root></ComposerBanner.Attachment>) : null}- {!activityStackItem &&- isTasksDrawerOpen &&- !hasBlockingComposerTopDrawer &&- activeTasksProgress &&- activeTaskSteps ? (- <ComposerTasksDrawer- onCollapse={toggleTasksDrawerStable}- progress={activeTasksProgress}- steps={activeTaskSteps}- />- ) : null}- {showTasksTab ? (- <ComposerBanner.Attachment>- <ComposerTasksBadge- expanded={false}- onToggle={toggleTasksDrawerStable}- progress={activeTasksProgress}- steps={activeTaskSteps}- />- </ComposerBanner.Attachment>- ) : null}</ComposerBanner.Column><ComposerStashBadgecount={stashQueue.length}diff --git a/apps/web/src/components/chat/ComposerActivityStatus.tsx b/apps/web/src/components/chat/ComposerActivityStatus.tsxdeleted file mode 100644index 7a8b83ae736..00000000000--- a/apps/web/src/components/chat/ComposerActivityStatus.tsx+++ /dev/null@@ -1,23 +0,0 @@-import { Spinner } from "~/components/ui/spinner";--import { threadSyncLabel, type ThreadSyncPhase } from "../../threadSync";-import { ComposerBanner } from "./ComposerBanner";--export function ComposerActivityRow({ phase }: { readonly phase: ThreadSyncPhase }) {- return (- <ComposerBanner.Row>- <ComposerBanner.Icon>- <Spinner />- </ComposerBanner.Icon>- <ComposerBanner.Content>- <span- className="shrink-0 whitespace-nowrap text-muted-foreground"- data-composer-sync-status={phase}- role="status"- >- {threadSyncLabel(phase)}- </span>- </ComposerBanner.Content>- </ComposerBanner.Row>- );-}diff --git a/apps/web/src/components/chat/ComposerBanner.tsx b/apps/web/src/components/chat/ComposerBanner.tsxindex be7e268ccb4..ef07497171e 100644--- a/apps/web/src/components/chat/ComposerBanner.tsx+++ b/apps/web/src/components/chat/ComposerBanner.tsx@@ -34,26 +34,22 @@ const variantColors: Record<ComposerBannerVariant, string> = {};function Surface({- placement = "attached",variant = "default",className,...props}: ComponentProps<"div"> & {- placement?: "attached" | "floating";variant?: ComposerBannerVariant;}) {return (<div- data-composer-banner-surface={placement}+ data-composer-banner-surface="attached"data-variant={variant}className={cn(surfaceColors,"relative isolate border-0 bg-transparent shadow-none [--chat-composer-attached-tint:transparent]",variantColors[variant],// Bleed the mask 1px past the seam to cover Chromium's fractional-pixel backdrop loss.- placement === "attached"- ? "[--chat-composer-attachment-overlap:calc(1rem+1px)] before:rounded-t-2xl before:mask-t-from-transparent before:mask-t-from-4 before:mask-t-to-black before:mask-t-to-4"- : "[--chat-composer-attachment-overlap:0px] before:rounded-2xl",+ "[--chat-composer-attachment-overlap:calc(1rem+1px)] before:rounded-t-2xl before:mask-t-from-transparent before:mask-t-from-4 before:mask-t-to-black before:mask-t-to-4","before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:border before:border-(--chat-composer-attached-outline)","before:bg-(--chat-composer-attached-surface)/(--glass-opacity) before:bg-linear-to-b before:from-(--chat-composer-attached-tint) before:to-(--chat-composer-attached-tint) before:backdrop-blur-(--glass-blur) before:backdrop-saturate-(--glass-saturation)","before:shadow-composer dark:before:shadow-composer-dark",@@ -66,38 +62,6 @@ function Surface({);}-const peekBorder: Record<ComposerBannerVariant, string> = {- default: "border-(--chat-composer-attached-outline)",- error: "border-destructive/24",- info: "border-(--chat-composer-attached-outline)",- success: "border-(--chat-composer-attached-outline)",- warning: "border-warning/24",-};--function Peek({- className,- variant = "default",- ...props-}: ComponentProps<"button"> & { variant?: ComposerBannerVariant }) {- return (- <button- type="button"- data-slot="composer-banner-peek"- className={cn(- surfaceColors,- neutralOutline,- "absolute inset-x-0 bottom-0 z-0 mx-auto h-3 w-[96%] cursor-pointer rounded-t-2xl border border-b-0",- "bg-(--chat-composer-attached-surface)/(--glass-opacity) backdrop-blur-(--glass-blur) backdrop-saturate-(--glass-saturation)",- "not-supports-[((backdrop-filter:blur(1px))_or_(-webkit-backdrop-filter:blur(1px)))]:bg-(--chat-composer-attached-surface)",- "transition-opacity duration-150 ease-out focus-visible:outline-2 focus-visible:outline-ring",- peekBorder[variant],- className,- )}- {...props}- />- );-}-function Attachment({ className, ...props }: ComponentProps<"div">) {return (<div@@ -141,13 +105,11 @@ function Column({ className, ...props }: ComponentProps<"div">) {function Root({className,density = "default",- placement = "attached",variant = "default",width = "fill",...props}: ComponentProps<"div"> & {density?: "default" | "comfortable" | "spacious";- placement?: "attached" | "floating";variant?: ComposerBannerVariant;width?: "fill" | "content";}) {@@ -165,15 +127,9 @@ function Root({"[&>[data-composer-banner-row]:first-child>[data-slot=composer-banner-actions]>:last-child>[data-slot=button]:last-of-type]:rounded-se-xl","[&>:first-child>[data-composer-banner-row]:first-child>[data-slot=composer-banner-actions]>[data-slot=button]:last-child]:rounded-se-xl",],- placement === "floating" &&- density !== "spacious" && [- "[&>[data-composer-banner-row]:only-child>[data-slot=composer-banner-actions]>[data-slot=button]:last-child]:rounded-ee-xl",- "[&>[data-composer-banner-row]:only-child>[data-slot=composer-banner-actions]>:last-child>[data-slot=button]:last-of-type]:rounded-ee-xl",- ],className,)}data-slot="composer-banner"- placement={placement}data-composer-banner-width={width}variant={variant}{...props}@@ -193,7 +149,7 @@ function Row({className: cn("group/banner-row grid min-h-(--composer-banner-icon-column) w-full min-w-0 grid-cols-[var(--composer-banner-icon-column)_minmax(0,1fr)_auto] items-center gap-x-1 text-start","not-has-[>[data-slot=composer-banner-actions]]:grid-cols-[var(--composer-banner-icon-column)_minmax(0,1fr)]",- "[&:is(button)]:cursor-pointer [&:is(button)]:rounded-md [&:is(button)]:focus-visible:outline-2 [&:is(button)]:focus-visible:-outline-offset-2 [&:is(button)]:focus-visible:outline-ring",+ "[&:is(button)]:cursor-pointer [&:is(button)]:rounded-xl [&:is(button)]:hover:bg-foreground/5 [&:is(button)]:focus-visible:outline-2 [&:is(button)]:focus-visible:-outline-offset-2 [&:is(button)]:focus-visible:outline-ring",layout === "wrap-actions" &&"flex flex-wrap *:data-[slot=composer-banner-content]:max-w-[calc(100%-var(--composer-banner-icon-column)-var(--spacing))] *:data-[slot=composer-banner-content]:grow",layout === "approval" && "items-start gap-x-2 gap-y-3",@@ -338,7 +294,6 @@ function Dismiss({ className, children, ...props }: ComponentProps<typeof Buttonexport const ComposerBanner = {Surface,- Peek,Attachment,Dock,Column,diff --git a/apps/web/src/components/chat/ComposerBannerStack.browser.test.tsx b/apps/web/src/components/chat/ComposerBannerStack.browser.test.tsxindex e64d52850eb..dc23c4452b4 100644--- a/apps/web/src/components/chat/ComposerBannerStack.browser.test.tsx+++ b/apps/web/src/components/chat/ComposerBannerStack.browser.test.tsx@@ -1,25 +1,35 @@import { InfoIcon } from "lucide-react";-import { expect, it, vi } from "vite-plus/test";-import { userEvent } from "vite-plus/test/browser";+import { expect, it } from "vite-plus/test";++import "~/index.css";import { render } from "../../../test/render";+import { ComposerBanner } from "./ComposerBanner";import { ComposerBannerStack, type ComposerBannerStackItem } from "./ComposerBannerStack";-it("commits a dismissal when the thread switches during the exit transition", async () => {- const onDismiss = vi.fn();- const item: ComposerBannerStackItem = {- id: "notice",- variant: "info",- icon: <InfoIcon />,- title: "Thread A notice",- dismissLabel: "Dismiss notice",- onDismiss,- };- await using screen = await render(<ComposerBannerStack key="thread-a" items={[item]} />);+function notice(title: string, group?: ComposerBannerStackItem["group"]): ComposerBannerStackItem {+ return { id: title, variant: "default", icon: <InfoIcon />, title, ...(group ? { group } : {}) };+}++it("puts machine notices first, whatever order the notices arrive in", async () => {+ await using screen = await render(+ <ComposerBannerStack items={[notice("Branch changed"), notice("Offline", "environment")]} />,+ );++ expect(screen.container.textContent).toBe("OfflineBranch changed");+});- await userEvent.click(screen.getByRole("button", { name: "Dismiss notice" }));- // The composer keys the stack by thread, so switching threads remounts it mid-exit.- await screen.rerender(<ComposerBannerStack key="thread-b" items={[]} />);+it("leaves the next attachment its own top edge when there are no notices", async () => {+ await using screen = await render(+ <ComposerBanner.Column>+ <ComposerBannerStack items={[]} />+ <ComposerBanner.Attachment>+ <ComposerBanner.Root data-testid="drawer">Approval</ComposerBanner.Root>+ </ComposerBanner.Attachment>+ </ComposerBanner.Column>,+ );- await vi.waitFor(() => expect(onDismiss).toHaveBeenCalledTimes(1));+ const surface = getComputedStyle(screen.getByTestId("drawer").element(), "::before");+ expect(surface.borderTopWidth).toBe("1px");+ expect(surface.borderTopLeftRadius).not.toBe("0px");});diff --git a/apps/web/src/components/chat/ComposerBannerStack.tsx b/apps/web/src/components/chat/ComposerBannerStack.tsxindex 8661d5df09c..494f7562f63 100644--- a/apps/web/src/components/chat/ComposerBannerStack.tsx+++ b/apps/web/src/components/chat/ComposerBannerStack.tsx@@ -1,20 +1,21 @@import { InfoIcon } from "lucide-react";-import { useId, useLayoutEffect, useRef, useState, type ReactNode } from "react";-import { flushSync } from "react-dom";+import { useLayoutEffect, useRef, useState, type ReactNode } from "react";-import { cn } from "~/lib/utils";import { Button } from "../ui/button";import { Popover, PopoverPopup, PopoverTrigger } from "../ui/popover";import { ComposerBanner, type ComposerBannerVariant } from "./ComposerBanner";import { observeResize } from "~/lib/observeResize";-// Match the duration-220 exit transition before removing a dismissed notice.-const DISMISS_TRANSITION_MS = 220;+/**+ * Where a notice sits above the composer. The machine comes first, then what needs you; the+ * order is fixed so rows never trade places as notices come and go.+ */+export type ComposerBannerGroup = "environment" | "attention";export interface ComposerBannerStackItem {readonly id: string;readonly variant: ComposerBannerVariant;- readonly priority?: "urgent" | "activity" | "notice";+ readonly group?: ComposerBannerGroup;readonly icon: ReactNode;readonly title: ReactNode;readonly description?: ReactNode;@@ -24,214 +25,31 @@ export interface ComposerBannerStackItem {readonly onDismiss?: () => void;}-export type ComposerBannerStackContent = Pick<- ComposerBannerStackItem,- "id" | "variant" | "priority"-> & { readonly content: ReactNode };+const GROUPS = ["environment", "attention"] as const;-type ComposerBannerStackEntry = ComposerBannerStackItem | ComposerBannerStackContent;--function bannerPriority(item: ComposerBannerStackEntry) {- if (item.priority === "urgent" || item.variant === "error" || item.variant === "warning") {- return 0;- }- if (item.priority === "activity") {- return 1;- }- return 2;-}--interface ComposerBannerStackProps {- readonly className?: string;- readonly items: ReadonlyArray<ComposerBannerStackEntry>;- readonly attachedAbove?: ReactNode;-}--export function ComposerBannerStack({ className, items, attachedAbove }: ComposerBannerStackProps) {- const [stackExpanded, setStackExpanded] = useState(false);- const noticesRef = useRef<HTMLDivElement>(null);- const peekRef = useRef<HTMLButtonElement>(null);- const expandedItemsRef = useRef<HTMLDivElement>(null);- const expandedItemsId = useId();- const [requestedExitingItemId, setExitingItemId] = useState<string | null>(null);- const exitingItemId =- requestedExitingItemId !== null && items.some((item) => item.id === requestedExitingItemId)- ? requestedExitingItemId- : null;-- if (items.length < 2 && stackExpanded) {- setStackExpanded(false);- }-- const expandAndFocusNotice = () => {- flushSync(() => setStackExpanded(true));- const container = expandedItemsRef.current;- const firstControl = container?.querySelector<HTMLElement>(- 'button:not(:disabled), a[href], input:not(:disabled), [tabindex="0"]',- );- (firstControl ?? container)?.focus({ preventScroll: true });- };-- const orderedItems = items.toSorted((a, b) => bannerPriority(a) - bannerPriority(b));- const frontItem = orderedItems[0];- if (!frontItem) {- return (- <>- {null}- {attachedAbove}- {null}- </>- );- }- const stackedItems = orderedItems.slice(1);- const hasStack = stackedItems.length > 0;- const showCollapsedStackCap = hasStack && exitingItemId !== frontItem.id;- const firstStackedItem = stackedItems[0];-- const requestDismiss = (item: ComposerBannerStackEntry) => {- if (!("onDismiss" in item) || !item.onDismiss || exitingItemId) {- return;- }- setExitingItemId(item.id);- // A timer, not transitionend: the dismissal must commit even when the stack unmounts- // (thread switch) or a collapsed composer hides it mid-exit, and transitionend never fires then.- setTimeout(() => item.onDismiss?.(), DISMISS_TRANSITION_MS);- };-- return (- <>- {hasStack ? (- <div- ref={noticesRef}- data-composer-banner-stack="true"- data-chat-composer-collapsed-controls="true"- className={cn("relative z-20 min-h-3", stackExpanded && "z-50")}- onPointerEnter={(event) => {- if (event.pointerType === "touch") return;- if (document.activeElement === peekRef.current) {- expandAndFocusNotice();- return;- }- setStackExpanded(true);- }}- onPointerLeave={(event) => {- if (!event.currentTarget.contains(document.activeElement)) setStackExpanded(false);- }}- onBlurCapture={(event) => {- if (- !event.currentTarget.contains(event.relatedTarget) &&- !event.currentTarget.matches(":hover")- ) {- setStackExpanded(false);- }- }}- onKeyDown={(event) => {- if (event.key !== "Escape" || !stackExpanded) return;- event.preventDefault();- event.stopPropagation();- flushSync(() => setStackExpanded(false));- peekRef.current?.focus({ preventScroll: true });- }}- >- {showCollapsedStackCap && firstStackedItem ? (- <ComposerBanner.Peek- ref={peekRef}- variant={firstStackedItem.variant}- aria-label="Show other notices"- aria-expanded={stackExpanded}- aria-controls={expandedItemsId}- aria-hidden={stackExpanded || undefined}- tabIndex={stackExpanded ? -1 : 0}- onClick={(event) => {- event.currentTarget.focus({ preventScroll: true });- expandAndFocusNotice();- }}- className={cn(stackExpanded && "pointer-events-none invisible opacity-0")}- />- ) : null}- <div- id={expandedItemsId}- ref={expandedItemsRef}- role="group"- aria-label="Other notices"- tabIndex={-1}- data-composer-banner-stack-expanded-items="true"- className={cn(- "grid transition-[grid-template-rows] duration-150 ease-out focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring",- stackExpanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]",- )}- >- {/* Horizontal clipping shaves the right border at fractional widths. */}- <div className="min-h-0 overflow-y-clip">- <div- className={cn(- "transform-gpu space-y-2 pb-2 transition-[opacity,transform] duration-150 ease-out will-change-transform",- stackExpanded- ? "pointer-events-auto visible translate-y-0 opacity-100"- : "pointer-events-none invisible translate-y-1 opacity-0",- )}- >- {stackedItems.map((item) => (- <div- key={item.id}- className={cn(- "transition-[opacity,translate] duration-220 ease-in",- exitingItemId === item.id- ? "pointer-events-none translate-y-28 opacity-0"- : "opacity-100",- )}- >- <ComposerBannerStackAlert- item={item}- attached={false}- exiting={exitingItemId === item.id}- onDismissRequest={() => requestDismiss(item)}- />- </div>- ))}- </div>- </div>- </div>- </div>- ) : null}- {attachedAbove}- <ComposerBanner.Attachment- className={className}- data-composer-banner-drawer="true"- data-chat-composer-collapsed-controls="true"- >- <div- key={frontItem.id}- className={cn(- "relative z-10 transition-[opacity,translate] duration-220 ease-in",- exitingItemId === frontItem.id- ? "pointer-events-none translate-y-16 opacity-0"- : "opacity-100",- )}- onPointerDownCapture={() => {- setStackExpanded(false);- const activeElement = document.activeElement;- if (- activeElement instanceof HTMLElement &&- noticesRef.current?.contains(activeElement)- ) {- activeElement.blur();- }- }}- >- <ComposerBannerStackAlert- item={frontItem}- attached- exiting={exitingItemId === frontItem.id}- onDismissRequest={() => requestDismiss(frontItem)}- />- </div>- </ComposerBanner.Attachment>- </>- );+/**+ * Notices about sending from this composer, each its own attached card. Consecutive cards join+ * edge to edge, and the last joins the composer or the drawer below it.+ */+export function ComposerBannerStack({+ items,+}: {+ readonly items: ReadonlyArray<ComposerBannerStackItem>;+}) {+ return GROUPS.flatMap((group) =>+ items.filter((item) => (item.group ?? "attention") === group),+ ).map((item) => (+ <ComposerBanner.Attachment+ key={item.id}+ data-composer-banner-stack="true"+ className="transition-opacity duration-150 ease-out starting:opacity-0 motion-reduce:transition-none"+ >+ <NoticeCard item={item} />+ </ComposerBanner.Attachment>+ ));}-function NoticeText({+export function NoticeText({children,className,detailsLabel,@@ -306,49 +124,36 @@ function NoticeText({);}-function ComposerBannerStackAlert({- item,- attached,- exiting,- onDismissRequest,-}: {- readonly item: ComposerBannerStackEntry;- readonly attached: boolean;- readonly exiting: boolean;- readonly onDismissRequest: () => void;-}) {- if ("content" in item) {- return (- <ComposerBanner.Root- density="comfortable"- placement={attached ? "attached" : "floating"}- variant={item.variant}- >- {item.content}- </ComposerBanner.Root>- );- }+function NoticeCard({ item }: { readonly item: ComposerBannerStackItem }) {return (<ComposerBanner.Root- role="alert"- placement={attached ? "attached" : "floating"}+ role={item.variant === "error" || item.variant === "warning" ? "alert" : undefined}variant={item.variant}density="comfortable"+ data-chat-composer-collapsed-controls="true">- <ComposerBanner.Row layout={item.priority === "activity" ? "inline" : "wrap-actions"}>+ <ComposerBanner.Row layout="wrap-actions"><ComposerBanner.Icon className="h-(--composer-banner-icon-column) self-start">{item.icon}</ComposerBanner.Icon><ComposerBanner.Content className="whitespace-nowrap"><NoticeText- detailsLabel="Show title details"+ detailsLabel={+ typeof item.title === "string"+ ? `Show full title: ${item.title}`+ : "Show title details"+ }className="min-w-0 truncate font-medium leading-7 sm:leading-6">{item.title}</NoticeText>{item.description ? (<NoticeText- detailsLabel="Show notice details"+ detailsLabel={+ typeof item.title === "string"+ ? `Show details: ${item.title}`+ : "Show notice details"+ }className="w-0 min-w-0 grow truncate text-muted-foreground @max-[400px]:sr-only">{item.description}@@ -361,8 +166,7 @@ function ComposerBannerStackAlert({{item.onDismiss ? (<ComposerBanner.Dismissaria-label={item.dismissLabel ?? "Dismiss warning"}- disabled={exiting}- onClick={onDismissRequest}+ onClick={item.onDismiss}/>) : null}</ComposerBanner.Actions>diff --git a/apps/web/src/components/chat/ComposerFeedback.tsx b/apps/web/src/components/chat/ComposerFeedback.tsxindex 8322b1a9946..2d805b42a34 100644--- a/apps/web/src/components/chat/ComposerFeedback.tsx+++ b/apps/web/src/components/chat/ComposerFeedback.tsx@@ -19,7 +19,6 @@ export function feedbackBannerItem(id: `feedback:${submission.id}`,variant:submission.status === "failed" ? "error" : submission.status === "sent" ? "success" : "info",- priority: submission.status === "uploading" ? "activity" : "notice",icon: <MessageSquareIcon />,...notice,actions:diff --git a/apps/web/src/components/chat/ComposerServerUpdateStatus.tsx b/apps/web/src/components/chat/ComposerServerUpdateStatus.tsxindex fa74f196680..2ff33c62dfb 100644--- a/apps/web/src/components/chat/ComposerServerUpdateStatus.tsx+++ b/apps/web/src/components/chat/ComposerServerUpdateStatus.tsx@@ -1,15 +1,12 @@-import { Spinner } from "~/components/ui/spinner";import type { ServerUpdateState } from "@t3tools/client-runtime/state/server";import { CircleAlertIcon, DownloadIcon } from "lucide-react";+// Static on purpose: the title says when an update is running, and spinners repaint every frame.export function ComposerServerUpdateIcon({status,}: {readonly status: ServerUpdateState["status"];}) {- if (status === "running") {- return <Spinner aria-hidden />;- }if (status === "failed") {return <CircleAlertIcon aria-hidden className="text-error" />;}diff --git a/apps/web/src/components/chat/ComposerTasksBadge.tsx b/apps/web/src/components/chat/ComposerTasksBadge.tsxdeleted file mode 100644index 008370aa10b..00000000000--- a/apps/web/src/components/chat/ComposerTasksBadge.tsx+++ /dev/null@@ -1,236 +0,0 @@-import { CheckIcon, CircleDotIcon, CircleIcon, ListTodoIcon } from "lucide-react";-import { memo, type ComponentProps } from "react";--import { formatDuration } from "../../session-logic";-import { cn } from "~/lib/utils";-import { ComposerBanner } from "./ComposerBanner";--export interface ComposerTasksProgress {- readonly step: string;- readonly completedSteps: number;- readonly totalSteps: number;- readonly live: boolean;-}--export interface ComposerTaskStep {- readonly durationMs?: number;- readonly step: string;- readonly status: "pending" | "inProgress" | "completed";-}--const MAX_TASK_SEGMENTS = 10;--const taskStatusLabels = {- pending: "Pending",- inProgress: "Running",- completed: "Completed",-} satisfies Record<ComposerTaskStep["status"], string>;--function keyedTaskSteps(steps: readonly ComposerTaskStep[]) {- const occurrences = new Map<string, number>();- return steps.map((step) => {- const occurrence = occurrences.get(step.step) ?? 0;- occurrences.set(step.step, occurrence + 1);- return { key: `${step.step}:${occurrence}`, step };- });-}--function TaskSegments({- className,- steps,-}: {- readonly className?: string;- readonly steps: readonly ComposerTaskStep[];-}) {- if (steps.length <= 1 || steps.length > MAX_TASK_SEGMENTS) return null;-- return (- <span aria-hidden className={cn("flex w-10 shrink-0 items-center gap-0.5", className)}>- {keyedTaskSteps(steps).map(({ key, step }) => (- <span- key={key}- className={cn(- "h-[3px] min-w-0 flex-1 rounded-full",- step.status === "completed"- ? "bg-success"- : step.status === "inProgress"- ? "bg-primary"- : "bg-muted-foreground/25",- )}- />- ))}- </span>- );-}--function TaskSummary({- expanded,- progress,- steps,-}: {- readonly expanded: boolean;- readonly progress: ComposerTasksProgress;- readonly steps: readonly ComposerTaskStep[];-}) {- return (- <>- <ComposerBanner.Icon>- <ListTodoIcon />- </ComposerBanner.Icon>- <ComposerBanner.Content>- <span className="shrink-0 text-muted-foreground">Tasks</span>- <span- className="min-w-0 flex-1 truncate text-left font-medium text-foreground/80"- data-composer-task-current="true"- >- {progress.step}- </span>- </ComposerBanner.Content>- <ComposerBanner.Actions>- <ComposerBanner.Count- className={progress.completedSteps >= progress.totalSteps ? "text-success" : undefined}- data-composer-task-progress="true"- >- {progress.completedSteps}/{progress.totalSteps}- </ComposerBanner.Count>- <TaskSegments className="hidden w-20 @min-[560px]:flex" steps={steps} />- <ComposerBanner.ToggleIcon expanded={expanded} />- </ComposerBanner.Actions>- </>- );-}--export const ComposerTasksBadge = memo(function ComposerTasksBadge({- expanded,- onToggle,- placement = "tab",- progress,- steps,-}: {- readonly expanded: boolean;- readonly onToggle: () => void;- readonly placement?: "inline" | "tab";- readonly progress: ComposerTasksProgress;- readonly steps: readonly ComposerTaskStep[];-}) {- if (progress.totalSteps <= 0) return null;-- const row = (- <ComposerBanner.Row- render={<button type="button" />}- aria-expanded={expanded}- aria-label={`${expanded ? "Collapse tasks" : "Tasks"}: ${progress.completedSteps} of ${progress.totalSteps} complete. Current task: ${progress.step}`}- data-composer-tasks-badge="true"- onClick={onToggle}- onPointerDown={(event) => event.preventDefault()}- >- <TaskSummary expanded={expanded} progress={progress} steps={steps} />- </ComposerBanner.Row>- );- return placement === "inline" ? (- row- ) : (- <ComposerBanner.Root density="comfortable" data-composer-shoulder-tab>- {row}- </ComposerBanner.Root>- );-});--export const ComposerTasksContent = memo(function ComposerTasksContent({- expanded,- onToggle,- progress,- steps,-}: {- readonly expanded: boolean;- readonly onToggle: () => void;- readonly progress: ComposerTasksProgress;- readonly steps: readonly ComposerTaskStep[];-}) {- return (- <div- data-chat-composer-collapsed-controls="true"- data-chat-composer-tasks-drawer={expanded ? "true" : undefined}- >- <ComposerTasksBadge- expanded={expanded}- onToggle={onToggle}- placement="inline"- progress={progress}- steps={steps}- />- {expanded ? (- <ComposerBanner.Scroll data-composer-tasks-scroll="true">- <ComposerBanner.Children- render={<ul role="list" />}- aria-label={`Task list. ${progress.completedSteps} of ${progress.totalSteps} complete.`}- data-composer-tasks-list="true"- >- {keyedTaskSteps(steps).map(({ key, step }) => (- <ComposerBanner.Row key={key} render={<li />} className="items-start py-1 pe-2">- <ComposerBanner.Icon- className={cn(- "h-4",- step.status === "completed"- ? "text-success"- : step.status === "inProgress"- ? "text-primary"- : "text-muted-foreground/40",- )}- >- {step.status === "completed" ? (- <CheckIcon />- ) : step.status === "inProgress" ? (- <CircleDotIcon />- ) : (- <CircleIcon />- )}- </ComposerBanner.Icon>- <ComposerBanner.Content- className={cn(- "block wrap-anywhere",- step.status === "completed"- ? "text-muted-foreground/55"- : step.status === "inProgress"- ? "text-foreground/90"- : "text-muted-foreground/70",- )}- >- <span className="sr-only">{taskStatusLabels[step.status]}: </span>- {step.step}- </ComposerBanner.Content>- <ComposerBanner.Actions>- <span- className="min-w-12 text-right text-3xs/4 whitespace-nowrap text-muted-foreground/45 tabular-nums"- data-composer-task-duration="true"- >- {step.durationMs !== undefined- ? formatDuration(step.durationMs)- : step.status === "inProgress" && progress.live- ? "now"- : null}- </span>- </ComposerBanner.Actions>- </ComposerBanner.Row>- ))}- </ComposerBanner.Children>- </ComposerBanner.Scroll>- ) : null}- </div>- );-});--export const ComposerTasksDrawer = memo(function ComposerTasksDrawer({- onCollapse,- ...props-}: Omit<ComponentProps<typeof ComposerTasksContent>, "expanded" | "onToggle"> & {- readonly onCollapse: () => void;-}) {- return (- <ComposerBanner.Attachment>- <ComposerBanner.Root>- <ComposerTasksContent {...props} expanded onToggle={onCollapse} />- </ComposerBanner.Root>- </ComposerBanner.Attachment>- );-});diff --git a/apps/web/src/components/chat/ComposerUsageLimits.tsx b/apps/web/src/components/chat/ComposerUsageLimits.tsxindex 0b1bc700495..294816c140a 100644--- a/apps/web/src/components/chat/ComposerUsageLimits.tsx+++ b/apps/web/src/components/chat/ComposerUsageLimits.tsx@@ -58,7 +58,6 @@ export function usageLimitsBannerItem(return {id,variant: "info",- priority: "notice",icon: <GaugeIcon />,title: "Usage limits",description: summary,diff --git a/apps/web/src/components/chat/MessagesTimeline.tsx b/apps/web/src/components/chat/MessagesTimeline.tsxindex 89715cc593c..e9b21061c47 100644--- a/apps/web/src/components/chat/MessagesTimeline.tsx+++ b/apps/web/src/components/chat/MessagesTimeline.tsx@@ -143,14 +143,28 @@ const TIMELINE_LIST_FADE_HEADER = ();function TimelineListFooter({composerInset,+ onGrow,children,}: {readonly composerInset: number;+ readonly onGrow: (() => void) | undefined;readonly children?: ReactNode;}) {+ const contentRef = useRef<HTMLDivElement>(null);+ // oxlint-disable-next-line t3code/react-effect-budget -- reports growth of the footer's content, which the list does not follow+ useLayoutEffect(() => {+ const content = contentRef.current;+ if (!content || !onGrow) return;+ let height = content.offsetHeight;+ return observeResize(content, () => {+ const next = content.offsetHeight;+ if (next > height) onGrow();+ height = next;+ });+ }, [onGrow]);return (<div>- {children}+ <div ref={contentRef}>{children}</div><div aria-hidden style={{ height: composerInset }} /><div aria-hidden className="h-3 sm:h-4" /></div>@@ -266,6 +280,8 @@ interface MessagesTimelineProps {onToolOutputCollapsedAtEnd?: () => void;/** Receives the list's viewport when it mounts; the returned cleanup runs when it goes away. */onViewportAttach?: (viewport: TimelineViewport) => () => void;+ /** The footer's content grew, such as a new queued turn or status line. */+ onFooterGrow?: () => void;findOpen?: boolean;hideEmptyPlaceholder?: boolean;/** Composer space to center the empty state against; held steady through collapse. */@@ -360,6 +376,7 @@ const ConversationTimeline = memo(function ConversationTimeline({liveFollowEnabled,onToolOutputCollapsedAtEnd,onViewportAttach,+ onFooterGrow,hideEmptyPlaceholder = false,emptyPlaceholderInset,topFadeEnabled = false,@@ -794,7 +811,10 @@ const ConversationTimeline = memo(function ConversationTimeline({shouldRestorePosition: shouldRestoreVisibleContentPosition,};const timelineListFooter = (- <TimelineListFooter composerInset={anchoredEndSpace ? 0 : contentInsetEndAdjustment}>+ <TimelineListFooter+ composerInset={anchoredEndSpace ? 0 : contentInsetEndAdjustment}+ onGrow={onFooterGrow}+ >{footer}</TimelineListFooter>);diff --git a/apps/web/src/components/chat/QueuedRunsControl.tsx b/apps/web/src/components/chat/QueuedRunsControl.tsxindex fdcba40c6ac..3ec2c8b4725 100644--- a/apps/web/src/components/chat/QueuedRunsControl.tsx+++ b/apps/web/src/components/chat/QueuedRunsControl.tsx@@ -10,11 +10,13 @@ import type {ThreadId,} from "@t3tools/contracts";import {+ ChevronDownIcon,Clock3Icon,CornerUpRightIcon,GripVerticalIcon,ListOrderedIcon,PencilIcon,+ XIcon,} from "lucide-react";import { useId, useImperativeHandle, useRef, useState, type Ref } from "react";@@ -24,8 +26,7 @@ import { useThreadProjection } from "../../state/entities";import { useAtomCommand } from "../../state/use-atom-command";import { isImageAttachment, type ChatMessage } from "../../types";import { cn } from "~/lib/utils";-import { ComposerBanner } from "./ComposerBanner";-import { Button } from "../ui/button";+import { Button, InlineButton } from "../ui/button";import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";export interface EditQueuedRunRequest {@@ -42,6 +43,8 @@ interface QueuedRowThumbnail {}const QUEUED_RUN_DRAG_TYPE = "application/x-t3code-queued-run";+// A longer queue shows its first messages and a button that shows the rest.+const QUEUE_VISIBLE_ROWS = 3;export interface QueuedRunsControlHandle {steerNext: (repeat: boolean) => boolean;@@ -86,7 +89,7 @@ export function QueuedRunsControl({const promote = useAtomCommand(threadEnvironment.promoteQueuedRun);const resume = useAtomCommand(threadEnvironment.resumeThreadQueue);const cancel = useAtomCommand(threadEnvironment.cancelQueuedRun);- const [expanded, setExpanded] = useState(true);+ const [showAll, setShowAll] = useState(false);const queueListId = useId();const [busyRunId, setBusyRunId] = useState<RunId | null>(null);const [dragState, setDragState] = useState<{@@ -215,7 +218,7 @@ export function QueuedRunsControl({return false;}if (!repeat) {- setExpanded(true);+ setShowAll(true);props.onEditQueuedRun({runId: latest.run.id,messageId: latest.run.userMessageId,@@ -238,258 +241,285 @@ export function QueuedRunsControl({setBusyRunId(null);};+ const collapsible = items.length > QUEUE_VISIBLE_ROWS;+ const visibleItems = collapsible && !showAll ? items.slice(0, QUEUE_VISIBLE_ROWS - 1) : items;+return (- <ComposerBanner.Attachment>- <ComposerBanner.Root- role="region"- aria-label={`${items.length} queued message${items.length === 1 ? "" : "s"}`}- aria-live="polite"- data-chat-composer-collapsed-controls="true"- className="relative z-0"- >- <ComposerBanner.Row- render={<button type="button" />}- aria-label={expanded ? "Collapse queued messages" : "Expand queued messages"}- aria-expanded={expanded}- aria-controls={queueListId}- onPointerDown={(event) => event.preventDefault()}- onClick={() => setExpanded((value) => !value)}- >- <ComposerBanner.Icon>- <ListOrderedIcon />- </ComposerBanner.Icon>- <ComposerBanner.Content className="text-muted-foreground">Queued</ComposerBanner.Content>- <ComposerBanner.Actions>- <ComposerBanner.Count>{items.length}</ComposerBanner.Count>- <ComposerBanner.ToggleIcon expanded={expanded} />- </ComposerBanner.Actions>- </ComposerBanner.Row>- <ComposerBanner.Scroll className={cn("max-h-32", !expanded && "hidden")}>- <ComposerBanner.Children render={<ol />} id={queueListId}>- {items.map((item) => {- const previewText = assistantCitationsToPlainText(- replaceComposerContextReferences(item.text, (reference) =>- reference.kind === "image" && item.thumbnails.length > 0 ? "" : reference.label,- ),- ).trim();- const rowRunId = item.runId;- const rowServerIndex = item.serverIndex;- const isEditing = rowRunId !== null && rowRunId === props.editingRunId;- const rowDraggable =- rowRunId !== null && rowServerIndex !== null && canReorder && busyRunId === null;- return (- <ComposerBanner.Row- render={<li />}- key={item.key}- aria-current={isEditing ? "true" : undefined}- className={cn(- "relative rounded-sm",- isEditing && "bg-accent text-accent-foreground",- dragState !== null && dragState.runId === item.runId && "opacity-50",- )}- draggable={rowDraggable}- onDragStart={(event) => {- if (item.runId === null || dragArmedRunIdRef.current !== item.runId) {- event.preventDefault();- return;- }- event.dataTransfer.setData(QUEUED_RUN_DRAG_TYPE, item.runId);- event.dataTransfer.effectAllowed = "move";- setDragState({ runId: item.runId, insertIndex: null });- }}- onDragEnd={() => {- dragArmedRunIdRef.current = null;- setDragState(null);- }}- onDragOver={(event) => {- if (dragState === null || item.serverIndex === null) return;- event.preventDefault();- event.dataTransfer.dropEffect = "move";- const rect = event.currentTarget.getBoundingClientRect();- const insertIndex =- event.clientY < rect.top + rect.height / 2- ? item.serverIndex- : item.serverIndex + 1;- if (dragState.insertIndex !== insertIndex) {- setDragState({ runId: dragState.runId, insertIndex });- }- }}- onDrop={(event) => {- if (dragState === null) return;- event.preventDefault();- completeDrag(dragState.runId, dragState.insertIndex);- }}- >- {item.serverIndex !== null && dragState?.insertIndex === item.serverIndex ? (- <span- aria-hidden- className="pointer-events-none absolute inset-x-0 top-0 h-0.5 rounded bg-primary/70"- />- ) : null}- {item.serverIndex === queued.length - 1 &&- dragState?.insertIndex === queued.length ? (- <span- aria-hidden- className="pointer-events-none absolute inset-x-0 bottom-0 h-0.5 rounded bg-primary/70"- />- ) : null}- <ComposerBanner.Icon aria-hidden={false}>- {canReorder && rowRunId !== null && rowServerIndex !== null ? (- <Button- size="icon-xs"- variant="ghost-muted"- aria-label="Reorder queued message (drag, or press the arrow keys)"- className="cursor-grab active:cursor-grabbing disabled:cursor-default"- disabled={busyRunId !== null}- onPointerDown={() => {- dragArmedRunIdRef.current = rowRunId;- }}- onKeyDown={(event) => {- if (busyRunId !== null) return;- if (event.key === "ArrowUp" && rowServerIndex > 0) {- event.preventDefault();- void move(rowRunId, queued[rowServerIndex - 1]?.run.id ?? null);- }- if (event.key === "ArrowDown" && rowServerIndex < queued.length - 1) {- event.preventDefault();- void move(rowRunId, queued[rowServerIndex + 2]?.run.id ?? null);- }- }}+ <section+ aria-label={`Up next: ${items.length} queued message${items.length === 1 ? "" : "s"}`}+ data-thread-queue="true"+ className="mx-auto flex w-full max-w-(--chat-content-max-width) flex-col gap-2 pb-4"+ >+ <h3 className="flex min-h-5 items-center gap-1.5 px-1 text-xs font-normal text-muted-foreground [&_svg]:size-3.5">+ <ListOrderedIcon aria-hidden />+ Up next+ <span className="tabular-nums" aria-live="polite">+ · {items.length} queued+ </span>+ </h3>+ <ol className="flex flex-col items-end gap-3" id={queueListId}>+ {visibleItems.map((item, position) => {+ const previewText = assistantCitationsToPlainText(+ replaceComposerContextReferences(item.text, (reference) =>+ reference.kind === "image" && item.thumbnails.length > 0 ? "" : reference.label,+ ),+ ).trim();+ const rowRunId = item.runId;+ const rowServerIndex = item.serverIndex;+ const isEditing = rowRunId !== null && rowRunId === props.editingRunId;+ const rowDraggable =+ rowRunId !== null && rowServerIndex !== null && canReorder && busyRunId === null;+ return (+ <li+ key={item.key}+ aria-label={`Queued message ${position + 1} of ${items.length}, not sent`}+ aria-posinset={position + 1}+ aria-setsize={items.length}+ aria-current={isEditing ? "true" : undefined}+ className={cn(+ "group/queued relative flex w-full flex-col items-end gap-1 transition-opacity duration-150 ease-out starting:opacity-0 motion-reduce:transition-none",+ dragState !== null && dragState.runId === item.runId && "opacity-50",+ )}+ draggable={rowDraggable}+ onDragStart={(event) => {+ if (item.runId === null || dragArmedRunIdRef.current !== item.runId) {+ event.preventDefault();+ return;+ }+ event.dataTransfer.setData(QUEUED_RUN_DRAG_TYPE, item.runId);+ event.dataTransfer.effectAllowed = "move";+ setDragState({ runId: item.runId, insertIndex: null });+ }}+ onDragEnd={() => {+ dragArmedRunIdRef.current = null;+ setDragState(null);+ }}+ onDragOver={(event) => {+ if (dragState === null || item.serverIndex === null) return;+ event.preventDefault();+ event.dataTransfer.dropEffect = "move";+ const rect = event.currentTarget.getBoundingClientRect();+ const insertIndex =+ event.clientY < rect.top + rect.height / 2+ ? item.serverIndex+ : item.serverIndex + 1;+ if (dragState.insertIndex !== insertIndex) {+ setDragState({ runId: dragState.runId, insertIndex });+ }+ }}+ onDrop={(event) => {+ if (dragState === null) return;+ event.preventDefault();+ completeDrag(dragState.runId, dragState.insertIndex);+ }}+ >+ {item.serverIndex !== null && dragState?.insertIndex === item.serverIndex ? (+ <span+ aria-hidden+ className="pointer-events-none absolute inset-x-0 -top-1.5 h-0.5 rounded bg-primary/70"+ />+ ) : null}+ {item.serverIndex === queued.length - 1 &&+ dragState?.insertIndex === queued.length ? (+ <span+ aria-hidden+ className="pointer-events-none absolute inset-x-0 -bottom-1.5 h-0.5 rounded bg-primary/70"+ />+ ) : null}+ {/* Dashed and unfilled: a turn that has not been sent yet. */}+ <div+ className={cn(+ "flex min-w-0 max-w-[80%] flex-col gap-2 rounded-2xl border border-dashed px-3 py-2 text-sm",+ isEditing+ ? "border-primary/60 text-foreground"+ : "border-muted-foreground/40 text-muted-foreground",+ )}+ >+ {item.thumbnails.length > 0 ? (+ <span className="flex flex-wrap items-center gap-1">+ {item.thumbnails.map((thumbnail) => (+ <span+ key={thumbnail.key}+ className="size-8 overflow-hidden rounded-md border border-border/70 bg-background">- <GripVerticalIcon />- </Button>- ) : null}- </ComposerBanner.Icon>- <ComposerBanner.Content className="text-foreground/80">- {isEditing ? <span className="sr-only">Editing queued message: </span> : null}- {item.pending ? (- <Clock3Icon- aria-label="Saving queued message"- className="size-3 shrink-0 text-muted-foreground/60"- />- ) : null}- {item.thumbnails.length > 0 ? (- <span className="flex shrink-0 items-center gap-0.5">- {item.thumbnails.map((thumbnail) => (+ {thumbnail.url ? (+ <img+ src={thumbnail.url}+ alt={thumbnail.name}+ className="size-full object-cover"+ />+ ) : (<span- key={thumbnail.key}- className="size-4 overflow-hidden rounded border border-border/70 bg-background"- >- {thumbnail.url ? (- <img- src={thumbnail.url}- alt={thumbnail.name}- className="size-full object-cover"- />- ) : (- <span- aria-label={thumbnail.name}- className="block size-full bg-muted/60"- />- )}- </span>- ))}+ aria-label={thumbnail.name}+ className="block size-full bg-muted/60"+ />+ )}</span>- ) : null}+ ))}+ </span>+ ) : null}+ {/* In full, like a sent turn: a queued message is read before it is sent. */}+ {previewText ? (+ <p className="whitespace-pre-wrap wrap-anywhere">{item.guestName === undefined ? null : (- <span className="shrink-0 text-guest-foreground">{item.guestName}</span>+ <span className="text-guest-foreground">{item.guestName} </span>)}+ {previewText}+ </p>+ ) : null}+ </div>+ <div className="flex items-center gap-0.5 pe-1 text-xs text-muted-foreground">+ {items.length > 1 && canReorder && rowRunId !== null && rowServerIndex !== null ? (+ <Button+ size="icon-xs"+ variant="ghost-muted"+ aria-label={`Reorder queued message ${position + 1} of ${items.length} (drag, or press the arrow keys)`}+ className="group/grip cursor-grab active:cursor-grabbing"+ // Not `disabled`: that drops keyboard focus mid-move and breaks repeated arrow presses.+ aria-disabled={busyRunId !== null || undefined}+ onPointerDown={() => {+ if (busyRunId === null) dragArmedRunIdRef.current = rowRunId;+ }}+ onKeyDown={(event) => {+ if (busyRunId !== null) return;+ if (event.key === "ArrowUp" && rowServerIndex > 0) {+ event.preventDefault();+ void move(rowRunId, queued[rowServerIndex - 1]?.run.id ?? null);+ }+ if (event.key === "ArrowDown" && rowServerIndex < queued.length - 1) {+ event.preventDefault();+ // Moving into the collapsed rows would unmount the focused grip.+ if (rowServerIndex + 1 >= visibleItems.length) setShowAll(true);+ void move(rowRunId, queued[rowServerIndex + 2]?.run.id ?? null);+ }+ }}+ >+ <span className="text-xs font-medium tabular-nums group-hover/queued:hidden group-focus-visible/grip:hidden">+ {position + 1}+ </span>+ <GripVerticalIcon className="hidden group-hover/queued:block group-focus-visible/grip:block" />+ </Button>+ ) : items.length > 1 ? (+ <span className="px-1.5 font-medium tabular-nums">{position + 1}</span>+ ) : null}+ {item.pending ? (+ <span className="flex items-center gap-1 px-1">+ <Clock3Icon aria-hidden className="size-3" />+ Saving+ </span>+ ) : null}+ {isEditing ? (+ <>+ <span className="px-1 text-foreground">Editing in the composer</span>+ <Button+ size="xs"+ variant="ghost"+ aria-label="Cancel editing queued message"+ onClick={props.onCancelEdit}+ >+ Cancel+ </Button>+ </>+ ) : (+ <><Tooltip>- <TooltipTrigger render={<span className="min-w-0 flex-1 truncate" />}>- {previewText}+ {/* The span keeps the tooltip, and its reason, on a disabled button. */}+ <TooltipTrigger render={<span className="flex shrink-0" />}>+ <Button+ size="icon-xs"+ variant="ghost-muted"+ aria-label="Edit queued message"+ disabled={+ item.runId === null ||+ !item.editable ||+ busyRunId !== null ||+ props.editBlockedReason !== null+ }+ onClick={() => {+ if (item.runId !== null && item.messageId !== null) {+ props.onEditQueuedRun({+ runId: item.runId,+ messageId: item.messageId,+ text: item.text,+ attachments: item.attachments,+ });+ }+ }}+ >+ <PencilIcon />+ </Button></TooltipTrigger>- <TooltipPopup side="top" className="max-w-96 break-words">- {previewText}+ <TooltipPopup>+ {props.editBlockedReason ??+ `Edit in the composer${item.serverIndex === queued.length - 1 && props.editShortcutLabel ? ` (${props.editShortcutLabel})` : ""}`}</TooltipPopup></Tooltip>- </ComposerBanner.Content>- <ComposerBanner.Actions>- {isEditing ? (- <Button- size="xs"- variant="ghost"- aria-label="Cancel editing queued message"- onClick={props.onCancelEdit}- >- Cancel- </Button>- ) : (- <>- <Tooltip>- {/* The span keeps the tooltip, and its reason, on a disabled button. */}- <TooltipTrigger render={<span className="flex shrink-0" />}>- <Button- size="icon-xs"- variant="ghost-muted"- aria-label="Edit queued message"- disabled={- item.runId === null ||- !item.editable ||- busyRunId !== null ||- props.editBlockedReason !== null- }- onClick={() => {- if (item.runId !== null && item.messageId !== null) {- props.onEditQueuedRun({- runId: item.runId,- messageId: item.messageId,- text: item.text,- attachments: item.attachments,- });- }- }}- >- <PencilIcon />- </Button>- </TooltipTrigger>- <TooltipPopup>- {props.editBlockedReason ??- `Edit in the composer${item.serverIndex === queued.length - 1 && props.editShortcutLabel ? ` (${props.editShortcutLabel})` : ""}`}- </TooltipPopup>- </Tooltip>- <Tooltip>- <TooltipTrigger render={<span className="flex shrink-0" />}>- <Button- size="xs"- variant="ghost-muted"- disabled={item.runId === null || busyRunId !== null || !canSend}- onClick={() => {- if (item.runId !== null) {- void sendQueuedMessage(item.runId);- }- }}- >- <CornerUpRightIcon />- {workflow?.canSendNow ? "Send now" : "Steer"}- </Button>- </TooltipTrigger>- <TooltipPopup>- {`${workflow?.canSendNow ? "Start a turn with this message" : "Send as a steer instead"}${item.serverIndex === 0 && props.steerShortcutLabel ? ` (${props.steerShortcutLabel})` : ""}`}- </TooltipPopup>- </Tooltip>- <Tooltip>- <TooltipTrigger- render={- <ComposerBanner.Dismiss- aria-label="Remove queued message"- disabled={item.runId === null || busyRunId !== null}- onClick={() => {- if (item.runId !== null) void remove(item.runId);- }}- />+ <Tooltip>+ <TooltipTrigger render={<span className="flex shrink-0" />}>+ <Button+ size="xs"+ variant="ghost-muted"+ disabled={item.runId === null || busyRunId !== null || !canSend}+ onClick={() => {+ if (item.runId !== null) {+ void sendQueuedMessage(item.runId);}+ }}+ >+ <CornerUpRightIcon />+ {workflow?.canSendNow ? "Send now" : "Steer"}+ </Button>+ </TooltipTrigger>+ <TooltipPopup>+ {`${workflow?.canSendNow ? "Start a turn with this message" : "Send as a steer instead"}${item.serverIndex === 0 && props.steerShortcutLabel ? ` (${props.steerShortcutLabel})` : ""}`}+ </TooltipPopup>+ </Tooltip>+ <Tooltip>+ <TooltipTrigger+ render={+ <Button+ size="icon-xs"+ variant="ghost-muted"+ aria-label="Remove queued message"+ disabled={item.runId === null || busyRunId !== null}+ onClick={() => {+ if (item.runId !== null) void remove(item.runId);+ }}/>- <TooltipPopup>Remove from queue</TooltipPopup>- </Tooltip>- </>- )}- </ComposerBanner.Actions>- </ComposerBanner.Row>- );- })}- </ComposerBanner.Children>- </ComposerBanner.Scroll>- </ComposerBanner.Root>- </ComposerBanner.Attachment>+ }+ >+ <XIcon />+ </TooltipTrigger>+ <TooltipPopup>Remove from queue</TooltipPopup>+ </Tooltip>+ </>+ )}+ </div>+ </li>+ );+ })}+ </ol>+ {collapsible ? (+ <div className="self-end pe-1 text-xs pointer-coarse:[&_[data-slot=inline-button]]:relative pointer-coarse:[&_[data-slot=inline-button]]:after:absolute pointer-coarse:[&_[data-slot=inline-button]]:after:-inset-x-1.5 pointer-coarse:[&_[data-slot=inline-button]]:after:-inset-y-3.5">+ <InlineButton+ tone="muted"+ aria-expanded={showAll}+ aria-controls={queueListId}+ // Keep the composer focused; keyboard activation still works.+ onPointerDown={(event) => event.preventDefault()}+ onClick={() => setShowAll((value) => !value)}+ >+ {showAll ? "Show fewer" : `Show all ${items.length} queued`}+ <ChevronDownIcon+ aria-hidden+ className={cn(+ "size-3.5 transition-transform duration-150 motion-reduce:transition-none",+ showAll && "rotate-180",+ )}+ />+ </InlineButton>+ </div>+ ) : null}+ </section>);}diff --git a/apps/web/src/components/chat/ThreadActivityBanners.tsx b/apps/web/src/components/chat/ThreadActivityBanners.tsxindex 39a60ed27ce..e132587a759 100644--- a/apps/web/src/components/chat/ThreadActivityBanners.tsx+++ b/apps/web/src/components/chat/ThreadActivityBanners.tsx@@ -15,21 +15,25 @@ import { cn } from "~/lib/utils";import { Button, InlineButton } from "../ui/button";import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";import type { ComposerBannerStackItem } from "./ComposerBannerStack";+import type { ThreadNowItem } from "./ThreadNow";/** Subagents waiting on the user, unless the parent is itself waiting on them. */-export function childInputBannerItem(input: {+export function childInputNowItem(input: {readonly childThreadInputs: ReadonlyArray<EnvironmentThreadShell>;readonly parentAwaitingUser: boolean;readonly onOpenThread: (threadId: ThreadId) => void;-}): ComposerBannerStackItem | null {+}): ThreadNowItem | null {const { childThreadInputs, onOpenThread } = input;const first = childThreadInputs[0];if (!first || input.parentAwaitingUser) return null;return {id: `child-input:${first.id}`,- variant: "info",- priority: "activity",- icon: first.hasPendingApprovals ? <ShieldQuestionIcon /> : <MessageCircleIcon />,+ // The only line at the end of the timeline that needs you gets the info color.+ icon: first.hasPendingApprovals ? (+ <ShieldQuestionIcon className="text-info-foreground" />+ ) : (+ <MessageCircleIcon className="text-info-foreground" />+ ),title: childThreadInputsTitle(childThreadInputs),description: childThreadInputs.map((child, index) => (<Fragment key={child.id}>@@ -43,25 +47,24 @@ export function childInputBannerItem(input: {</Fragment>)),actions: (- <Button size="xs" variant="ghost" onClick={() => onOpenThread(first.id)}>+ <InlineButton onClick={() => onOpenThread(first.id)}>{first.hasPendingApprovals ? "Open approval" : "Open question"}- </Button>+ </InlineButton>),};}-export function goalBannerItem(input: {+/** The thread's goal, for the end of the timeline. */+export function goalNowItem(input: {readonly threadId: ThreadId;readonly goal: OrchestrationV2ProviderGoal;readonly isWorking: boolean;readonly onSendCommand: (text: string, failureMessage: string) => Promise<void>;-}): ComposerBannerStackItem {+}): ThreadNowItem {const { isWorking, onSendCommand } = input;const presentation = presentProviderGoal(input.goal, isWorking);return {id: `goal:${input.threadId}`,- variant: "default",- priority: "activity",icon: <TargetIcon />,title:presentation.usage === null@@ -72,46 +75,45 @@ export function goalBannerItem(input: {actions: (<>{presentation.canResume && !isWorking ? (- <Button- size="xs"- variant="ghost"- onClick={() => void onSendCommand("/goal resume", "Failed to resume goal.")}- >- Resume- </Button>+ <>+ <InlineButton+ onClick={() => void onSendCommand("/goal resume", "Failed to resume goal.")}+ >+ Resume+ </InlineButton>+ <span aria-hidden>·</span>+ </>) : null}- <Button- size="xs"- variant="ghost"+ <InlineButton+ tone="muted"onClick={() => void onSendCommand("/goal clear", "Failed to clear goal.")}>Clear- </Button>+ </InlineButton></>),};}-export function backgroundWorkBannerItem(input: {+/** Background commands and subagents, for the end of the timeline. */+export function backgroundWorkNowItem(input: {readonly threadId: ThreadId;readonly tasks: ReadonlyArray<OrchestrationV2PendingBackgroundTask>;readonly stopDisabled: boolean;readonly stopping: boolean;readonly onStop: () => Promise<void>;readonly onOpenThread: (threadId: ThreadId) => void;-}): ComposerBannerStackItem | null {+}): ThreadNowItem | null {const { onOpenThread } = input;const presentation = presentPendingBackgroundWork(input.tasks);if (presentation === null) return null;return {id: `background-work:${input.threadId}`,- variant: "default",- priority: "activity",icon: (<spanclassName={cn(- "size-1.5 rounded-full bg-foreground",- presentation.waiting && "motion-safe:animate-status-pulse",+ "size-1.5 rounded-full",+ presentation.waiting ? "bg-foreground" : "bg-muted-foreground",)}aria-hidden="true"/>@@ -147,14 +149,9 @@ export function backgroundWorkBannerItem(input: {);}),actions: (- <Button- size="xs"- variant="ghost"- disabled={input.stopDisabled}- onClick={() => void input.onStop()}- >+ <InlineButton disabled={input.stopDisabled} onClick={() => void input.onStop()}>{input.stopping ? "Stopping..." : "Stop"}- </Button>+ </InlineButton>),};}diff --git a/apps/web/src/components/chat/ThreadNow.tsx b/apps/web/src/components/chat/ThreadNow.tsxnew file mode 100644index 00000000000..6ff4469397f--- /dev/null+++ b/apps/web/src/components/chat/ThreadNow.tsx@@ -0,0 +1,104 @@+import { RefreshCwIcon } from "lucide-react";+import type { ReactNode } from "react";++import { threadSyncLabel, type ThreadSyncPhase } from "../../threadSync";+import { cn } from "~/lib/utils";+import { NoticeText } from "./ComposerBannerStack";++/** A line of thread state for the end of the timeline. */+export interface ThreadNowItem {+ readonly id: string;+ readonly icon: ReactNode;+ readonly title: ReactNode;+ readonly description?: ReactNode;+ readonly actions?: ReactNode;+}++/** Matches ThreadStatusLine, so every line at the end of the timeline reads as one family. */+const lineClassName = cn(+ "mx-auto flex w-full min-w-0 max-w-(--chat-content-max-width) items-center gap-1.5 px-1 pb-2 text-xs text-muted-foreground [&_svg]:size-3.5 [&_svg]:shrink-0",+ // A details button must not make its line taller than the others.+ "[&_[data-slot=popover-trigger]]:-my-1.5",+ // Inline actions keep their text size but get a finger-sized hit area on touch.+ "pointer-coarse:[&_[data-slot=inline-button]]:relative pointer-coarse:[&_[data-slot=inline-button]]:after:absolute pointer-coarse:[&_[data-slot=inline-button]]:after:-inset-x-1.5 pointer-coarse:[&_[data-slot=inline-button]]:after:-inset-y-3.5",+ "transition-opacity duration-150 ease-out starting:opacity-0 motion-reduce:transition-none",+);++/** One line of thread state at the end of the timeline: icon, title, detail, then actions. */+function ThreadNowLine({+ item,+ announce = false,+}: {+ readonly item: ThreadNowItem;+ /** Announces the line when it appears; only for something that needs the user. */+ readonly announce?: boolean;+}) {+ return (+ <div+ role={announce ? "alert" : undefined}+ className={lineClassName}+ data-thread-now-line="true"+ >+ <span aria-hidden className="flex size-3.5 shrink-0 items-center justify-center">+ {item.icon}+ </span>+ {/* Title and detail read as one line that gives way before the actions, so Stop stays+ reachable; when it is cut, its details button shows all of it. */}+ <NoticeText+ detailsLabel={+ typeof item.title === "string" ? `Show details: ${item.title}` : "Show details"+ }+ className="min-w-0 truncate"+ >+ {item.title}+ {item.description ? (+ <>+ {" "}+ <span aria-hidden>·</span> {item.description}+ </>+ ) : null}+ </NoticeText>+ {item.actions ? (+ <>+ <span aria-hidden>·</span>+ <span className="flex shrink-0 items-center gap-1.5">{item.actions}</span>+ </>+ ) : null}+ </div>+ );+}++function ThreadSyncLine({ phase }: { readonly phase: ThreadSyncPhase }) {+ return (+ <div className={lineClassName} role="status" data-composer-sync-status={phase}>+ <RefreshCwIcon aria-hidden />+ <span className="truncate">{threadSyncLabel(phase)}</span>+ </div>+ );+}++/**+ * What the thread is doing now, at the end of the timeline: what needs you, background work,+ * the sync status while messages load, then the goal.+ */+export function ThreadNow({+ attention,+ work,+ syncPhase,+ goal,+}: {+ /** Something that needs you elsewhere, such as a subagent's question. */+ readonly attention: ThreadNowItem | null;+ readonly work: ThreadNowItem | null;+ readonly syncPhase: ThreadSyncPhase | null;+ readonly goal: ThreadNowItem | null;+}): ReactNode {+ return (+ <>+ {attention ? <ThreadNowLine item={attention} announce /> : null}+ {work ? <ThreadNowLine item={work} /> : null}+ {syncPhase ? <ThreadSyncLine phase={syncPhase} /> : null}+ {goal ? <ThreadNowLine item={goal} /> : null}+ </>+ );+}diff --git a/apps/web/src/components/chat/TimelineOverlays.tsx b/apps/web/src/components/chat/TimelineOverlays.tsxindex 6b326d8eeb8..0fcff19e275 100644--- a/apps/web/src/components/chat/TimelineOverlays.tsx+++ b/apps/web/src/components/chat/TimelineOverlays.tsx@@ -19,9 +19,13 @@ export function WorkspaceFileDropOverlay() {);}-/** Sits `bottom` pixels up, clear of the composer and its attached banners. */+/**+ * Sits `bottom` pixels up, clear of the composer and its attached banners. The summary names+ * what waits at the end of the timeline, which is out of view while it shows.+ */export function ScrollToEndButton(props: {readonly bottom: number;+ readonly summary: string | null;readonly onScrollToEnd: () => void;}) {return (@@ -30,7 +34,7 @@ export function ScrollToEndButton(props: {style={{ bottom: props.bottom }}><Button- aria-label="Scroll to end"+ data-scroll-to-end="true"onPointerDown={(event) => event.preventDefault()}onClick={props.onScrollToEnd}className="pointer-events-auto"@@ -39,6 +43,12 @@ export function ScrollToEndButton(props: {><ChevronDownIcon className="size-3.5" />Scroll to end+ {props.summary === null ? null : (+ <span className="text-muted-foreground">+ <span aria-hidden>· </span>+ {props.summary}+ </span>+ )}</Button></div>);diff --git a/apps/web/src/components/chat/TimelineToolActivityIcon.tsx b/apps/web/src/components/chat/TimelineToolActivityIcon.tsxindex d677d939792..26728be4449 100644--- a/apps/web/src/components/chat/TimelineToolActivityIcon.tsx+++ b/apps/web/src/components/chat/TimelineToolActivityIcon.tsx@@ -11,6 +11,7 @@ import {CircleAlertIcon,EyeIcon,GlobeIcon,+ ListTodoIcon,MessageCircleIcon,SearchIcon,SmartphoneIcon,@@ -37,6 +38,7 @@ export type WorkEntryIconName =| "brain"| "browser"| "check"+ | "list-todo"| "circle-alert"| "computer"| "code"@@ -246,6 +248,8 @@ function WorkEntryIcon({ name, className }: { name: WorkEntryIconName; classNamereturn <T3Wordmark className={className} aria-hidden />;case "check":return <CheckIcon className={className} aria-hidden />;+ case "list-todo":+ return <ListTodoIcon className={className} aria-hidden />;case "circle-alert":return <CircleAlertIcon className={className} aria-hidden />;case "eye":diff --git a/apps/web/src/components/chat/TimelineWorkEntryRow.logic.ts b/apps/web/src/components/chat/TimelineWorkEntryRow.logic.tsindex dc077090e43..2693b8279ad 100644--- a/apps/web/src/components/chat/TimelineWorkEntryRow.logic.ts+++ b/apps/web/src/components/chat/TimelineWorkEntryRow.logic.ts@@ -167,6 +167,7 @@ export function workEntryIconName(workEntry: TimelineWorkEntry): WorkEntryIconNaif (workEntry.itemType === "user_input_request" || workEntry.itemType === "approval_request") {return "message-circle";}+ if (workEntry.itemType === "todo_list") return "list-todo";if (workEntry.toolSurface) return workEntry.toolSurface;if (workEntry.structuredPayload?.type === "dynamic_tool" &&diff --git a/apps/web/src/components/chat/UsageLimitRecoveryBanner.tsx b/apps/web/src/components/chat/UsageLimitRecoveryBanner.tsxindex cbd7d0d7f0a..c9978173879 100644--- a/apps/web/src/components/chat/UsageLimitRecoveryBanner.tsx+++ b/apps/web/src/components/chat/UsageLimitRecoveryBanner.tsx@@ -29,7 +29,6 @@ export function usageLimitRecoveryBannerItem(props: RecoveryProps): ComposerBannreturn {id: `usage-limit-recovery:${runId}`,variant: "warning",- priority: "urgent",icon: <GaugeIcon />,title: "Usage limit reached",description: resetAtdiff --git a/apps/web/src/components/chat/V2ItemInspector.tsx b/apps/web/src/components/chat/V2ItemInspector.tsxindex 5e8b658be35..8df6eeb2461 100644--- a/apps/web/src/components/chat/V2ItemInspector.tsx+++ b/apps/web/src/components/chat/V2ItemInspector.tsx@@ -415,7 +415,10 @@ export const V2ItemInspector = memo(function V2ItemInspector(props: V2ItemInspec{item.type === "todo_list" ? (<StructuredValuevalue={item.steps- .map((step) => `${step.status === "completed" ? "✓" : "○"} ${step.text}`)+ .map(+ (step) =>+ `${step.status === "completed" ? "✓" : step.status === "running" ? "◉" : "○"} ${step.text}`,+ ).join("\n")}/>) : null}diff --git a/apps/web/src/components/chat/useAutoBalanceUpdateBanner.tsx b/apps/web/src/components/chat/useAutoBalanceUpdateBanner.tsxindex c0e376497da..47686c26e31 100644--- a/apps/web/src/components/chat/useAutoBalanceUpdateBanner.tsx+++ b/apps/web/src/components/chat/useAutoBalanceUpdateBanner.tsx@@ -89,7 +89,7 @@ export function useAutoBalanceUpdateBanner(return {id: `auto-balance-server-updates-${dismissedNotices.size}`,variant: failed ? "error" : "default",- priority: running ? "urgent" : "notice",+ group: "environment",icon: <ComposerServerUpdateIcon status={status} />,title: (<Popover>diff --git a/apps/web/src/components/chat/useProjectCloneBanner.tsx b/apps/web/src/components/chat/useProjectCloneBanner.tsxindex ab9bcfa09bf..9402d181c74 100644--- a/apps/web/src/components/chat/useProjectCloneBanner.tsx+++ b/apps/web/src/components/chat/useProjectCloneBanner.tsx@@ -77,7 +77,6 @@ export function useProjectCloneBanner(activeProjectRef: ScopedProjectRef | null)return {id: `project-clone:${projectId}`,variant: "info",- priority: "activity",icon: <DownloadIcon />,title: `Cloning ${name}`,description: projectCloneProgressSummary(activeProjectClone),diff --git a/apps/web/src/components/chat/useSystemComposerBanners.tsx b/apps/web/src/components/chat/useSystemComposerBanners.tsxindex 1b6a66aca90..645a8e508cc 100644--- a/apps/web/src/components/chat/useSystemComposerBanners.tsx+++ b/apps/web/src/components/chat/useSystemComposerBanners.tsx@@ -23,19 +23,14 @@ import type { ComposerBannerStackItem } from "./ComposerBannerStack";import { ENVIRONMENT_RECONNECT_WARNING_GRACE_MS } from "../ChatView.logic";import { useAtomCommand } from "../../state/use-atom-command";import { Button } from "../ui/button";-import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";import { ServerUpdateAction, serverUpdateStageLabel } from "../ServerUpdateAction";import { useAutoBalanceUpdateBanner } from "./useAutoBalanceUpdateBanner";import { ComposerServerUpdateIcon } from "./ComposerServerUpdateStatus";import {- buildVersionMismatchDismissalKey,dismissServerUpdateFailure,- dismissVersionMismatch,isServerUpdateFailureDismissed,- isVersionMismatchDismissed,resolveServerConfigVersionMismatch,resolveServerSelfUpdateCapability,- serverUpdateGuidance,supportsDesktopAppUpdate,supportsServerUpdateThreadContinuation,} from "../../versionSkew";@@ -138,18 +133,6 @@ export function useSystemComposerBanners(input: SystemComposerBannersInput) {);const autoBalanceUpdateBanner = useAutoBalanceUpdateBanner(autoUpdateEnvironments);const versionMismatch = resolveServerConfigVersionMismatch(serverConfig);- const versionMismatchDismissKey =- versionMismatch && activeThreadEnvironmentId !== null- ? buildVersionMismatchDismissalKey(activeThreadEnvironmentId, versionMismatch)- : null;- const [dismissedVersionMismatchKey, setDismissedVersionMismatchKey] = useState<string | null>(- null,- );- const versionMismatchDismissed =- versionMismatchDismissKey === dismissedVersionMismatchKey ||- isVersionMismatchDismissed(versionMismatchDismissKey);- const showVersionMismatchBanner =- versionMismatch !== null && versionMismatchDismissKey !== null && !versionMismatchDismissed;const versionMismatchServerLabel =hasMultipleRegisteredEnvironments && activeThreadEnvironmentId !== null? `${activeEnvironment?.label ?? serverConfig?.environment.label ?? activeThreadEnvironmentId} server`@@ -194,10 +177,15 @@ export function useSystemComposerBanners(input: SystemComposerBannersInput) {unavailableConnection.phase === "reconnecting");const suppressUnavailableBanner =environmentReconnecting && (updateRunning || !reconnectWarningGraceElapsed);- if (activeEnvironmentUnavailableState && unavailableConnection && !suppressUnavailableBanner) {+ const showUnavailableBanner =+ activeEnvironmentUnavailableState !== null &&+ unavailableConnection !== null &&+ !suppressUnavailableBanner;+ if (showUnavailableBanner) {items.push({id: `environment-unavailable:${activeEnvironmentUnavailableState.environmentId}`,variant: unavailableConnection.phase === "error" ? "error" : "warning",+ group: "environment",icon: <WifiOffIcon />,title: `${activeEnvironmentUnavailableState.label} is ${environmentReconnecting ? "reconnecting" : "offline"}`,description: activeEnvironment ? (@@ -223,54 +211,26 @@ export function useSystemComposerBanners(input: SystemComposerBannersInput) {),});}+ // An available update is offered by the sidebar's update pill; the composer only shows one+ // that is running or failed, since either explains what this thread's server is doing.if (!automaticEnvironment &&serverUpdateEnvironmentId &&- (serverUpdateState.status === "idle"- ? showVersionMismatchBanner- : !serverUpdateFailureDismissed)+ serverUpdateState.status !== "idle" &&+ !serverUpdateFailureDismissed) {- const updateInProgress = serverUpdateState.status === "running";const updateFailed = serverUpdateState.status === "failed";items.push({id: `server-version:${serverUpdateEnvironmentId}`,variant: updateFailed ? "error" : "default",- priority: updateInProgress ? "urgent" : "notice",+ group: "environment",icon: <ComposerServerUpdateIcon status={serverUpdateState.status} />,- title:- updateInProgress || updateFailed ? (- `${updateFailed ? "Could not update" : "Updating"} ${versionMismatchServerLabel}`- ) : versionMismatch ? (- <Tooltip>- <TooltipTrigger- render={- <button- type="button"- className="block max-w-full cursor-help truncate rounded-sm text-left"- >- Server update available- </button>- }- />- <TooltipPopup side="top">- {versionMismatchServerLabel} {versionMismatch.serverVersion}{" "}- <span aria-hidden="true">→</span> {versionMismatch.clientVersion}- </TooltipPopup>- </Tooltip>- ) : (- "Server update available"- ),+ title: `${updateFailed ? "Could not update" : "Updating"} ${versionMismatchServerLabel}`,description:serverUpdateState.status === "failed"? serverUpdateState.message- : serverUpdateState.status === "running"- ? serverUpdateStageLabel(serverUpdateState.stage)- : versionMismatchSelfUpdate !== null &&- (versionMismatchSelfUpdate !== "desktop-managed" ||- !versionMismatchDesktopAppUpdate)- ? serverUpdateGuidance(versionMismatchSelfUpdate)- : undefined,- actions: updateInProgress ? (+ : serverUpdateStageLabel(serverUpdateState.stage),+ actions: !updateFailed ? (disconnectAction) : !versionMismatch ||(versionMismatchSelfUpdate === "desktop-managed" &&@@ -283,23 +243,19 @@ export function useSystemComposerBanners(input: SystemComposerBannersInput) {desktopAppUpdate={versionMismatchDesktopAppUpdate}threadContinuation={versionMismatchThreadContinuation}targetVersion={versionMismatch.clientVersion}- label={updateFailed ? "Retry" : "Update"}+ label="Retry"variant="ghost"/>),- ...(updateInProgress || (!updateFailed && !versionMismatchDismissKey)- ? {}- : {+ ...(updateFailed+ ? {dismissLabel: "Dismiss update notice",onDismiss: () => {- if (updateFailed) {- dismissServerUpdateFailure(serverUpdateState);- setDismissedServerUpdateState(serverUpdateState);- }- dismissVersionMismatch(versionMismatchDismissKey);- setDismissedVersionMismatchKey(versionMismatchDismissKey);+ dismissServerUpdateFailure(serverUpdateState);+ setDismissedServerUpdateState(serverUpdateState);},- }),+ }+ : {}),});}if (autoBalanceUpdateBanner) items.push(autoBalanceUpdateBanner);diff --git a/apps/web/src/components/chat/useThreadLifecycle.tsx b/apps/web/src/components/chat/useThreadLifecycle.tsxindex 2cab98f8d0e..120cb1bf183 100644--- a/apps/web/src/components/chat/useThreadLifecycle.tsx+++ b/apps/web/src/components/chat/useThreadLifecycle.tsx@@ -58,11 +58,7 @@ import { appAtomRegistry } from "../../rpc/atomRegistry";import { readEnvironmentScope } from "../../state/session";import { useAtomCommand } from "../../state/use-atom-command";import { useOrchestrationCommand } from "../../state/use-orchestration-command";-import {- backgroundWorkBannerItem,- childInputBannerItem,- goalBannerItem,-} from "./ThreadActivityBanners";+import { backgroundWorkNowItem, childInputNowItem, goalNowItem } from "./ThreadActivityBanners";import type { useLocalDispatchState } from "./useLocalDispatchState";const RELATED_THREAD_SHELL_WAIT_MS = 1_000;@@ -85,7 +81,7 @@ interface ThreadLifecycleInput {readonly serverConfig: EnvironmentServerConfig | null;readonly runtimeMode: RuntimeMode;readonly isWorking: boolean;- readonly pendingBackgroundTasks: Parameters<typeof backgroundWorkBannerItem>[0]["tasks"];+ readonly pendingBackgroundTasks: Parameters<typeof backgroundWorkNowItem>[0]["tasks"];readonly activePendingApproval: PendingThreadRequests["activePendingApproval"];readonly activePendingUserInput: PendingThreadRequests["activePendingUserInput"];readonly localCheckoutBranchMismatch: {@@ -433,7 +429,7 @@ export function useThreadLifecycle(input: ThreadLifecycleInput) {};const onOpenRelatedThreadStable = useStableCallback(onOpenRelatedThread);const childThreadInputs = useChildThreadInputs(activeThreadRef);- const childInputBanner = childInputBannerItem({+ const childInputNow = childInputNowItem({childThreadInputs,parentAwaitingUser: Boolean(activePendingApproval || activePendingUserInput || activeThreadShell?.hasPendingUserInput,@@ -503,9 +499,9 @@ export function useThreadLifecycle(input: ThreadLifecycleInput) {};const sendStandaloneCommandStable = useStableCallback(sendStandaloneCommand);const activeGoal = activeThreadShell?.goal ?? null;- const goalBanner =+ const goalNow =activeThread && activeGoal !== null- ? goalBannerItem({+ ? goalNowItem({threadId: activeThread.id,goal: activeGoal,isWorking,@@ -513,8 +509,8 @@ export function useThreadLifecycle(input: ThreadLifecycleInput) {}): null;- const backgroundWorkBanner = activeThread- ? backgroundWorkBannerItem({+ const backgroundWorkNow = activeThread+ ? backgroundWorkNowItem({threadId: activeThread.id,tasks: activeBackgroundTasks,stopDisabled: !canOperateThread || isStoppingBackgroundWork,@@ -595,9 +591,9 @@ export function useThreadLifecycle(input: ThreadLifecycleInput) {shortcuts,acknowledgeActiveThreadWoke,activeBranchMismatchKey,- backgroundWorkBanner,- childInputBanner,- goalBanner,+ backgroundWorkNow,+ childInputNow,+ goalNow,handleSwitchCheckoutToThread,handleSwitchCheckoutToThreadStable,isRestoringThreadBranch,diff --git a/apps/web/src/components/chat/useTimelineFollow.ts b/apps/web/src/components/chat/useTimelineFollow.tsindex 4ebf6312dfa..c664f251abc 100644--- a/apps/web/src/components/chat/useTimelineFollow.ts+++ b/apps/web/src/components/chat/useTimelineFollow.ts@@ -355,6 +355,15 @@ export function useTimelineFollow(input: TimelineFollowInput) {});};const scrollToEndStable = useStableCallback(scrollToEnd);+ // The list does not follow footer layout, so the resting composer cannot scroll it. Growth+ // above the composer (a new notice) would cover the last rows instead.+ const followedInsetRef = useRef(composerTimelineInset);+ // oxlint-disable-next-line t3code/react-effect-budget -- scrolls the list after its bottom inset grows+ useLayoutEffect(() => {+ const grew = composerTimelineInset > followedInsetRef.current;+ followedInsetRef.current = composerTimelineInset;+ if (grew && readCurrentFollow().mode === "following") scrollToEndStable();+ }, [composerTimelineInset, readCurrentFollow, scrollToEndStable]);const handleNavigation = (navigation: TimelineNavigation) => {const composer = composerRef.current;@@ -501,6 +510,12 @@ export function useTimelineFollow(input: TimelineFollowInput) {composerRef.current?.restoreAfterTimelineReachedEnd();};const onToolOutputCollapsedAtEndStable = useStableCallback(onToolOutputCollapsedAtEnd);+ // The list ignores footer layout, so a new queued turn or status line there would land+ // under the composer. Follow it when the reader was following the end.+ const onTimelineFooterGrow = () => {+ if (readFollow().mode === "following") scrollToEndStable();+ };+ const onTimelineFooterGrowStable = useStableCallback(onTimelineFooterGrow);const onIsAtEndChange = (isAtEnd: boolean) => {const scroll = visitScroll();@@ -578,6 +593,7 @@ export function useTimelineFollow(input: TimelineFollowInput) {onTimelineAnchorReadyStable,onTimelineAnchorSizeChangedStable,onToolOutputCollapsedAtEndStable,+ onTimelineFooterGrowStable,onIsAtEndChangeStable,anchorNewTurn,attachTimelineViewport,diff --git a/apps/web/src/components/composerFooterLayout.test.ts b/apps/web/src/components/composerFooterLayout.test.tsindex 0ff09029092..b923481c7ca 100644--- a/apps/web/src/components/composerFooterLayout.test.ts+++ b/apps/web/src/components/composerFooterLayout.test.ts@@ -29,35 +29,6 @@ describe("resolveComposerTimelineInset", () => {}),).toBe(expanded);});-- it("keeps the timeline reservation stable through notice expansion and collapse", () => {- const collapsed = resolveComposerTimelineInset({- currentInset: 0,- overlayHeight: 172,- isResting: false,- });- const expanded = resolveComposerTimelineInset({- currentInset: collapsed,- overlayHeight: 532,- isResting: false,- expandedNoticesHeight: 360,- });- expect(expanded).toBe(collapsed);- const resting = resolveComposerTimelineInset({- currentInset: expanded,- overlayHeight: 470,- isResting: true,- expandedNoticesHeight: 360,- });- expect(resting).toBe(collapsed);- expect(- resolveComposerTimelineInset({- currentInset: resting,- overlayHeight: 110,- isResting: true,- }),- ).toBe(collapsed);- });});describe("context strip labels and resting composer controls", () => {diff --git a/apps/web/src/components/composerFooterLayout.ts b/apps/web/src/components/composerFooterLayout.tsindex 35092effaa8..680010da924 100644--- a/apps/web/src/components/composerFooterLayout.ts+++ b/apps/web/src/components/composerFooterLayout.ts@@ -55,11 +55,8 @@ export function resolveComposerTimelineInset(input: {overlayHeight: number;isResting: boolean;restingOnlyHeight?: number;- expandedNoticesHeight?: number;}): number {- // Expanded notices temporarily cover the timeline. Remove their growth before- // rounding so fractional measurements reserve exactly the collapsed height.- const overlayHeight = Math.ceil(input.overlayHeight - (input.expandedNoticesHeight ?? 0));+ const overlayHeight = Math.ceil(input.overlayHeight);return input.isResting? Math.max(input.currentInset,diff --git a/apps/web/src/components/guest/GuestPage.tsx b/apps/web/src/components/guest/GuestPage.tsxindex f8268d9fe49..2314fab42d1 100644--- a/apps/web/src/components/guest/GuestPage.tsx+++ b/apps/web/src/components/guest/GuestPage.tsx@@ -488,7 +488,11 @@ function GuestThread({}/>{follow.showScrollToBottom ? (- <ScrollToEndButton bottom={4} onScrollToEnd={() => follow.scrollToEnd(true)} />+ <ScrollToEndButton+ summary={null}+ bottom={4}+ onScrollToEnd={() => follow.scrollToEnd(true)}+ />) : null}</div><div className={cn(LANE, "shrink-0 pb-4")}>diff --git a/apps/web/src/performance.bench.ts b/apps/web/src/performance.bench.tsindex a8a4b54c657..4536c7a3122 100644--- a/apps/web/src/performance.bench.ts+++ b/apps/web/src/performance.bench.ts@@ -1,4 +1,4 @@-import { NodeId, PlanId, ProjectId, RunId } from "@t3tools/contracts";+import { ProjectId } from "@t3tools/contracts";import {getLatestThreadForProject,sortActiveThreadsByOrderKey,@@ -8,11 +8,7 @@ import {import { formatHourShort, formatRelativeHourShort } from "@t3tools/shared/usageFormat";import { describe, test } from "vite-plus/test";-import { makeThreadProjectionFixture } from "./test-fixtures";-import { deriveActivePlanState } from "./session-logic";-const projectId = ProjectId.make("benchmark-project");-const runId = RunId.make("benchmark-run");const start = Date.parse("2026-08-11T00:00:00.000Z");const threads = Array.from({ length: 1_000 }, (_, index) => {const timestamp = new Date(start + ((index * 997) % 1_000) * 60_000).toISOString();@@ -26,19 +22,6 @@ const threads = Array.from({ length: 1_000 }, (_, index) => {unsettledAt: null,};});-const baseProjection = makeThreadProjectionFixture();-const projection = {- ...baseProjection,- plans: Array.from({ length: 5 }, (_, index) => ({- id: PlanId.make(`plan-${index}`),- runId,- threadId: baseProjection.thread.id,- nodeId: NodeId.make("bench-node"),- status: "active" as const,- kind: "todo_list" as const,- steps: [{ id: "check", text: "Run checks", status: "running" as const }],- })),-};const hours = Array.from({ length: 24 }, (_, index) =>new Date(start + index * 3_600_000).toISOString(),);@@ -65,11 +48,6 @@ describe("client performance", () => {getLatestThreadForProject(threads, projectId, "updated_at");}).run();});- test("derive current plan from 5 normalized plans", async ({ bench }) => {- await bench("derive", () => {- deriveActivePlanState(projection, runId);- }).run();- });test("format 24 hourly usage labels and tooltips", async ({ bench }) => {await bench("format", () => {hours.map((hour) => [diff --git a/apps/web/src/session-logic.test.ts b/apps/web/src/session-logic.test.tsindex de8b3373e44..fd10c96aa1b 100644--- a/apps/web/src/session-logic.test.ts+++ b/apps/web/src/session-logic.test.ts@@ -5,7 +5,6 @@ import {CheckpointScopeId,NodeId,PlanId,- ProviderDriverKind,ProviderInstanceId,ProviderThreadId,RunAttemptId,@@ -24,14 +23,12 @@ import * as DateTime from "effect/DateTime";import { describe, expect, it } from "vite-plus/test";import {- deriveActivePlanState,deriveCanInterruptRunningThread,deriveTimelineEntriesFromVisibleTurnItems,deriveTimelineEntriesFromVisibleTurnItemsWithState,deriveRevertTurnCountByUserMessageId,derivePhase,isLatestRunSettled,- selectComposerTasksPlan,selectHandoffImageResources,selectMessageImageResources,createMessageAttachmentPreviewProjector,@@ -465,7 +462,7 @@ describe("V2 session presentation", () => {...base("item-todo", 4),type: "todo_list" as const,planId: PlanId.make("plan-visible"),- explanation: "Keep task detail in the Tasks panel",+ explanation: "Show task updates where the agent wrote them",steps: [{ id: "step-1", text: "First", status: "completed" as const },{ id: "step-2", text: "Second", status: "pending" as const },@@ -526,6 +523,7 @@ describe("V2 session presentation", () => {["event", requestItem.id],["work", commandItem.id],["event", resultItem.id],+ ["work", todoItem.id],["work", errorItem.id],["work", threadCreatedItem.id],]);@@ -545,7 +543,7 @@ describe("V2 session presentation", () => {expect(commandEntry.entry.command).toBe(commandItem.input);expect(commandEntry.entry.detail).toBeUndefined();}- const errorEntry = entries[4];+ const errorEntry = entries[5];expect(errorEntry?.kind).toBe("work");if (errorEntry?.kind === "work") {expect(errorEntry.entry.projectedItem).toBe(visibleTurnItems[5]);@@ -554,7 +552,7 @@ describe("V2 session presentation", () => {expect(errorEntry.entry.tone).toBe("info");expect(errorEntry.entry.toolLifecycleStatus).toBe("failed");}- const threadCreatedEntry = entries[5];+ const threadCreatedEntry = entries[6];expect(threadCreatedEntry?.kind).toBe("work");if (threadCreatedEntry?.kind === "work") {expect(threadCreatedEntry.entry.projectedItem?.item.type).toBe("thread_created");@@ -562,7 +560,7 @@ describe("V2 session presentation", () => {});it.each(["pending", "running", "completed"] as const)(- "keeps %s task progress available to the composer and out of the timeline",+ "shows a %s todo update in the timeline where the agent wrote it",(stepStatus) => {const projection = makeThreadProjectionFixture();const now = DateTime.makeUnsafe("2026-09-04T00:00:00.000Z");@@ -615,46 +613,17 @@ describe("V2 session presentation", () => {optimisticMessages: [],plans,}),- ).toEqual([]);- expect(- deriveActivePlanState({ ...projection, plans, turnItems: [item] }, runId),- ).toMatchObject({- runId,- steps: [- {- step: "Verify the change",- status: stepStatus === "running" ? "inProgress" : stepStatus,+ ).toMatchObject([+ {+ kind: "work",+ entry: {+ label: stepStatus === "completed" ? "Tasks 1/1" : "Tasks 0/1 · Verify the change",},- ],- });+ },+ ]);},);- it("preserves independently derived durations for repeated plan-step labels", () => {- const projection = makeThreadProjectionFixture();- const runId = RunId.make("run-timed-tasks");- const planId = PlanId.make("plan-timed-tasks");- const plan = {- id: planId,- threadId: projection.thread.id,- runId,- nodeId: NodeId.make("node-timed-tasks"),- kind: "todo_list" as const,- status: "active" as const,- steps: [- { id: "verify-a", text: "Verify", status: "completed" as const, durationMs: 3_000 },- { id: "verify-b", text: "Verify", status: "completed" as const, durationMs: 4_000 },- { id: "report", text: "Report", status: "pending" as const },- ],- };-- expect(deriveActivePlanState({ ...projection, plans: [plan] }, runId)?.steps).toEqual([- { step: "Verify", status: "completed", durationMs: 3_000 },- { step: "Verify", status: "completed", durationMs: 4_000 },- { step: "Report", status: "pending" },- ]);- });-it("waits for a dispatched turn item before adding queued input to the timeline", () => {const projection = makeThreadProjectionFixture();const now = DateTime.makeUnsafe("2026-06-20T00:00:00.000Z");@@ -1041,190 +1010,6 @@ describe("V2 session presentation", () => {});});-describe("composer tasks drawer", () => {- const projection = makeThreadProjectionFixture();- const now = projection.updatedAt;-- function providerThread(id: string, driver: string) {- return {- id: ProviderThreadId.make(id),- driver: ProviderDriverKind.make(driver),- providerInstanceId: ProviderInstanceId.make(driver),- providerSessionId: null,- appThreadId: projection.thread.id,- ownerNodeId: null,- nativeThreadRef: null,- nativeConversationHeadRef: null,- status: "idle" as const,- firstRunOrdinal: null,- lastRunOrdinal: null,- handoffIds: [],- forkedFrom: null,- createdAt: now,- updatedAt: now,- };- }-- function run(id: string, ordinal: number, providerThreadId: string | null) {- return {- id: RunId.make(id),- threadId: projection.thread.id,- ordinal,- providerInstanceId: projection.thread.providerInstanceId,- modelSelection: projection.thread.modelSelection,- providerThreadId: providerThreadId === null ? null : ProviderThreadId.make(providerThreadId),- userMessageId: MessageId.make(`message-${id}`),- rootNodeId: null,- activeAttemptId: null,- status: "completed" as const,- requestedAt: now,- startedAt: now,- completedAt: now,- checkpointId: null,- contextHandoffId: null,- };- }-- const openList = {- createdAt: "2026-06-20T00:00:00.000Z",- runId: RunId.make("run-1"),- steps: [- { step: "Inspect", status: "completed" as const },- { step: "Implement", status: "inProgress" as const },- { step: "Verify", status: "pending" as const },- ],- };- const completedList = {- ...openList,- steps: openList.steps.map((step) => ({ ...step, status: "completed" as const })),- };-- it.each(["claudeAgent", "codex"])(- "shows %s tasks through the run lifecycle, retaining unfinished tasks only for Claude",- (driver) => {- const firstRun = run("run-1", 1, driver);- const settled = {- ...projection,- providerThreads: [providerThread(driver, driver)],- runs: [firstRun],- };- const running = {- ...settled,- runs: [{ ...firstRun, status: "running" as const, completedAt: null }],- };- expect(selectComposerTasksPlan(running, openList, firstRun.id, false)).toBe(openList);- expect(selectComposerTasksPlan(running, completedList, firstRun.id, false)).toBe(- completedList,- );-- const retainedList = driver === "claudeAgent" ? openList : null;- expect(selectComposerTasksPlan(settled, openList, firstRun.id, true)).toBe(retainedList);- expect(selectComposerTasksPlan(settled, completedList, firstRun.id, true)).toBeNull();-- const nextRun = {- ...run("run-2", 2, driver),- status: "running" as const,- completedAt: null,- };- const later = { ...settled, runs: [...settled.runs, nextRun] };- expect(selectComposerTasksPlan(later, openList, nextRun.id, false)).toBe(retainedList);- },- );-- it("retains the newest unfinished Claude list after loading plans in snapshot order", () => {- const olderRun = run("run:ordinal:8", 8, "claudeAgent");- const planRun = run("run:ordinal:12", 12, "claudeAgent");- const laterRun = {- ...run("run:ordinal:13", 13, "claudeAgent"),- status: "running" as const,- completedAt: null,- };- const newestPlan = {- id: PlanId.make("plan:run:ordinal:12"),- threadId: projection.thread.id,- runId: planRun.id,- nodeId: NodeId.make("node:ordinal:12"),- kind: "todo_list" as const,- status: "active" as const,- steps: [{ id: "new", text: "Finish the current task", status: "pending" as const }],- };- for (const status of ["superseded", "active"] as const) {- const snapshot = {- ...projection,- providerThreads: [providerThread("claudeAgent", "claudeAgent")],- runs: [olderRun, planRun, laterRun],- plans: [- newestPlan,- {- ...newestPlan,- id: PlanId.make("plan:run:ordinal:8"),- runId: olderRun.id,- nodeId: NodeId.make("node:ordinal:8"),- status,- steps: [{ id: "old", text: "Stale task", status: "pending" as const }],- },- ],- };- const plan = deriveActivePlanState(snapshot, laterRun.id);- expect- .soft(selectComposerTasksPlan(snapshot, plan, laterRun.id, false), status)- .toMatchObject({- runId: planRun.id,- steps: [{ step: "Finish the current task", status: "pending" }],- });- }- });-- it.each(["codex", "claudeAgent"])(- "drops retained Claude tasks only after a new %s session actually starts",- (driver) => {- const settled = {- ...projection,- providerThreads: [- providerThread("claude-original", "claudeAgent"),- providerThread("next-session", driver),- ],- runs: [run("run-1", 1, "claude-original")],- };- const nextRun = run("run-2", 2, "next-session");- for (const status of ["queued", "cancelled"] as const) {- const unstarted = {- ...settled,- runs: [- ...settled.runs,- {- ...nextRun,- status,- startedAt: null,- completedAt: status === "cancelled" ? now : null,- },- ],- };- expect- .soft(- selectComposerTasksPlan(unstarted, openList, nextRun.id, status === "cancelled"),- `A ${status} run with an assigned provider thread has not switched sessions`,- )- .toBe(openList);- }-- const started = {- ...settled,- runs: [...settled.runs, { ...nextRun, status: "running" as const, completedAt: null }],- };- expect(selectComposerTasksPlan(started, openList, nextRun.id, false)).toBeNull();- expect(- selectComposerTasksPlan(- { ...settled, runs: [...settled.runs, nextRun] },- openList,- nextRun.id,- true,- ),- ).toBeNull();- },- );-});-describe("native provider presentation in the v2 timeline", () => {const timestamp = DateTime.makeUnsafe("2026-09-04T12:00:00.000Z");const base = {diff --git a/apps/web/src/session-logic.ts b/apps/web/src/session-logic.tsindex f386a858818..7fef6c52fe3 100644--- a/apps/web/src/session-logic.ts+++ b/apps/web/src/session-logic.ts@@ -7,7 +7,6 @@ import {type OrchestrationV2PlanArtifact,type OrchestrationV2ProjectedTurnItem,type OrchestrationV2RunAttempt,- type OrchestrationV2ThreadProjection,type OrchestrationV2TurnItem,type PlanId,type RunId,@@ -99,17 +98,6 @@ export interface WorkLogEntry {export type PendingApproval = ThreadPendingApproval;export type PendingUserInput = ThreadPendingUserInput;-export interface ActivePlanState {- readonly createdAt: string;- readonly runId: RunId | null;- readonly explanation?: string | null;- readonly steps: Array<{- readonly step: string;- readonly status: "pending" | "inProgress" | "completed";- readonly durationMs?: number;- }>;-}-export interface LatestProposedPlanState {readonly id: PlanId;readonly createdAt: string;@@ -251,71 +239,6 @@ export function derivePendingUserInputs(return [...inputs].toSorted((left, right) => left.createdAt.localeCompare(right.createdAt));}-export function deriveActivePlanState(- projection: ThreadStructure | null,- latestRunId: RunId | undefined,-): ActivePlanState | null {- if (projection === null) return null;- const plans = projection.plans- .filter((plan) => plan.kind === "todo_list")- .filter((plan) => plan.status !== "superseded");- const runOrdinals = new Map<RunId | null, number>(- projection.runs.map((run) => [run.id, run.ordinal]),- );- const plan =- plans.findLast((candidate) => candidate.runId === latestRunId) ??- plans.reduce<(typeof plans)[number] | null>(- (latest, candidate) =>- latest === null ||- (runOrdinals.get(candidate.runId) ?? -1) >= (runOrdinals.get(latest.runId) ?? -1)- ? candidate- : latest,- null,- );- if (plan === null || plan.steps.length === 0) return null;- return {- createdAt: planItemTime(projection, plan),- runId: plan.runId,- explanation: plan.explanation ?? null,- steps: plan.steps.map(({ text, status, durationMs }) => ({- step: text,- status: status === "running" ? "inProgress" : status,- ...(durationMs === undefined ? {} : { durationMs }),- })),- };-}--// Claude's unfinished tasks belong to the provider session, not just the turn.-export function selectComposerTasksPlan(- projection: ThreadStructure | null,- plan: ActivePlanState | null,- activeRunId: RunId | null,- activeRunSettled: boolean,-): ActivePlanState | null {- if (projection === null || plan === null) return null;- if (activeRunId !== null && !activeRunSettled && plan.runId === activeRunId) return plan;- if (plan.steps.every((step) => step.status === "completed")) return null;- const planProviderThreadId = projection.runs.find(- (run) => run.id === plan.runId,- )?.providerThreadId;- if (planProviderThreadId === undefined || planProviderThreadId === null) return null;- const planDriver = projection.providerThreads.find(- (providerThread) => providerThread.id === planProviderThreadId,- )?.driver;- if (planDriver !== "claudeAgent") return null;- let latestStartedRun: OrchestrationV2ThreadProjection["runs"][number] | null = null;- for (const run of projection.runs) {- if (- run.startedAt !== null &&- run.providerThreadId !== null &&- (latestStartedRun === null || run.ordinal > latestStartedRun.ordinal)- ) {- latestStartedRun = run;- }- }- return latestStartedRun?.providerThreadId === planProviderThreadId ? plan : null;-}-function planItemTime(projection: ThreadStructure,plan: Pick<OrchestrationV2PlanArtifact, "id" | "runId">,@@ -589,6 +512,17 @@ function projectedWorkEntry(row: OrchestrationV2ProjectedTurnItem): WorkLogEntrytoolData: { input: item.input, output: item.output },};}+ case "todo_list": {+ // Each todo update is a quiet row where the agent wrote it; it opens to every step.+ const done = item.steps.filter((step) => step.status === "completed").length;+ const current =+ item.steps.find((step) => step.status === "running") ??+ item.steps.find((step) => step.status === "pending");+ return {+ ...common,+ label: `Tasks ${done}/${item.steps.length}${current ? ` · ${current.text}` : ""}`,+ };+ }case "approval_request":return {...common,@@ -666,7 +600,7 @@ export function deriveTimelineEntriesFromVisibleTurnItems(for (const row of input.visibleTurnItems) {const { item } = row;if (turnItemIsWorkspacePreparation(item)) continue;- if (item.type === "todo_list" || item.type === "checkpoint") continue;+ if (item.type === "checkpoint") continue;if (item.type === "user_message" && foldedAnswerMessageIds.has(item.messageId)) continue;const createdAt = projectedItemCreatedAt(row);const attempt = resolveAttempt(item);diff --git a/apps/web/src/versionSkew.ts b/apps/web/src/versionSkew.tsindex aaf1f5dc2e9..661c0c4efca 100644--- a/apps/web/src/versionSkew.ts+++ b/apps/web/src/versionSkew.ts@@ -114,10 +114,6 @@ export function manualServerUpdateCommand(return `${runner} t3@${targetVersion}`;}-export function serverUpdateGuidance(capability: ServerSelfUpdateCapability): string {- return capability === "desktop-managed" ? "Update the desktop app" : "Update to stay in sync";-}-export function buildVersionMismatchDismissalKey(environmentId: EnvironmentId,mismatch: Pick<VersionMismatch, "clientVersion" | "serverVersion">,diff --git a/docs/user/composer.md b/docs/user/composer.mdindex acd49abdebf..e93139044fc 100644--- a/docs/user/composer.md+++ b/docs/user/composer.md@@ -54,7 +54,7 @@ See [images and videos](#images-and-videos-in-messages) for previewing and savinOn web and desktop, choose **Settings → Chat → Follow-up behavior** to queuenew messages for a later turn or steer the running turn immediately. The settingapplies to this client; already queued messages keep their place. Queued messages-are saved on the server and can be edited, reordered, or removed above the composer.+are saved on the server and can be edited, reordered, or removed before they send.When Enter sends, `Cmd+Enter` on macOS or `Ctrl+Enter` on Windows and Linux usesthe opposite action: it steers when your default is Queue and queues when yourdefault is Steer.@@ -204,19 +204,20 @@ Steer. Click it or press your send shortcut to use that action. Hold `Cmd` on maWindows and Linux to switch the button to the opposite action, then click, or use the opposite-actionshortcut described above.-Queued messages appear above the composer. Rows show a thumbnail of any attached image alongside-the text. Drag a row by its handle to reorder it, use the handle's arrow keys, promote the message-to a steer, or remove it.+On web and desktop, queued messages appear at the end of the thread under **Up next**, as dashed+messages that have not been sent yet. On mobile they appear above the composer. Each shows its text+and any attached images. Drag a message by its handle to reorder it, use the handle's arrow keys,+promote the message to a steer, or remove it.If you stop the agent or the server restarts, queued messages keep their order and are held.Press **Resume** in an empty composer on web and desktop, or **Resume queue** on mobile, tocontinue. Sending a new message also resumes the queue, unless it steers a turn that is alreadyrunning. You can edit, reorder, or remove held messages without starting them.-The pencil on a queued row opens that message in the composer for editing. The original message-stays in the queue until you save, and its row is highlighted while you edit. The message's+The pencil on a queued message opens it in the composer for editing. The original message+stays in the queue until you save, and it is highlighted while you edit. The message'sattachments appear above the text with a remove control, and new images can be added the usual way.-The checkmark saves the queued message in place; **Cancel** on its row leaves it unchanged. Whatever+The checkmark saves the queued message in place; **Cancel** next to it leaves it unchanged. Whateveryou had typed in the composer before starting the edit is restored afterwards. If the queuedmessage starts or is removed while you are editing, the edit ends: changed content moves into thecomposer when it is empty, and is discarded otherwise.@@ -248,7 +249,8 @@ Claude instances can also compact idle threads for you. SeeWith Codex and Claude, send `/goal` followed by what "done" means, for example`/goal all tests in packages/api pass`. The agent keeps working across turnsuntil it judges the goal met. The thread shows **Goal** while it works, and a-row above the composer shows the goal and its progress.+line at the end of the thread (above the composer on mobile) shows the goal and+its progress.- `/goal` alone shows the current goal. `/goal clear` removes it.- Codex also supports `/goal pause` and `/goal resume`. Stopping a Codex goaldiff --git a/docs/user/providers-claude.md b/docs/user/providers-claude.mdindex 5e0c1b158bf..206d82ce323 100644--- a/docs/user/providers-claude.md+++ b/docs/user/providers-claude.md@@ -91,8 +91,8 @@ tool, which refuses skills reserved for manual invocation.To show Claude task lists in the web and desktop apps, add`CLAUDE_CODE_ENABLE_TODO_TOOLS=1` under **Variables** in the Claude instance's-**Environment** section in **Settings > Providers**. Unfinished tasks stay visible-between turns in the same Claude session.+**Environment** section in **Settings > Providers**. Each update shows as a Tasks+row in the thread; open it to see every step.## OpenRouterdiff --git a/docs/user/updating.md b/docs/user/updating.mdindex a8945c5ced2..e00329023af 100644--- a/docs/user/updating.md+++ b/docs/user/updating.md@@ -1,9 +1,8 @@# Updating T3 CodeThe app you use and the server running your agents can be on different machines.-When a server is behind your web or desktop app, an update notice appears in the-conversation and **Settings → Environments**. Update the machine named in that-notice.+When a server is behind your web or desktop app, the update button at the bottom+of the sidebar and **Settings → Environments** offer to update it.## Update everything at once@@ -25,8 +24,8 @@ restarts.Server updates appear only after that version is published to npm. Remotedesktop apps do not wait for npm. The confirmation lists each machine it skips-and why, such as a machine that is offline or needs a manual update. Use the-notice or **Settings → Environments** for those.+and why, such as a machine that is offline or needs a manual update. Use+**Settings → Environments** for those.If a desktop app restarts on its old version, T3 Code tells you the update didnot apply. It does not install that version again on its own, even when another