Skip to content

fix(posts-inserter): show placeholder when block has zero posts#166

Open
dkoo wants to merge 4 commits into
releasefrom
fix/posts-inserter-placeholder
Open

fix(posts-inserter): show placeholder when block has zero posts#166
dkoo wants to merge 4 commits into
releasefrom
fix/posts-inserter-placeholder

Conversation

@dkoo
Copy link
Copy Markdown
Contributor

@dkoo dkoo commented May 29, 2026

All Submissions:

Changes proposed in this Pull Request:

Shows a placeholder when the Posts Inserter block has zero posts to display. This can easily happen by selecting "Display specific posts" and not selecting any posts, or by choosing a combination of post types and category filters that match zero posts.

Closes NPPM-2870.

How to test the changes in this Pull Request:

While on release:

  1. In a Newsletter post, add a Post Inserter block
  2. Select "Display specific posts"
  3. Observe that the placeholder collapses to a solid line
  4. Click away from the block
  5. Observe difficulty in interacting with the block through the post editor UI

Now check out this branch

  1. Refresh the newsletter editor and repeat
  2. Confirm that the block now shows a placeholder with message in the post editor:
Screenshot 2026-05-29 at 4 44 54 PM

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?

@dkoo dkoo self-assigned this May 29, 2026
@dkoo dkoo requested a review from a team as a code owner May 29, 2026 22:49
Copilot AI review requested due to automatic review settings May 29, 2026 22:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the Posts Inserter block editor experience by showing a clear placeholder when the current post selection or filters produce zero posts, preventing the preview area from collapsing.

Changes:

  • Adds localized placeholder text and icon imports.
  • Renders a spinner, block preview, or “No posts found” placeholder based on readiness and block count.

@dkoo dkoo force-pushed the fix/posts-inserter-placeholder branch from 2e5117f to d88f049 Compare June 1, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants