Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): reasoning trace follows live stream to the bottom #16225

Closedakshatshahh(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/16225/headopened View on GitHub

Showing 3 changed files with 128 additions and 2 deletions.

x
0 of 3 viewed, 3 left
4 additions and 1 deletionapps/web/src/components/chat/MessagesTimeline.tsxModified
View file
@@ -4944,8 +4944,11 @@
function ReasoningTraceContent({ entries }: { entries: ReadonlyArray<TimelineWorkEntry> }) {
const ctx = use(TimelineRowCtx);
const { isWorking, latestRunId } = use(TimelineRowActivityCtx);
+ const streaming = isWorking && entries.some(
+ (entry) => entry.runId === latestRunId && entry.toolLifecycleStatus === "inProgress",
+ );
return (
- <WorkLogDetails>
+ <WorkLogDetails followLive={streaming}>
{entries.map((entry) => (
<ChatMarkdown
key={entry.id}
100 additions and 0 deletionsapps/web/src/components/chat/WorkLog.test.tsxAdded
View file
@@ -0,0 +1,100 @@
+import { act } from "react";
+import { create, type ReactTestRenderer } from "react-test-renderer";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vite-plus/test";
+​
+import { WorkLogDetails } from "./WorkLog";
+​
+const VIEWPORT = 384;
+​
+// Stand-in for the measured scroll geometry; react-test-renderer has no layout.
+const mockEl = {
+ scrollHeight: 1000,
+ clientHeight: VIEWPORT,
+ scrollTop: 0,