From fbd69b89f3ef1f2848d5add0dfbf1da64f091a06 Mon Sep 17 00:00:00 2001 From: nullStack65 <112618179+nullStack65@users.noreply.github.com> Date: Wed, 18 Nov 2026 22:26:19 +0000 Subject: [PATCH 1/2] fix(web): inbox action threads stay in the active list while they work A thread waiting on the viewing founder was moved into the collapsed Working shelf while its run was live, so it vanished from that founder's inbox view. staysActiveWhileWorking (next to founderInboxLane) keeps founder-lane "action" threads in the active list; other threads keep today's Working shelf behavior. Model: claude-sonnet-5-5 Task: fix Agent: claude-code Co-Authored-By: Claude Sonnet 5.5 --- apps/web/src/components/Sidebar.tsx | 12 +++++++++- packages/contracts/src/threadInbox.test.ts | 26 ++++++++++++++++++++++ packages/contracts/src/threadInbox.ts | 13 +++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 3461a2ae8c7c..a8284893efba 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -11,7 +11,13 @@ import { } from "@t3tools/client-runtime/state/thread-list-filter"; import { threadRoutingUpdateFromMenuAction } from "./threadActionMenu.logic"; import { attachSidebarTree } from "../lib/sidebarTree"; -import { type EnvironmentId, type ScopedProjectRef } from "@t3tools/contracts"; +import { + effectiveInboxFilter, + staysActiveWhileWorking, + type EnvironmentId, + type InboxChoice, + type ScopedProjectRef, +} from "@t3tools/contracts"; import type { EnvironmentServerConfig } from "@t3tools/client-runtime/connection"; import { dropThreadContext, @@ -373,6 +379,7 @@ interface SidebarThreadPartitionInput { readonly connectedEnvironmentIds: readonly EnvironmentId[]; readonly optimisticDrop: SidebarOptimisticDrop | null; readonly workingShelfEnabled: boolean; + readonly inboxFilter: ReadonlyArray; /** Boring mode: folders list active threads by the user's latest message. */ readonly sortActiveBySend: boolean; // Snooze wakes, the queued-turn grace and the Working shelf's exit grace depend @@ -463,6 +470,7 @@ function useSidebarThreads(input: { // Folders already separate the work, so boring mode has no Working shelf. const workingShelfEnabled = useClientSettings((s) => s.sidebarWorkingShelfEnabled) && folderGroups === null; + const inboxFilter = useClientSettings(effectiveInboxFilter); const inboxReturnsVersion = useSyncExternalStore( inboxReturns.subscribe, inboxReturns.getSnapshot, @@ -506,6 +514,7 @@ function useSidebarThreads(input: { connectedEnvironmentIds, optimisticDrop, workingShelfEnabled, + inboxFilter, sortActiveBySend: folderGroups !== null, clockKey: `${nowMinute}:${snoozeWakeClock}:${inboxReturnsVersion}`, }); @@ -661,6 +670,7 @@ function partitionSidebarThreads(input: SidebarThreadPartitionInput) { const working: EnvironmentThreadShell[] = []; const inbox = (thread: EnvironmentThreadShell, manuallyMoved = false) => workingShelfEnabled && + !staysActiveWhileWorking(thread.source.inbox, input.inboxFilter) && (manuallyMoved ? isThreadWorking(thread) : inboxObservation.isWorking(thread)) ? working : active; diff --git a/packages/contracts/src/threadInbox.test.ts b/packages/contracts/src/threadInbox.test.ts index 0722a46e327b..eb7ac055c9ce 100644 --- a/packages/contracts/src/threadInbox.test.ts +++ b/packages/contracts/src/threadInbox.test.ts @@ -10,6 +10,7 @@ import { effectiveInboxFilter, inboxOriginFor, founderInboxLane, + staysActiveWhileWorking, compositeThreadKey, agentLaunchInboxRouting, agentLaunchInboxError, @@ -334,3 +335,28 @@ it("keeps founder-owned agent-only children out of founder inboxes", () => { expect(matchesInboxView(assigned, "jeff")).toBe(true); expect(matchesInboxView(assigned, "kameron")).toBe(false); }); + +describe("staysActiveWhileWorking", () => { + const actionForKameron = makeThreadInbox({ + actor: bot, + routing: { assignee: kameron, reason: "review" }, + }); + + it("keeps a thread waiting on a shown founder in the active list", () => { + expect(founderInboxLane(actionForKameron, "kameron")).toBe("action"); + expect(staysActiveWhileWorking(actionForKameron, ["kameron", "agents"])).toBe(true); + expect(staysActiveWhileWorking(actionForKameron, ["kameron", "jeff", "shared", "agents"])).toBe(true); + }); + + it("leaves it on the Working shelf when that founder's inbox is not shown", () => { + expect(staysActiveWhileWorking(actionForKameron, ["jeff", "agents"])).toBe(false); + expect(staysActiveWhileWorking(actionForKameron, ["agents"])).toBe(false); + expect(staysActiveWhileWorking(undefined, ["kameron"])).toBe(false); + }); + + it("does not hold FYI threads or unrouted agent work active", () => { + const fyi = routeThreadInbox(actionForKameron, { attentionKind: "FYI", reason: "review" }); + expect(staysActiveWhileWorking(fyi, ["kameron"])).toBe(false); + expect(staysActiveWhileWorking(makeThreadInbox({ actor: bot }), ["kameron"])).toBe(false); + }); +}); diff --git a/packages/contracts/src/threadInbox.ts b/packages/contracts/src/threadInbox.ts index e67b8f8d13a1..91757ebe50e4 100644 --- a/packages/contracts/src/threadInbox.ts +++ b/packages/contracts/src/threadInbox.ts @@ -243,6 +243,19 @@ export const effectiveInboxFilter = (settings: { const isAllInboxes = (filter: ReadonlyArray) => InboxChoice.literals.every((choice) => filter.includes(choice)); +/** + * A thread waiting on a founder whose inbox is shown stays in the active list while it works, + * so the collapsed Working shelf cannot hide it. Agents, Shared and FYI work are unaffected. + */ +export function staysActiveWhileWorking( + inbox: ThreadInbox | null | undefined, + filter: ReadonlyArray, +) { + return Founder.literals.some( + (founder) => filter.includes(founder) && founderInboxLane(inbox, founder) === "action", + ); +} + /** * The one inbox a thread is filtered under, so unchecking an inbox hides all of its threads: * Shared, else the founder it is filed to, else Agents. Null is unclassified history. From 77addce98dd4072367b8e0a9315ce0fb12f84789 Mon Sep 17 00:00:00 2001 From: nullStack65 <112618179+nullStack65@users.noreply.github.com> Date: Wed, 18 Nov 2026 22:33:22 +0000 Subject: [PATCH 2/2] fix(web): follow the multi-select inbox filter for action threads Rebased onto the founder inbox lanes branch, where the single inbox view became a multi-select filter. An action thread for any shown founder now stays in the active list while it works. Model: claude-opus-5-5 Task: fix Agent: claude-code Co-Authored-By: Claude Opus 5.5 --- packages/contracts/src/threadInbox.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/contracts/src/threadInbox.test.ts b/packages/contracts/src/threadInbox.test.ts index eb7ac055c9ce..c3b028a501ae 100644 --- a/packages/contracts/src/threadInbox.test.ts +++ b/packages/contracts/src/threadInbox.test.ts @@ -345,7 +345,9 @@ describe("staysActiveWhileWorking", () => { it("keeps a thread waiting on a shown founder in the active list", () => { expect(founderInboxLane(actionForKameron, "kameron")).toBe("action"); expect(staysActiveWhileWorking(actionForKameron, ["kameron", "agents"])).toBe(true); - expect(staysActiveWhileWorking(actionForKameron, ["kameron", "jeff", "shared", "agents"])).toBe(true); + expect(staysActiveWhileWorking(actionForKameron, ["kameron", "jeff", "shared", "agents"])).toBe( + true, + ); }); it("leaves it on the Working shelf when that founder's inbox is not shown", () => {