From 64f4db48abca612f224fdfeda0747364d148bfd8 Mon Sep 17 00:00:00 2001 From: Ashad001 Date: Sat, 7 Nov 2026 12:34:38 +0500 Subject: [PATCH 1/2] fix(desktop): search hidden projects in the sidebar filter The sidebar filter only ever saw visible projects, so typing the name of a hidden one returned "No projects match" while the project sat in the restore list right below, unfiltered. Filter that list by the same query and drop the empty state when it still holds a match. Names only: a hidden project's workspaces are never built, so there is nothing else to match against. The host filter does not narrow the row for the same reason. --- .../DashboardSidebar/DashboardSidebar.tsx | 19 +++++++++++--- .../filterDashboardSidebarProjects.test.ts | 26 +++++++++++++++++-- .../filterDashboardSidebarProjects.ts | 15 +++++++++++ .../filterDashboardSidebarProjects/index.ts | 5 +++- 4 files changed, 59 insertions(+), 6 deletions(-) diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/DashboardSidebar.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/DashboardSidebar.tsx index 91a0199bac7..42a6d0d409b 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/DashboardSidebar.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/DashboardSidebar.tsx @@ -78,7 +78,10 @@ import type { DashboardSidebarProject, DashboardSidebarWorkspace, } from "./types"; -import { filterDashboardSidebarProjects } from "./utils/filterDashboardSidebarProjects"; +import { + filterDashboardSidebarHiddenProjects, + filterDashboardSidebarProjects, +} from "./utils/filterDashboardSidebarProjects"; import { filterDashboardSidebarProjectsByHost, matchesHostFilter, @@ -278,8 +281,18 @@ const DashboardSidebarContent = memo(function DashboardSidebarContent({ () => displayedGroups.map((project) => project.id), [displayedGroups], ); + const displayedHiddenProjects = useMemo( + () => + filterDashboardSidebarHiddenProjects(hiddenProjects, projectFilterQuery), + [hiddenProjects, projectFilterQuery], + ); const trimmedFilterQuery = projectFilterQuery.trim(); const isFilterActive = trimmedFilterQuery !== "" || hostFilter !== "all"; + // A matching hidden project is a match too, and its row renders above the + // empty state. Only the query narrows that row, never the host filter. + const hasNoMatches = + displayedGroups.length === 0 && + (trimmedFilterQuery === "" || displayedHiddenProjects.length === 0); // The sort modes only reorder rows inside a project, so the project list // is still the manual order and stays draggable; only a filter, which // hides projects outright, makes a project drop unsafe to commit. @@ -527,11 +540,11 @@ const DashboardSidebarContent = memo(function DashboardSidebarContent({ )} {!isCollapsed && !workspacesListCollapsed && ( )} - {!isCollapsed && isFilterActive && displayedGroups.length === 0 && ( + {!isCollapsed && isFilterActive && hasNoMatches && (
{trimmedFilterQuery !== "" ? t({ diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/filterDashboardSidebarProjects/filterDashboardSidebarProjects.test.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/filterDashboardSidebarProjects/filterDashboardSidebarProjects.test.ts index ffa3958f6cd..4ac460ed67c 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/filterDashboardSidebarProjects/filterDashboardSidebarProjects.test.ts +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/filterDashboardSidebarProjects/filterDashboardSidebarProjects.test.ts @@ -4,7 +4,10 @@ import { makeSection, makeWorkspace, } from "../testProjectFixtures"; -import { filterDashboardSidebarProjects } from "./filterDashboardSidebarProjects"; +import { + filterDashboardSidebarHiddenProjects, + filterDashboardSidebarProjects, +} from "./filterDashboardSidebarProjects"; const projects = [ makeProject({ @@ -82,7 +85,9 @@ describe("filterDashboardSidebarProjects", () => { it("trims the query before matching", () => { expect( - filterDashboardSidebarProjects(projects, " hero ").map((p) => p.id), + filterDashboardSidebarProjects(projects, " hero ").map( + (project) => project.id, + ), ).toEqual(["p-marketing"]); }); @@ -114,3 +119,20 @@ describe("filterDashboardSidebarProjects", () => { expect(section.section.workspaces).toHaveLength(2); }); }); + +describe("filterDashboardSidebarHiddenProjects", () => { + const hidden = [ + { id: "h1", name: "premiere-plugin", iconUrl: null, color: null }, + { id: "h2", name: "nango-test", iconUrl: null, color: null }, + ]; + + it("keeps only the hidden projects whose name matches", () => { + expect( + filterDashboardSidebarHiddenProjects(hidden, "PREMIER").map((p) => p.id), + ).toEqual(["h1"]); + }); + + it("returns the list untouched without a query", () => { + expect(filterDashboardSidebarHiddenProjects(hidden, " ")).toBe(hidden); + }); +}); diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/filterDashboardSidebarProjects/filterDashboardSidebarProjects.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/filterDashboardSidebarProjects/filterDashboardSidebarProjects.ts index 6d2bccfbfb9..41f6ced7f46 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/filterDashboardSidebarProjects/filterDashboardSidebarProjects.ts +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/filterDashboardSidebarProjects/filterDashboardSidebarProjects.ts @@ -1,4 +1,5 @@ import type { + DashboardSidebarHiddenProject, DashboardSidebarProject, DashboardSidebarProjectChild, } from "../../types"; @@ -80,3 +81,17 @@ export function filterDashboardSidebarProjects( return [{ ...project, isCollapsed: false, children }]; }); } + +/** + * The same filter over the hidden-projects restore list, so a search still + * finds a hidden project. Names only: a hidden project's workspaces are never + * built, so there is nothing else to match. + */ +export function filterDashboardSidebarHiddenProjects( + projects: DashboardSidebarHiddenProject[], + query: string, +): DashboardSidebarHiddenProject[] { + const normalizedQuery = query.trim().toLowerCase(); + if (normalizedQuery === "") return projects; + return projects.filter((project) => matches(project.name, normalizedQuery)); +} diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/filterDashboardSidebarProjects/index.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/filterDashboardSidebarProjects/index.ts index 1b122941f27..5e74ccdd507 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/filterDashboardSidebarProjects/index.ts +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/filterDashboardSidebarProjects/index.ts @@ -1 +1,4 @@ -export { filterDashboardSidebarProjects } from "./filterDashboardSidebarProjects"; +export { + filterDashboardSidebarHiddenProjects, + filterDashboardSidebarProjects, +} from "./filterDashboardSidebarProjects"; From 8eea1c2357da0f4504c477bfa61ccf9da2c2b184 Mon Sep 17 00:00:00 2001 From: Ashad001 Date: Sat, 7 Nov 2026 12:43:42 +0500 Subject: [PATCH 2/2] fix(desktop): keep the empty state when the project list is collapsed The hidden-projects row only renders while the list is expanded, so suppressing the empty state on a hidden match left nothing on screen at all when it was collapsed. Suppress it only while that row is shown. --- .../components/DashboardSidebar/DashboardSidebar.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/DashboardSidebar.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/DashboardSidebar.tsx index 42a6d0d409b..a772133dd5f 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/DashboardSidebar.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/DashboardSidebar.tsx @@ -288,11 +288,14 @@ const DashboardSidebarContent = memo(function DashboardSidebarContent({ ); const trimmedFilterQuery = projectFilterQuery.trim(); const isFilterActive = trimmedFilterQuery !== "" || hostFilter !== "all"; - // A matching hidden project is a match too, and its row renders above the - // empty state. Only the query narrows that row, never the host filter. + // A matching hidden project is a match too, so the empty state would + // contradict the row above it — but only while that row is on screen, and + // only the query narrows it, never the host filter. const hasNoMatches = displayedGroups.length === 0 && - (trimmedFilterQuery === "" || displayedHiddenProjects.length === 0); + (trimmedFilterQuery === "" || + workspacesListCollapsed || + displayedHiddenProjects.length === 0); // The sort modes only reorder rows inside a project, so the project list // is still the manual order and stays draggable; only a filter, which // hides projects outright, makes a project drop unsafe to commit.