Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): live reasoning stays scrolled to the newest text while it streams #19334

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/19334/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 3 changed files with 136 additions and 5 deletions.

x
0 of 3 viewed, 3 left
4 additions and 4 deletionsapps/web/src/components/chat/MessagesTimeline.tsxModified
View file
@@ -5433,8 +5433,10 @@
function ReasoningTraceContent({ entries }: { entries: ReadonlyArray<TimelineWorkEntry> }) {
const ctx = use(TimelineRowCtx);
const { isWorking, latestRunId } = use(TimelineRowActivityCtx);
+ const isStreaming = (entry: TimelineWorkEntry) =>
+ isWorking && entry.runId === latestRunId && entry.toolLifecycleStatus === "inProgress";
return (
- <WorkLogDetails>
+ <WorkLogDetails followLive={entries.some(isStreaming)}>
{entries.map((entry) => (
<ChatMarkdown
key={entry.id}
@@ -5443,9 +5445,7 @@
cwd={ctx.markdownCwd}
threadRef={ctx.threadRef ?? undefined}
skills={ctx.skills}
- isStreaming={
- isWorking && entry.runId === latestRunId && entry.toolLifecycleStatus === "inProgress"
- }
+ isStreaming={isStreaming(entry)}
headingLevelOffset={MESSAGE_HEADING_LEVEL}
onUseArtifactTemplate={ctx.onUseArtifactTemplate}
onImageExpand={ctx.onImageExpand}
103 additions and 0 deletionsapps/web/src/components/chat/WorkLog.test.tsxAdded
View file
@@ -0,0 +1,103 @@
+// @vitest-environment jsdom
+​