Skip to content

fix: command palette icons, console noise, and WP 7 progressive enhancements#776

Merged
superdav42 merged 1 commit intomainfrom
feature/command-palette-improvements
Apr 10, 2026
Merged

fix: command palette icons, console noise, and WP 7 progressive enhancements#776
superdav42 merged 1 commit intomainfrom
feature/command-palette-improvements

Conversation

@superdav42
Copy link
Copy Markdown
Collaborator

Summary

  • Fix wp.icons not available spam: wp.icons has never existed as a WordPress global. Icons now use wp.primitives (SVG/Path) — the same approach WP core uses in @wordpress/core-commands. Guarded so commands still register without icons when primitives is unavailable.
  • Remove all console.log/console.error statements (10 total) that were flooding the browser console on every page load.
  • Add WP 7 progressive enhancements that are safely ignored on WP 6.x:
    • Command category (view/action) — WP 7+ groups commands with labels in the palette UI
    • keywords on all commands — WP 7+ uses these for additional search matching (e.g. typing "billing" finds Payments)
    • wp.compose.useDebounce for search with setTimeout fallback

Details

Icons (the main bug)

The old code checked for wp.icons which doesn't exist in any WordPress version. The @wordpress/icons package is an npm build-time dependency — each consuming package bundles icons inline using wp.primitives.SVG and wp.primitives.Path. This is now what we do, matching the pattern in WP core's core-commands.js.

Progressive enhancement matrix

Feature WP 7+ WP 6.4–6.9
category Grouped with labels Silently ignored, defaults to action
keywords Additional search matching Silently ignored
wp.primitives icons SVG icons next to commands null — commands render without icons
wp.compose.useDebounce Proper debounce hook Falls back to manual setTimeout (250ms)

PHP changes

  • Replaced wp-components dependency with wp-compose (components was unused)
  • Removed unused i18n strings from wp_localize_script data
  • Updated version compatibility comments

Testing

  1. Open network admin, press Ctrl/Cmd+K
  2. Verify no console noise (no [Ultimate Multisite] messages, no wp.icons warnings)
  3. Verify icons appear next to commands
  4. Type "billing" or "coupons" — should match Payments / Discount Codes via keywords
  5. Type a customer/site name — should trigger REST API search with results

- Fix wp.icons not available: wp.icons has never existed as a WP global.
  Icons now use wp.primitives (SVG/Path), the same approach WP core uses
  in @wordpress/core-commands. Guarded for when primitives is unavailable.

- Remove all console.log/console.error statements (10 total).

- Add WP 7 progressive enhancements (safely ignored on WP 6.x):
  - Command categories (view/action) for grouped palette UI
  - Keywords on all commands for better search matching
  - wp.compose.useDebounce with setTimeout fallback

- Replace wp-components dep with wp-compose (components was unused).
- Remove unused i18n strings from localized script data.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

Warning

Rate limit exceeded

@superdav42 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 14 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 14 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2ea219fc-ff24-4928-a841-05f4ecb7b461

📥 Commits

Reviewing files that changed from the base of the PR and between b77c00d and c9fb1fc.

📒 Files selected for processing (2)
  • assets/js/command-palette.js
  • inc/ui/class-command-palette-manager.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/command-palette-improvements

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 d7b96a9 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 40 37.75 MB 840.50 ms (-22.50 ms / -3% ) 156.00 ms (-26.00 ms / -17% ) 1066.50 ms (+31.00 ms / +3% ) 1972.00 ms 1888.20 ms 93.40 ms (+2.45 ms / +3% )
1 56 49.02 MB 952.50 ms (+26.50 ms / +3% ) 150.00 ms (+5.50 ms / +4% ) 1100.00 ms (+22.50 ms / +2% ) 2074.00 ms (+44.00 ms / +2% ) 1993.45 ms (+44.60 ms / +2% ) 80.10 ms

@superdav42 superdav42 merged commit 4ad3bbd into main Apr 10, 2026
11 checks passed
@superdav42
Copy link
Copy Markdown
Collaborator Author

Summary

  • Fix wp.icons not available spam: wp.icons has never existed as a WordPress global. Icons now use wp.primitives (SVG/Path) — the same approach WP core uses in @wordpress/core-commands. Guarded so commands still register without icons when primitives is unavailable.
  • Remove all console.log/console.error statements (10 total) that were flooding the browser console on every page load.
  • Add WP 7 progressive enhancements that are safely ignored on WP 6.x:
    • Command category (view/action) — WP 7+ groups commands with labels in the palette UI
    • keywords on all commands — WP 7+ uses these for additional search matching (e.g. typing "billing" finds Payments)
    • wp.compose.useDebounce for search with setTimeout fallback

Details

Icons (the main bug)

The old code checked for wp.icons which doesn't exist in any WordPress version. The @wordpress/icons package is an npm build-time dependency — each consuming package bundles icons inline using wp.primitives.SVG and wp.primitives.Path. This is now what we do, matching the pattern in WP core's core-commands.js.

Progressive enhancement matrix

Feature WP 7+ WP 6.4–6.9
category Grouped with labels Silently ignored, defaults to action
keywords Additional search matching Silently ignored
wp.primitives icons SVG icons next to commands null — commands render without icons
wp.compose.useDebounce Proper debounce hook Falls back to manual setTimeout (250ms)

PHP changes

  • Replaced wp-components dependency with wp-compose (components was unused)
  • Removed unused i18n strings from wp_localize_script data
  • Updated version compatibility comments

Testing

  1. Open network admin, press Ctrl/Cmd+K
  2. Verify no console noise (no [Ultimate Multisite] messages, no wp.icons warnings)
  3. Verify icons appear next to commands
  4. Type "billing" or "coupons" — should match Payments / Discount Codes via keywords
  5. Type a customer/site name — should trigger REST API search with results

Merged via PR #776 to main.
Merged by deterministic merge pass (pulse-wrapper.sh).


aidevops.sh v3.6.235 spent 12m on this as a headless bash routine.

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