-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FlatTermSelector: Update the term suggestion limit #62359
Conversation
Size Change: +1 B (0%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @fcenteno, @keenode. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
@fcenteno, I also tried to adjust ordering here, but the current options seem to be the most optimal. My tests were based on your example where multiple tags contain the word "music". The full word match (Music) was always first in my results. Testing data
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I tested the steps described in this comment. As you said, it seems that exact matches are given priority.
Thank you, @t-hamano! |
705fe10
to
18de8fc
Compare
Flaky tests detected in 18de8fc. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9402785596
|
@Mamaduka Here is my example: The tag "Managua" exists, but it is impossible to select it because the word Managua does not appear first, but instead shows tags with more than 1 word in alphabetical order: In the case of having more than 100 tags in the list, and if there are more than 100 cases where that word is part of a tag with more than 1 word, I will never be able to add it, because when pressing enter we get a 400 error. I really appreciate your help finding a solution. |
Thanks for another example, @fcenteno! It's odd that I'm getting a different result. Maybe it's related to locale (language) because in my tests, the whole match (Music) always comes, and then I get partial matches (A Music). The PR description has details on why we're limited to 100 results for the moment. I want to highlight this again: The 400 error is okay; the editor knows how to handle this specific error and correctly assign a term to a post. |
Unlinked contributors: fcenteno, keenode. Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
What?
Closes #60791.
PR updates the number of suggestions rendered for the
FlatTermSelector
component when searching terms.Why?
How the max suggestions limit was chosen:
per_page
range set by the REST API.FormTokenField
needs a fixed limit for display.FormTokenField
.Testing Instructions
wp term generate post_tag --count=1000
Testing Instructions for Keyboard
Same.