Skip to content

fix(canvas): don't show "No matches" while the space sidebar is loading - #3910

Merged
trunk-io[bot] merged 1 commit into
mainfrom
posthog-code/fix-space-sidebar-loading-empty-state
Jul 29, 2026
Merged

fix(canvas): don't show "No matches" while the space sidebar is loading#3910
trunk-io[bot] merged 1 commit into
mainfrom
posthog-code/fix-space-sidebar-loading-empty-state

Conversation

@puemos

@puemos puemos commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Problem

Opening a space with a filter or search active showed the sidebar's loading skeleton and, directly underneath it, the Recent section's "No matches — Try a different search or clear the filters." empty state. Nothing had loaded yet, so the sidebar was simultaneously claiming "loading" and "we looked and found nothing".

Why: what the list shows was four independent conditions spread across the render tree, not one decision. An active filter (or an open search box) keeps the Recent section on screen by design, so it also rendered during a cold load — with nothing to show, that fell into the "No matches" branch.

Changes

Those four conditions become one listStateOf(...), so the list is "unavailable" | "loading" | "empty" | "ready" and can only be one of them. The render branches read that instead of re-deriving overlapping rules.

Two consequences worth calling out:

  • Until items arrive, the existing skeleton is the only thing on screen — it stands in for pinned and recent together, rather than each section deciding for itself.
  • "No matches" and "Nothing here yet" can no longer both render, which happened when a filter or search was set on a space with no items.

Deliberately nothing else: no new components, no moved files, no restyling. The rest of the file is unchanged, and #3898's context-menu wiring is untouched.

How did you test this?

Added ChannelSidebar.test.tsx covering the loading / filtered-empty / genuinely-empty states, including the reported sequence (filter active, then the list reloads). Checked that two of the five fail against the pre-fix component and pass after it.

  • pnpm --filter @posthog/ui exec vitest run src/features/canvas — 40 files, 280 passed
  • pnpm typecheck — 24/24 tasks
  • biome check — clean

Not verified in the running app (no desktop app available in this environment).

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

@trunk-io

trunk-io Bot commented Jul 29, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit db03002.

@posthog

posthog Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🦔 ReviewHog reviewed this pull request

Nothing worth raising this time, so here's a calming picture instead:

A panda relaxing and waving

@puemos
puemos marked this pull request as ready for review July 29, 2026 08:12
The list's render branches were independent conditions rather than a mutually
exclusive chain, so a cold load with a filter active drew the skeleton and the
Recent section's "No matches" empty state at the same time.

The list now has one loading state covering pinned and recent together: until
items arrive, a single skeleton speaks for the whole list, and a zero-length
result is only reported as empty once loading settles. Also fixes "No matches"
flashing while items are still arriving from the other queries, and the two
empty states stacking when a filter or search is set on an empty space.

Generated-By: PostHog Code
Task-Id: 3bebbb5d-6e22-46c9-bacc-1c6d60bc9539
@puemos
puemos force-pushed the posthog-code/fix-space-sidebar-loading-empty-state branch from 8c33946 to db03002 Compare July 29, 2026 09:14
@puemos

puemos commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

/trunk merge

@trunk-io
trunk-io Bot merged commit cfabe0f into main Jul 29, 2026
33 checks passed
@trunk-io
trunk-io Bot deleted the posthog-code/fix-space-sidebar-loading-empty-state branch July 29, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants