-
Notifications
You must be signed in to change notification settings - Fork 80
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
Emoji search returns no results for single letter queries #295 #298
base: master
Are you sure you want to change the base?
Emoji search returns no results for single letter queries #295 #298
Conversation
@@ -271,7 +271,7 @@ $: { | |||
if (!databaseLoaded) { | |||
currentEmojis = [] | |||
searchMode = false | |||
} else if (searchText.length >= MIN_SEARCH_TEXT_LENGTH) { |
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.
MIN_SEARCH_TEXT_LENGTH
is actually used in another place, so if we change from >=
to >
it would also need to be updated there:
.filter(_ => _.length >= MIN_SEARCH_TEXT_LENGTH) |
To me, though, "minimum" implies >=
rather than >
, so it would make the most sense for MIN_SEARCH_TEXT_LENGTH
to be 1.
@@ -1,2 +1,2 @@ | |||
export const MIN_SEARCH_TEXT_LENGTH = 2 |
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.
This has implications for the performance of the picker. For instance, when typing s
, it returns a lot of results and so it may be slow. When I test on my laptop with 6x CPU throttling in Chrome, it takes ~1.3s to return this query. Whereas with two letters (e.g. sm
), it takes 450ms.
Since people have to type one letter before they can type 2, it may make the UI appear sluggish.
So I prefer keeping the default at 2, but if people really want 1, they can change it themselves using something like patch-package.
Arguably we could make this a configuration option. That could be a footgun, since it affects both the database and the picker. But if people really want 1, maybe it's reasonable to make it configurable.
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.
See comments above. Thanks for the PR!
has been fixed