Skip to content
TypeScript

fix(web): hide native subagent threads in the legacy sidebar (#20808)

Lancy03b55a228ddd
diff --git a/apps/web/src/components/LegacySidebar.tsx b/apps/web/src/components/LegacySidebar.tsx
index 30cbea2378a..9076b9c127c 100644
--- a/apps/web/src/components/LegacySidebar.tsx
+++ b/apps/web/src/components/LegacySidebar.tsx
@@ -185,6 +185,7 @@ import {
archiveSelectedThreadEntries,
buildMultiSelectThreadContextMenuItems,
deleteSelectedThreadEntries,
+ filterSidebarV2VisibleThreads,
getSidebarThreadIdsToPrewarm,
resolveAdjacentThreadId,
isContextMenuPointerDown,
@@ -1157,7 +1158,7 @@ function useProjectThreads(project: SidebarProjectSnapshot) {
]),
);
const visibleProjectThreads = sortThreads(
- sidebarThreads.filter((thread) => thread.archivedAt === null),
+ filterSidebarV2VisibleThreads(sidebarThreads, null),
threadSortOrder,
);
const projectStatus = resolveProjectStatusIndicator(
@@ -3103,18 +3104,16 @@ function useSortedLegacySidebarProjects(input: {
...project,
id: project.projectKey,
}));
- const sortableThreads = sidebarThreads
- .filter((thread) => thread.archivedAt === null)
- .map((thread) => {
- const physicalKey =
- projectPhysicalKeyByScopedRef.get(
- scopedProjectKey(scopeProjectRef(thread.environmentId, thread.projectId)),
- ) ?? scopedProjectKey(scopeProjectRef(thread.environmentId, thread.projectId));
- return {
- ...thread,
- projectId: (physicalToLogicalKey.get(physicalKey) ?? physicalKey) as ProjectId,
- };
- });
+ const sortableThreads = filterSidebarV2VisibleThreads(sidebarThreads, null).map((thread) => {
+ const physicalKey =
+ projectPhysicalKeyByScopedRef.get(
+ scopedProjectKey(scopeProjectRef(thread.environmentId, thread.projectId)),
+ ) ?? scopedProjectKey(scopeProjectRef(thread.environmentId, thread.projectId));
+ return {
+ ...thread,
+ projectId: (physicalToLogicalKey.get(physicalKey) ?? physicalKey) as ProjectId,
+ };
+ });
const sortedProjects = sortProjectsForSidebar(
sortableProjects,
sortableThreads,
@@ -3178,9 +3177,7 @@ function useLegacySidebarThreads(input: {
}
const visibleSidebarThreadKeys = sortedProjects.flatMap((project) => {
const projectThreads = sortThreads(
- (threadsByProjectKey.get(project.projectKey) ?? []).filter(
- (thread) => thread.archivedAt === null,
- ),
+ filterSidebarV2VisibleThreads(threadsByProjectKey.get(project.projectKey) ?? [], null),
sidebarThreadSortOrder,
);
const projectExpanded = resolveProjectExpanded(