From 9b59d5fb31bc5d4dd9e2a000bdc2a08018a7874b Mon Sep 17 00:00:00 2001 From: LukeParkerDev <10430890+Hona@users.noreply.github.com> Date: Fri, 15 May 2026 08:57:17 +1000 Subject: [PATCH] fix(app): preserve timeline row state --- .../src/pages/session/message-timeline.tsx | 270 +++++++++--------- 1 file changed, 138 insertions(+), 132 deletions(-) diff --git a/packages/app/src/pages/session/message-timeline.tsx b/packages/app/src/pages/session/message-timeline.tsx index e28b9ddcd1..8a9840c677 100644 --- a/packages/app/src/pages/session/message-timeline.tsx +++ b/packages/app/src/pages/session/message-timeline.tsx @@ -10,6 +10,7 @@ import { onCleanup, Show, mapArray, + untrack, type Accessor, type JSX, } from "solid-js" @@ -79,6 +80,7 @@ const emptyAssistantMessages: AssistantMessage[] = [] const idle = { type: "idle" as const } type FramedTimelineRow = Exclude +type TimelineRowByTag = Extract function sameKeys(a: readonly string[] | undefined, b: readonly string[] | undefined) { if (a === b) return true @@ -916,7 +918,7 @@ export function MessageTimeline(props: { const getMsgPart = (messageID: string, partID: string) => getMsgParts(messageID).find((part) => part.id === partID) const renderAssistantPartGroup = (row: Accessor) => { - if (row().group.type === "context") { + if (untrack(row).group.type === "context") { const parts = createMemo(() => { const group = row().group if (group.type !== "context") return emptyTools @@ -966,7 +968,7 @@ export function MessageTimeline(props: { function TimelineRowFrame(input: { row: Accessor; children: JSX.Element }) { const anchor = () => { const row = input.row() - return row._tag === "CommentStrip" || (row._tag === "UserMessage" && props.anchor) + return row._tag === "CommentStrip" || (row._tag === "UserMessage" && row.anchor) } const previousUserMessage = () => { const row = input.row() @@ -997,143 +999,147 @@ export function MessageTimeline(props: { ) } - const renderTimelineRow = (row: TimelineRow.TimelineRow) => { - return ( -