Skip to content

Commit db62d2f

Browse files
aabdel0181claude
andcommitted
fix(client): opening a project and removal counts skip T3 Learn side chats
Upstream's palette project open (pingdotgg#29891) and project-removal count (pingdotgg#29917) filter by lineage only, which lets a T3 Learn side chat (top-level, with `sideChat`) be the project's latest thread or count as a listed thread. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 32a86b7 commit db62d2f

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎apps/web/src/components/CommandPalette.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import {
5050
type FilesystemBrowseResult,
5151
SourceControlProviderKind,
5252
PRIMARY_LOCAL_ENVIRONMENT_ID,
53+
isSideChatThread,
5354
resolveEnvironmentMachineKind,
5455
supportsLessonSideChats,
5556
} from "@t3tools/contracts";
@@ -538,7 +539,9 @@ function OpenCommandPaletteDialog(props: {
538539
await copyThreadReference(activeThreadReferenceCopyTarget);
539540
};
540541
// Side chats and subagents open inside their parent, so opening a project never lands on one.
541-
const threads = useVisibleThreadShells().filter((thread) => !isSidebarHiddenThread(thread));
542+
const threads = useVisibleThreadShells().filter(
543+
(thread) => !isSidebarHiddenThread(thread) && !isSideChatThread(thread),
544+
);
542545
const keybindings = useAtomValue(primaryServerKeybindingsAtom);
543546
const providersByEnvironment = useEnvironmentProviders();
544547
const { changeThemeItem, changeAppearanceItem, themeEditorItem } = useCommandPaletteThemeItems();

‎packages/client-runtime/src/state/projectRemoval.ts‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import { isListedThreadLineage } from "@t3tools/contracts";
1+
import { isListedThreadLineage, isSideChatThread } from "@t3tools/contracts";
22

33
import type { EnvironmentProject, EnvironmentThreadShell } from "./models.ts";
44

55
export function planProjectRemoval<
6-
Thread extends Pick<EnvironmentThreadShell, "environmentId" | "projectId" | "lineage">,
6+
Thread extends Pick<
7+
EnvironmentThreadShell,
8+
"environmentId" | "projectId" | "lineage" | "sideChat"
9+
>,
710
>(options: {
811
readonly members: ReadonlyArray<
912
Pick<EnvironmentProject, "id" | "environmentId" | "title" | "workspaceRoot"> & {
@@ -24,8 +27,9 @@ export function planProjectRemoval<
2427
);
2528
// Side chats and subagents go with their parent but never show in thread lists.
2629
const threadCount =
27-
projectThreads.filter((thread) => isListedThreadLineage(thread.lineage)).length +
28-
(options.unloadedThreadCount ?? 0);
30+
projectThreads.filter(
31+
(thread) => isListedThreadLineage(thread.lineage) && !isSideChatThread(thread),
32+
).length + (options.unloadedThreadCount ?? 0);
2933
const isWholeGroup = members.length === groupMemberCount;
3034
const targetKind = hasOtherMembers || !isWholeGroup ? "checkout" : "project";
3135
const singleMember = members.length === 1 ? members[0]! : null;

0 commit comments

Comments
 (0)