You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stop sessions detail observer thrash + fix auto-scroll race
- Observer + scroll listener now attach once on mount instead of on every
streaming chunk (deps `[]`, not `[merged.length]`). Earlier this caused
sustained CPU during fast streams.
- Auto-scroll write deferred to the next animation frame so it runs after
the virtualizer's layout-effect measures `getTotalSize()`. Without rAF
the imperative scrollTop write races the virtualizer and the user gets
"stuck half a row up" during streaming.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.sessions.$sessionParam/route.tsx
+22-14Lines changed: 22 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -326,6 +326,9 @@ function RawConversationView({
326
326
[getCompactText]
327
327
);
328
328
329
+
// Observer + scroll listener attach once on mount. Earlier this effect
330
+
// depended on `merged.length` and tore down / re-attached on every
331
+
// streaming chunk, thrashing CPU on hot sessions.
329
332
useEffect(()=>{
330
333
constbottomElement=bottomRef.current;
331
334
constscrollElement=scrollRef.current;
@@ -338,38 +341,43 @@ function RawConversationView({
0 commit comments