From c71bc867a1d5ac5c3067478779774698308cd9f1 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 23 Jul 2026 14:54:30 +0200 Subject: [PATCH] keep stale project refs in mobile filters Co-authored-by: codex --- .../features/threads/ThreadNavigationSidebar.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx index e6a33002a0..0a14b7847c 100644 --- a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx +++ b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx @@ -257,10 +257,6 @@ function ThreadNavigationSidebarPane( setSelectedProjectKey(null); } }, [projectFilterOptions, selectedProjectKey]); - const scopedProjects = useMemo( - () => (selectedProjectScope === null ? projects : selectedProjectScope.projects), - [projects, selectedProjectScope], - ); const selectedProjectRefs = useMemo( () => selectedProjectScope === null @@ -272,6 +268,15 @@ function ThreadNavigationSidebarPane( ), [selectedProjectScope], ); + const scopedProjects = useMemo( + () => + selectedProjectRefs === null + ? projects + : projects.filter((project) => + selectedProjectRefs.has(scopedProjectKey(project.environmentId, project.id)), + ), + [projects, selectedProjectRefs], + ); const scopedThreads = useMemo( () => selectedProjectRefs === null