@devries-cameron20 / t3code Mirror · read-only / commits / b3041a8cb9
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 04:30 UTC

fix(web): show Setting up during worktree setup (#28832)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>

shivam committed Nov 5, 2026 at 06:44 UTC b3041a8cb9e69856be5a48602a06fe480b70d4b1
3 files changed +25 -8
apps/web/src/components/Sidebar.logic.test.ts
+7 -1
@@ -286,7 +286,13 @@ describe("resolveSidebarThreadStatus", () => {
286 ).toBe(false);
287 });
288
289 - it("reports failed only while the latest run failed", () => {
289 + it("reports worktree setup as preparing, and failed only while the latest run failed", () => {
290 + expect(
291 + resolveSidebarThreadStatus({
292 + ...idle,
293 + runtime: { ...runtime, status: "preparing" as const },
294 + }),
295 + ).toBe("preparing");
296 expect(
297 resolveSidebarThreadStatus({
298 ...idle,
apps/web/src/components/Sidebar.logic.ts
+9 -3
@@ -841,6 +841,7 @@ export type SidebarThreadStatus =
841 | "approval"
842 | "input"
843 | "request"
844 + | "preparing"
845 | "working"
846 | "waiting"
847 | "failed"
@@ -862,7 +863,9 @@ export function shouldRecedeSidebarThread(input: {
863 ) {
864 return false;
865 }
865 - if (input.status === "working" || input.status === "waiting") return true;
866 + if (input.status === "preparing" || input.status === "working" || input.status === "waiting") {
867 + return true;
868 + }
869 if (input.status === "ready" || input.status === "approval") {
870 return !input.isUnread && !input.isWoke;
871 }
@@ -893,9 +896,12 @@ export function resolveSidebarThreadStatus(thread: SidebarThreadStatusInput): Si
896 if (thread.runtime?.status === "running" && thread.blockedOnThreadWait === true) {
897 return "waiting";
898 }
899 + if (thread.runtime?.status === "preparing") {
900 + return "preparing";
901 + }
902 if (
903 thread.runtime !== null &&
898 - ["preparing", "queued", "starting", "running", "waiting"].includes(thread.runtime.status)
904 + ["queued", "starting", "running", "waiting"].includes(thread.runtime.status)
905 ) {
906 return "working";
907 }
@@ -930,7 +936,7 @@ export function resolveSidebarFolderDot(
936 (thread) => resolveSidebarThreadStatus(thread) === "ready" && hasUnseenCompletion(thread),
937 );
938 if (hasUnread) return "unread";
933 - if (statuses.has("working")) return "working";
939 + if (statuses.has("working") || statuses.has("preparing")) return "working";
940 return null;
941 }
942
apps/web/src/components/sidebar/SidebarThreadRow.tsx
+9 -4
@@ -722,9 +722,14 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
722 isSelected,
723 });
724 const topStatus =
725 - status === "working"
725 + status === "preparing" || status === "working"
726 ? {
727 - label: thread.goal?.status === "active" ? "Goal" : "Working",
727 + label:
728 + status === "preparing"
729 + ? "Setting up"
730 + : thread.goal?.status === "active"
731 + ? "Goal"
732 + : "Working",
733 icon: "working" as const,
734 className: "text-info-foreground",
735 }
@@ -958,7 +963,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
963 ? "text-sidebar-muted-foreground/75 hover:bg-sidebar-row-hover hover:text-sidebar-foreground"
964 : "bg-transparent text-sidebar-foreground hover:bg-sidebar-row-hover",
965 shouldRecede &&
961 - status === "working" &&
966 + (status === "preparing" || status === "working") &&
967 "opacity-70 transition-opacity hover:opacity-100 focus-within:opacity-100 motion-reduce:transition-none",
968 isFileDragOver && "ring-1 ring-inset ring-primary/70",
969 isFileDragOver && !props.isActive && !isSelected && "bg-sidebar-row-hover",
@@ -1496,7 +1501,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
1501 BackgroundThreadAnnouncer and the open thread's
1502 timeline speak status changes instead. */}
1503 {topStatus.label}
1499 - {status === "working" ? (
1504 + {status === "preparing" || status === "working" ? (
1505 <span aria-hidden>
1506 <WorkingDuration startedAt={resolveWorkingStartedAt(thread)} />
1507 </span>