fix(canvas): don't show "No matches" while the space sidebar is loading - #3910
Merged
trunk-io[bot] merged 1 commit intoJul 29, 2026
Merged
Conversation
|
😎 Merged successfully - details. |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
puemos
marked this pull request as ready for review
July 29, 2026 08:12
tatoalo
approved these changes
Jul 29, 2026
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
force-pushed
the
posthog-code/fix-space-sidebar-loading-empty-state
branch
from
July 29, 2026 09:14
8c33946 to
db03002
Compare
Contributor
Author
|
/trunk merge |
trunk-io
Bot
deleted the
posthog-code/fix-space-sidebar-loading-empty-state
branch
July 29, 2026 09:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Opening a space with a filter or search active showed the sidebar's loading skeleton and, directly underneath it, the
Recentsection'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:
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.tsxcovering 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 passedpnpm typecheck— 24/24 tasksbiome check— cleanNot verified in the running app (no desktop app available in this environment).
Automatic notifications
Created with PostHog Code