fix(desktop): search hidden projects in the sidebar filter

AS
1d ago
+62-6

What & why

The sidebar's project filter never saw hidden projects. useDashboardSidebarData.ts:214 drops every hidden row before the project tree is built, so filterDashboardSidebarProjects only ever receives visible projects. Searching for the name of a hidden project therefore showed No projects match "<query>" while that project sat in the "N hidden projects" restore row directly below, still listing all of them unfiltered.

With 40+ hidden projects this makes a hidden project effectively unfindable by name — the only way back is to open the restore dropdown and scroll.

This adds filterDashboardSidebarHiddenProjects, a sibling of the existing filter that reuses its matches helper, and runs the restore list through it. Names only: a hidden project's workspaces are never built, so there is nothing else to match on. The host filter (all/local/cloud) deliberately does not narrow that row for the same reason — which is why the empty state is suppressed on the text query alone, leaving No cloud workspaces / No local workspaces behaving exactly as before.

Searching premier with 41 hidden now shows 1 hidden project, and the dropdown holds just that one; clicking it restores the project with its folders and pins untouched, as before. A query that matches no hidden project hides the row entirely, which is what every other filtered row in the sidebar does.

How I tested it

  • bun test …/DashboardSidebar/utils/filterDashboardSidebarProjects — 14 pass / 0 fail, including two new cases: a case-insensitive name match, and identity return on an empty query (the sidebar's memoized rows depend on that referential stability, so the no-query path must not allocate).
  • bunx biome check on all four files — clean.
  • bun run --cwd apps/desktop typecheck — no errors in DashboardSidebar.

Honest scope note on where those ran: the three filterDashboardSidebarProjects/* files are byte-identical between my working branch and main, and the commands above ran against them. DashboardSidebar.tsx has drifted on my branch, so the four edits to it were re-applied by hand onto main's copy — the lint above covers that file as committed here, but the test and typecheck runs were against the equivalent change on my branch, not this exact tree.

I have not exercised this in the dev app, so I have not watched the row re-render as the query is typed; the filter itself is unit-tested, the wiring is not.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too)
  • "Allow edits from maintainers" is checked on fork PRs
  • I have signed the CLA (the bot asks on your first PR)

Summary by cubic

The sidebar project filter now matches hidden projects, so typing a hidden project's name surfaces it in the restore row instead of showing "No projects match" while the project sat unfiltered below.

The restore list runs through the same name-matching filter used for visible projects. The no-match empty state is suppressed only while the restore row is on screen, so it returns when the project list is collapsed. Only names match since hidden projects have no built workspaces; the host filter deliberately doesn't narrow that row either.

Summary by CodeRabbit

  • Bug Fixes
    • Hidden projects now appear in the sidebar when their names match the search query. Host filters do not narrow hidden projects.
    • The no-results message now reflects whether any visible projects or matching hidden projects are available under the current search criteria.
  • Tests
    • Added coverage for matching hidden project names and for searches containing only whitespace.