Improve search result counts (#2221)

* remove limit from emoji autocomplete

* remove search limit from user mention

* remove limit from room mention autocomplete

* increase user search limit to 1000

* better search string selection for emoticons
This commit is contained in:
Ajay Bura 2025-02-21 19:14:38 +11:00 committed by GitHub
parent 3ada21a1df
commit 1b200eb676
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 53 additions and 40 deletions

19
src/app/plugins/utils.ts Normal file
View file

@ -0,0 +1,19 @@
import { SearchItemStrGetter } from '../hooks/useAsyncSearch';
import { PackImageReader } from './custom-emoji';
import { IEmoji } from './emoji';
export const getEmoticonSearchStr: SearchItemStrGetter<PackImageReader | IEmoji> = (item) => {
const shortcode = `:${item.shortcode}:`;
if (item instanceof PackImageReader) {
if (item.body) {
return [shortcode, item.body];
}
return shortcode;
}
const names = [shortcode, item.label];
if (Array.isArray(item.shortcodes)) {
return names.concat(item.shortcodes);
}
return names;
};