Skip to content

fix: ship regenerated block editor bundle and title-only page search (follow-up to #2014) - #2036

Merged
superdav42 merged 2 commits into
mainfrom
fix/page-search-followups
Oct 27, 2026
Merged

superdav42 merged 2 commits into
mainfrom
fix/page-search-followups

Conversation

@superdav42

@superdav42 superdav42 commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #2014. Ref #1720

Summary

  • Production regression fix: wu_get_asset() serves *.min.js whenever SCRIPT_DEBUG is off, but inc/builders/block-editor/assets/js/blocks.min.js had not been regenerated since the initial commit. With perf: defer editor settings and search page choices on demand #2014 merged, production editors loaded the stale bundle, which knows nothing about page_search, so the three element page selectors offered only the default "Current Page"/"Default" choice and saved page IDs had no matching option.
  • scripts/uglify.js now also minifies module assets under inc/**/assets/js, so the release build cannot ship a stale editor bundle again.
  • The PR build's minified-asset freshness check now also covers inc/*/assets/js/*.min.js.
  • Regenerated blocks.min.js and assets/js/selectizer.min.js (the latter was also stale after perf: defer editor settings and search page choices on demand #2014 and would have failed the freshness check on the next PR).
  • Page search now matches titles only (search_columns) in both the Selectize endpoint (inc/class-ajax.php, WP 6.2+) and the block editor REST query (blocks.js, WP 6.5+). Both UIs filter results by title on the client, so content-only matches used up the 10/20-result cap and were then hidden. Older WordPress versions ignore the argument.
  • Documented the intentional value normalization inside get_page_search_field()'s options resolver (views/admin-pages/fields/field-select.php compares option keys strictly).

Not changed

The #2014 review flagged possible duplicate render_selectize_templates footer output when several elements render customize controls. WordPress deduplicates identical callbacks at the same priority in add_action(), so the templates print once; no change needed.

Verification

  • pnpm run uglify → only selectizer.min.js and blocks.min.js changed; both contain the new code and pass node --check.
  • git ls-files -- 'inc/*/assets/js/*.min.js' matches blocks.min.js (freshness pathspec).
  • vendor/bin/phpunit --filter 'Ajax_Test|Base_Element_Test|Block_Editor_Widget_Manager_Test' → OK (74 tests, 208 assertions).
  • Scoped PHPCS, PHPStan and ESLint (blocks.js) pass. The ESLint findings in scripts/uglify.js already existed; that file is outside the lint scope.

aidevops.sh v3.39.49 plugin for OpenCode

Summary by CodeRabbit

  • Bug Fixes
    • Page searches now match page titles rather than page content, helping relevant title matches appear within the results limit.
    • Selecting a page now handles its page ID consistently.
  • Chores
    • JavaScript minification and build checks now cover assets in additional module directories.
  • Documentation
    • Updated source references in the generated hook reference.

@superdav42 superdav42 added the origin:interactive Created by interactive user session label Oct 27, 2026
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 26e58ad1-0337-40a1-a014-73196bf2a457
Commits

Reviewing files that changed from the base of the PR and between 3f8695c and 7ffa09a.

Files ignored due to path filters: 2
  • assets/js/selectizer.min.js is excluded by !**/*.min.js
  • inc/builders/block-editor/assets/js/blocks.min.js is excluded by !**/*.min.js
Files selected for processing: 6
  • .github/workflows/pr-build-test.yml
  • inc/builders/block-editor/assets/js/blocks.js
  • inc/class-ajax.php
  • inc/documentation/berlindb-dynamic-hooks.php
  • inc/ui/class-base-element.php
  • scripts/uglify.js

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

Page searches now target page titles. The minification script and CI check include module JavaScript assets. The generated hook reference source locations and a page ID normalization comment were also updated.

Changes: Page Search and Asset Pipeline

Layer / File(s) Summary
Title-only page search
inc/builders/block-editor/assets/js/blocks.js, inc/class-ajax.php
The block editor and AJAX page queries now set search_columns to post_title.
Module JavaScript minification and validation
scripts/uglify.js, .github/workflows/pr-build-test.yml
The minification script selects JavaScript under inc/**/assets/js. The CI check now includes minified JavaScript under inc/*/assets/js.

Documentation and Comment Updates

Layer / File(s) Summary
Hook references and page ID comment
inc/documentation/berlindb-dynamic-hooks.php, inc/ui/class-base-element.php
Hook source line references were updated across the documented sections. A comment now describes normalization to integer page IDs.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related PRs

Suggested labels: bug

Merge Risk: Minimal · up to 7ffa0

The PR is mergeable; the reviewed documentation concern was refuted.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names two changes the PR makes: shipping a regenerated block editor bundle (blocks.min.js and selectizer.min.js) and limiting page search to titles. Both appear in the raw summary and object…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names two changes the PR makes: shipping a regenerated block editor bundle (blocks.min.js and selectizer.min.js) and limiting page search to titles. Both appear in the raw summary and objectives, and the title is specific enough for a teammate to see the main change. It does not describe the minification script or the documentation regeneration in detail, which is acceptable.

Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 5 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@superdav42
superdav42 marked this pull request as ready for review October 27, 2026 18:48
@superdav42
superdav42 merged commit 5de713e into main Oct 27, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

origin:interactive Created by interactive user session

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant