Skip to content

Skip inserter-hidden Jetpack blocks in catch-all discovery - #3389

Merged
lezama merged 4 commits into
trunkfrom
jetpack-catchall-skip-hidden-blocks
May 8, 2026
Merged

Skip inserter-hidden Jetpack blocks in catch-all discovery#3389
lezama merged 4 commits into
trunkfrom
jetpack-catchall-skip-hidden-blocks

Conversation

@lezama

@lezama lezama commented May 8, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Claude (Opus 4.7) drafted the change and this description. I steered the wording — the comment "kept registered for back-compat" was too narrow, since supports.inserter: false is also used for parent-only blocks, programmatic-insert-only blocks, internal blocks, etc. The honest framing is just "the user can't insert these from the editor, so they aren't candidates."

Proposed Changes

The Jetpack catch-all rule's discovery one-liner enumerates every jetpack/* block in the registry. But registered ≠ available in the editor: Jetpack (and other plugins) keep some blocks registered with supports.inserter: false because they're parent-only, programmatic, or deprecated. Recommending those blocks would have the agent generate markup the user can't reproduce in the editor.

This PR adds an isset/!== false guard around $b->supports["inserter"] so hidden blocks drop out of the listing, and updates the surrounding sentence to explain why.

Testing Instructions

  • npm run typecheck — passes locally.
  • The existing eval covers this rule: eval/promptfoo.config.yamljetpack-catchall-slideshow. It asserts the agent uses any jetpack/* block on a slideshow request, which is unaffected by the filter (the slideshow block is inserter-visible).

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@lezama
lezama marked this pull request as ready for review May 8, 2026 11:41
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing b248647 vs trunk

app-size

Metric trunk b248647 Diff Change
App Size (Mac) 1408.66 MB 1408.66 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk b248647 Diff Change
load 1495 ms 1498 ms +3 ms ⚪ 0.0%

site-startup

Metric trunk b248647 Diff Change
siteCreation 8081 ms 8098 ms +17 ms ⚪ 0.0%
siteStartup 4936 ms 4931 ms 5 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@lezama
lezama merged commit 16995c4 into trunk May 8, 2026
10 checks passed
@lezama
lezama deleted the jetpack-catchall-skip-hidden-blocks branch May 8, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants