@devries-cameron20 / t3code Mirror · read-only / commits / 915676ee6a
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, 00:45 UTC

fix(web): deleting the open thread no longer opens a side chat or subagent (#30370)

spoukyii committed Nov 9, 2026 at 06:33 UTC 915676ee6a55f795905f8d2ebf611a40f4f11368
2 files changed +28 -3
apps/web/src/components/Sidebar.logic.test.ts
+22 -1
@@ -640,7 +640,28 @@ describe("getFallbackThreadIdAfterDelete", () => {
640 { snoozedUntil: "2099-01-01T00:00:00.000Z", snoozedAt: "2026-03-09T10:06:00.000Z" },
641 ],
642 ["settled", { settledOverride: "settled", settledAt: "2026-03-09T10:06:00.000Z" }],
643 - ] as const)("skips a %s thread parked on its shelf", (_state, parked) => {
643 + [
644 + "side chat",
645 + {
646 + lineage: {
647 + rootThreadId: ThreadId.make("thread-visible"),
648 + parentThreadId: ThreadId.make("thread-visible"),
649 + relationshipToParent: "fork",
650 + sideChat: true,
651 + },
652 + },
653 + ],
654 + [
655 + "subagent",
656 + {
657 + lineage: {
658 + rootThreadId: ThreadId.make("thread-visible"),
659 + parentThreadId: ThreadId.make("thread-visible"),
660 + relationshipToParent: "subagent",
661 + },
662 + },
663 + ],
664 + ] as const)("skips a %s thread the sidebar does not list", (_state, parked) => {
665 const fallbackThreadId = getFallbackThreadIdAfterDelete({
666 threads: [
667 makeThread({
apps/web/src/components/Sidebar.logic.ts
+6 -2
@@ -1193,7 +1193,10 @@ export function resolveThreadStatusPill(input: {
1193 }
1194
1195 export function getFallbackThreadIdAfterDelete<
1196 - T extends Pick<Thread, "id" | "projectId" | "createdAt" | "updatedAt" | "settledOverride"> &
1196 + T extends Pick<
1197 + Thread,
1198 + "id" | "projectId" | "createdAt" | "updatedAt" | "settledOverride" | "lineage"
1199 + > &
1200 ThreadSortInput &
1201 ThreadSnoozeShell,
1202 >(input: {
@@ -1217,7 +1220,8 @@ export function getFallbackThreadIdAfterDelete<
1220 thread.id !== deletedThreadId &&
1221 !deletedThreadIds?.has(thread.id) &&
1222 thread.settledOverride !== "settled" &&
1220 - !effectiveSnoozed(thread, { now }),
1223 + !effectiveSnoozed(thread, { now }) &&
1224 + !isSidebarHiddenThread(thread),
1225 ),
1226 sortOrder,
1227 )[0]?.id ?? null