Autocompleters: Move and improve links search#76995
Conversation
Mamaduka
left a comment
There was a problem hiding this comment.
I couldn't find a reason why this is part of the block-editor package, but I think moving it to editor would be better. Similar to users, post entities are WP-specific.
@youknowriad, what do you think?
| triggerPrefix: '[[', | ||
| options: async ( letters ) => { | ||
| let options = await apiFetch( { | ||
| isDebounced: true, |
There was a problem hiding this comment.
Somewhat unofficial API. Has been supported for years via getDefaultUseItems (#29772), but it only works for the options callback, ignored with useItems.
Not sure if we want to stabilize it and make it more official.
There was a problem hiding this comment.
I guess we could update the docs to mention that.
| search: letters, | ||
| search: filterValue, | ||
| type: 'post', | ||
| order_by: 'menu_order', |
There was a problem hiding this comment.
The search endpoint doesn't support the order_by argument. See: https://developer.wordpress.org/rest-api/reference/search-results/.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: -50 B (0%) Total Size: 7.73 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in e8042c2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23890443304
|
|
Indeed, this component seems misplaced given is uses apiFetch directly. |
|
Thanks for the confirmation, @youknowriad! Pushed changes to relocate the auto-completer. |
What?
PR makes the following changes to links completer:
editorpackage. It shouldn't live inblock-editor, which is meant to be WordPress-agnostic.Testing Instructions
[[.Testing Instructions for Keyboard
Same.
Screenshots or screencast
CleanShot.2026-04-02.at.10.47.15.mp4
Use of AI Tools
None.