From eff7264a2dd21036676d55d862442044983b2a6e Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Fri, 30 Oct 2026 21:06:03 +1000 Subject: [PATCH] fix(session-ui): stop re-checking the timeline projection on every streamed delta (#60577) --- packages/session-ui/src/timeline/projection.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/session-ui/src/timeline/projection.ts b/packages/session-ui/src/timeline/projection.ts index 3802d7db245..a31b0d52a84 100644 --- a/packages/session-ui/src/timeline/projection.ts +++ b/packages/session-ui/src/timeline/projection.ts @@ -8,7 +8,7 @@ import type { SessionStatus, } from "@opencode/client/promise" import { Effect, Option, Predicate, Schema } from "effect" -import { createMemo, mapArray, type Accessor } from "solid-js" +import { createComputed, createMemo, createSignal, mapArray, type Accessor } from "solid-js" import { currentContentDefaultOpen, currentToolFailed, @@ -157,7 +157,15 @@ export function createReactiveTimelineProjection(input: { .flatMap((message) => message.type === "assistant" ? message.content.filter((content) => content.type !== "tool") : [], ), - (content) => [content, createMemo(() => !!content.text.trim())] as const, + (content) => { + // A memo here went stale on every streamed delta, which marked the projection below pending; Solid then + // re-checked each of its thousands of sources to find nothing changed. A signal set from a computation + // notifies only when visibility actually flips. + const [visible, setVisible] = createSignal(false) + createComputed(() => setVisible(!!content.text.trim())) + + return [content, visible] as const + }, ) const textVisible = createMemo(() => new Map>(textParts()))