Skip to content

Commit 547cd86

Browse files
fix(web): a launching thread's row reads Setting up
The row re-reads the live shell, which has no runtime before the first run, so the Working shelf showed the thread without a status. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 6b06a81 commit 547cd86

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎apps/web/src/components/sidebar/SidebarThreadRow.tsx‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useAtomMount } from "@effect/atom-react";
2+
import { asLaunchingThread } from "@t3tools/client-runtime/state/thread-inbox";
23
import { ThreadHoverCard, ThreadHoverCardPopup } from "../ThreadHoverCard";
34
import { ThreadTerminalStatusButton } from "../ThreadStatusIndicators";
45
import { discardComposerDraft } from "../../lib/discardComposerDraft";
@@ -477,9 +478,16 @@ export function SortableThreadRow(
477478
};
478479
// The sidebar arranges rows from quiet shells, which hold still while a
479480
// thread streams; reading the live shell here re-renders only this row.
481+
const liveThread = useThreadShell(
482+
scopeThreadRef(rowProps.thread.environmentId, rowProps.thread.id),
483+
);
484+
// A runtime on the arranged copy but not the run-less live shell is the list's launch overlay.
480485
const thread =
481-
useThreadShell(scopeThreadRef(rowProps.thread.environmentId, rowProps.thread.id)) ??
482-
rowProps.thread;
486+
liveThread === null
487+
? rowProps.thread
488+
: rowProps.thread.runtime !== null
489+
? asLaunchingThread(liveThread)
490+
: liveThread;
483491
// Keyed by variant so a card/slim switch remounts the row.
484492
return <SidebarThreadRow key={rowProps.variant} {...rowProps} thread={thread} sortable={bag} />;
485493
}

0 commit comments

Comments
 (0)