Skip to content

fix(command-palette): add missing wp-data dep and fix wp-icons handle#722

Merged
superdav42 merged 1 commit intomainfrom
bugfix/fix-command-palette-deps
Mar 31, 2026
Merged

fix(command-palette): add missing wp-data dep and fix wp-icons handle#722
superdav42 merged 1 commit intomainfrom
bugfix/fix-command-palette-deps

Conversation

@superdav42
Copy link
Copy Markdown
Collaborator

@superdav42 superdav42 commented Mar 31, 2026

Summary

  • Add wp-data to the wu-command-palette script dependency array — the JS uses wp.data.dispatch() to register commands/loaders but wp-data was not declared, causing silent failures when wp-data loaded after the script
  • Replace wp-icons with wp-primitiveswp-icons is not a registered WordPress script handle; the correct handle for @wordpress/icons is wp-primitives

What changed

inc/ui/class-command-palette-manager.php:140 — dependency array in wp_enqueue_script():

- ['wp-commands', 'wp-element', 'wp-i18n', 'wp-api-fetch', 'wp-components', 'wp-icons']
+ ['wp-commands', 'wp-data', 'wp-element', 'wp-i18n', 'wp-api-fetch', 'wp-components', 'wp-primitives']

Testing

  1. Navigate to any network admin page on WP 6.4+
  2. Open the command palette (Ctrl/Cmd+K)
  3. Verify Ultimate Multisite commands appear (Dashboard, Settings, entity search)
  4. Search for an entity — results should load without console errors

aidevops.sh v3.5.528 plugin for OpenCode v1.3.4 with claude-opus-4-6 spent 42m and 8,879 tokens on this with the user in an interactive session.

Summary by CodeRabbit

  • Chores
    • Updated internal script dependencies for improved code organization and compatibility.

The wu-command-palette script uses wp.data.dispatch() to register commands
but wp-data was not declared as a dependency, causing silent failures when
wp-data loaded after the script.

Also replace invalid 'wp-icons' handle with 'wp-primitives' — the correct
registered script handle for @wordpress/icons in WordPress core.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 07001fc1-79a7-4a29-bf9a-1cf6ec7d7453

📥 Commits

Reviewing files that changed from the base of the PR and between b6006e7 and d80b088.

📒 Files selected for processing (1)
  • inc/ui/class-command-palette-manager.php

📝 Walkthrough

Walkthrough

Updated the WordPress script dependencies for the command palette in Command_Palette_Manager. Replaced wp-icons with wp-data and wp-primitives in the enqueue script call. No logic or control flow changes were made.

Changes

Cohort / File(s) Summary
Script Dependencies
inc/ui/class-command-palette-manager.php
Updated wp_enqueue_script() dependencies array for wu-command-palette: removed wp-icons, added wp-data and wp-primitives.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A hop, a skip, dependencies aligned,
Old icons fade, new data we find,
Primitives now paint the palette's way,
Scripts renewed for a brighter day!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main changes: adding the missing wp-data dependency and fixing the wp-icons handle to wp-primitives.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/fix-command-palette-deps

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 and usage tips.

@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

@github-actions
Copy link
Copy Markdown

Performance Test Results

Performance test results for e0efbba are in 🛎️!

Note: the numbers in parentheses show the difference to the previous (baseline) test run. Differences below 2% or 0.5 in absolute values are not shown.

URL: /

Run DB Queries Memory Before Template Template WP Total LCP TTFB LCP - TTFB
0 41 (-12 / -29% ) 37.83 MB (-5.68 MB / -15% ) 926.00 ms (-50.50 ms / -5% ) 159.50 ms (+7.00 ms / +4% ) 1152.00 ms 2124.00 ms (-48.00 ms / -2% ) 2028.30 ms (-57.50 ms / -3% ) 93.30 ms (+4.95 ms / +5% )
1 56 49.01 MB 992.50 ms (+21.50 ms / +2% ) 150.00 ms 1142.50 ms 2194.00 ms 2114.90 ms (+46.45 ms / +2% ) 80.80 ms

@superdav42
Copy link
Copy Markdown
Collaborator Author

DISPATCH_CLAIM nonce=ee7c8795a554a01aff7ae9f33e065a27 runner=superdav42 ts=2026-03-31T16:34:02Z max_age_s=120

@superdav42 superdav42 self-assigned this Mar 31, 2026
@superdav42 superdav42 merged commit 3563c9d into main Mar 31, 2026
11 checks passed
@superdav42
Copy link
Copy Markdown
Collaborator Author

Merged to main. All 10 CI checks passed (PHP 8.2–8.5, Cypress, Code Quality, PHP Lint, Build, WP Performance Metrics).


aidevops.sh v3.5.528 plugin for OpenCode v1.3.0 with claude-sonnet-4-6 spent 23m and 11,414 tokens on this as a headless worker. Overall, 11m since this issue was created.

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.

1 participant