From 5d55571d8d0ea5def971f193dd2d3e7b61eec39d Mon Sep 17 00:00:00 2001 From: Dax Date: Sun, 15 Nov 2026 18:00:39 -0500 Subject: [PATCH] fix(app): no spinner on subagent rows in the new timeline (#64132) --- .../timeline-subagent-rows.spec.ts | 10 ++++---- .../src/storybook/current-session-story.tsx | 4 --- .../src/timeline-next/event-row.tsx | 14 +++-------- packages/session-ui/src/timeline-next/row.tsx | 25 ++----------------- .../stories/playground.stories.tsx | 2 +- .../timeline-next/stories/session-replay.ts | 14 +---------- .../src/timeline-next/timeline-next.css | 3 +-- 7 files changed, 13 insertions(+), 59 deletions(-) diff --git a/packages/session-ui/component-tests/timeline-subagent-rows.spec.ts b/packages/session-ui/component-tests/timeline-subagent-rows.spec.ts index cd70b73ba32..48664fc319b 100644 --- a/packages/session-ui/component-tests/timeline-subagent-rows.spec.ts +++ b/packages/session-ui/component-tests/timeline-subagent-rows.spec.ts @@ -2,7 +2,7 @@ import { expect, story } from "../../stories/playwright/story" const playground = "timeline-playground--playground" -story("a subagent row leads with its status chip and spins only while the work runs", async ({ mount }) => { +story("a subagent row leads with its status chip", async ({ mount }) => { const timeline = await mount(playground, { args: { scenario: "Background work", activity: true } }) const rows = timeline.locator('[data-component="timeline-subagent"] > [data-slot="timeline-event-item"]') @@ -19,14 +19,14 @@ story("a subagent row leads with its status chip and spins only while the work r ]) // Agent names are capitalized by CSS, so their text is as configured. await expect(rows.nth(3).locator("> *")).toHaveText(["Completed", "review Agent", "Review the theme store"]) - // Every subagent here has reported back, so no start spins. - await expect(rows.locator('[data-component="session-progress-indicator-v2"]')).toHaveCount(0) }) -story("a start whose subagent has not reported back spins", async ({ mount }) => { +// The timeline is a list of events: a start keeps its ring even while its subagent has not reported back. +story("a started subagent never spins", async ({ mount }) => { const timeline = await mount(playground, { args: { scenario: "Subagent between tools", activity: true } }) const status = timeline.locator('[data-component="timeline-subagent"] [data-slot="timeline-event-item-status"]') await expect(status).toHaveText("Started") - await expect(status.locator('[data-component="session-progress-indicator-v2"]')).toHaveCount(1) + await expect(status.locator('svg[data-slot="timeline-event-item-glyph"] circle')).toHaveCount(1) + await expect(status.locator('[data-component="session-progress-indicator-v2"]')).toHaveCount(0) }) diff --git a/packages/session-ui/src/storybook/current-session-story.tsx b/packages/session-ui/src/storybook/current-session-story.tsx index ffd04a3e358..c415960b684 100644 --- a/packages/session-ui/src/storybook/current-session-story.tsx +++ b/packages/session-ui/src/storybook/current-session-story.tsx @@ -1,4 +1,3 @@ -import type { SessionStatus } from "@opencode/client/promise" import type { SessionDocument } from "../document" import { File } from "../components/file" import { DataProvider, type ReadMediaUrlFn, type TurnDiffSource } from "../context/data" @@ -15,8 +14,6 @@ export function CurrentSessionProviders(props: { backgroundCompaction?: boolean readMedia?: ReadMediaUrlFn turnDiff?: TurnDiffSource - /** Other sessions' statuses, such as the subagents a replay has started. */ - sessionStatus?: Record children: JSX.Element }) { return ( @@ -78,7 +75,6 @@ export function CurrentSessionProviders(props: { [CURRENT_SESSION_ID]: props.document.status, session_child_review: { type: "idle" }, session_child_tests: { type: "busy" }, - ...props.sessionStatus, }, session_diff: { [CURRENT_SESSION_ID]: props.document.diffs }, }} diff --git a/packages/session-ui/src/timeline-next/event-row.tsx b/packages/session-ui/src/timeline-next/event-row.tsx index 215716e200f..76e25946e95 100644 --- a/packages/session-ui/src/timeline-next/event-row.tsx +++ b/packages/session-ui/src/timeline-next/event-row.tsx @@ -4,7 +4,6 @@ import { For, Match, Show, Switch, createMemo } from "solid-js" import { BasicTool } from "../components/basic-tool" import { useData } from "../context/data" import { taskAgentName } from "../tools/tool-renderer" -import { SessionProgressIndicatorV2 } from "../v2/components/session-progress-indicator-v2" import { summarizeShells, verbKeys, type TimelineEvent } from "./events" /** @@ -81,12 +80,7 @@ const statusKeys = { } as const /** One subagent or shell an events row or an opened activity group lists: who did it and what it was. */ -export function TimelineEventItem(props: { - event: TimelineEvent - /** The subagent this start launched is still working. */ - running?: boolean - onRevealShell?: (shellID: string) => void -}) { +export function TimelineEventItem(props: { event: TimelineEvent; onRevealShell?: (shellID: string) => void }) { const i18n = useI18n() const data = useData() @@ -140,12 +134,10 @@ export function TimelineEventItem(props: { open() }} > - {/* A subagent leads with its status chip; a still-running start spins instead of showing its ring. */} + {/* A subagent leads with its status chip. */} - }> - - + {i18n.t(statusKeys[state()])} diff --git a/packages/session-ui/src/timeline-next/row.tsx b/packages/session-ui/src/timeline-next/row.tsx index 13cf4417158..fc8d79dcaf6 100644 --- a/packages/session-ui/src/timeline-next/row.tsx +++ b/packages/session-ui/src/timeline-next/row.tsx @@ -50,7 +50,7 @@ import { attached } from "../components/message-file" import { CompactionMessage, CompactionQueued } from "./compaction" import { unwrapErrorMessage } from "./errors" import { TimelineEventItem, TimelineEventRow } from "./event-row" -import { noticeEvent, toolEvent, type TimelineEvent } from "./events" +import { noticeEvent, toolEvent } from "./events" import { trackNestedRails } from "./nested-rail" import { contentEntries, createNextTimelineProjection, resolveContent, workedDuration } from "./projection" import { contentOpens, diffOpens, goal as goalMessage, movedInPlace, thoughtOpens, toolRule } from "./rules" @@ -119,27 +119,6 @@ export function createNextTimelineRowRenderer(input: { } }) - // Subagents that have reported back, by their session: a finish or stop notice ends the work its start launched. - const reported = createMemo( - () => - new Set( - turns().messages.flatMap((message) => { - const sessionID = message.type === "synthetic" ? noticeEvent(message)?.sessionID : undefined - - return sessionID ? [sessionID] : [] - }), - ), - ) - - // A start spins while its subagent has not reported back and its session is still working. - const running = (event: TimelineEvent) => { - const id = event.sessionID - - if (event.verb !== "started" || event.failed || !id || reported().has(id)) return false - - return (data.store.session_status[id]?.type ?? "idle") !== "idle" - } - const patchOwners = createMemo(() => { const owners = new Map() const rows = input.projection.rows() @@ -462,7 +441,7 @@ export function createNextTimelineRowRenderer(input: { {(event) => (
- +
)}
diff --git a/packages/session-ui/src/timeline-next/stories/playground.stories.tsx b/packages/session-ui/src/timeline-next/stories/playground.stories.tsx index 630d6369ecd..91568f2ab97 100644 --- a/packages/session-ui/src/timeline-next/stories/playground.stories.tsx +++ b/packages/session-ui/src/timeline-next/stories/playground.stories.tsx @@ -228,7 +228,7 @@ export const Playground = {
- + = {} const at = () => start + state.used * 1_500 const id = (prefix: string) => `${prefix}_${messages.length}_${state.used}` @@ -911,7 +907,6 @@ export function replayScript(script: Beat[], limit: number, start: number) { if (beat.kind === "report" && beat.source === "subagent") { closeStep() messages.push(subagentReport(id("msg_report"), at(), beat)) - children[beat.childID] = { type: "idle" } state.busy = true } @@ -951,13 +946,7 @@ export function replayScript(script: Beat[], limit: number, start: number) { if (beat.kind === "say") assistant().content.push({ type: "text", text: done ? beat.text : beat.text.slice(0, beat.text.length / 2) }) - if (beat.kind === "tool") { - const call = tool(id("tool"), beat, done, at()) - const sessionID = beat.name === "subagent" ? toolEvent(call)?.sessionID : undefined - assistant().content.push(call) - - if (sessionID) children[sessionID] = { type: "busy" } - } + if (beat.kind === "tool") assistant().content.push(tool(id("tool"), beat, done, at())) if (beat.kind === "interrupt" && state.assistant) { state.assistant.content = state.assistant.content.map((content) => @@ -993,7 +982,6 @@ export function replayScript(script: Beat[], limit: number, start: number) { status: { type: state.busy ? "busy" : "idle" }, diffs: [], } satisfies SessionDocument, - children: { ...children }, caption: state.caption, } } diff --git a/packages/session-ui/src/timeline-next/timeline-next.css b/packages/session-ui/src/timeline-next/timeline-next.css index ca403bf4a30..fb658f06d14 100644 --- a/packages/session-ui/src/timeline-next/timeline-next.css +++ b/packages/session-ui/src/timeline-next/timeline-next.css @@ -311,8 +311,7 @@ line-height: 16px; white-space: nowrap; - [data-slot="timeline-event-item-glyph"], - [data-component="session-progress-indicator-v2"] { + [data-slot="timeline-event-item-glyph"] { flex-shrink: 0; width: 12px; height: 12px;