Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Add a limit option for autocomplete results #6016

Merged
merged 5 commits into from
May 12, 2021

Conversation

germain-gg
Copy link
Contributor

Fixes element-hq/element-web#17182

As @t3chguy mentioned, #5822 significantly increased the number of results returned by the Autocompleter. There was no results pagination or limit meaning that every single match would be rendered in the list.

Which took about 6 seconds when searching for @m in a room with 10k users on my laptop

I have introduced a limit parameter to the getCompletions call which will cap the number of results per provider to 20

src/autocomplete/Autocompleter.ts Outdated Show resolved Hide resolved
src/autocomplete/Autocompleter.ts Outdated Show resolved Hide resolved
@germain-gg germain-gg requested a review from t3chguy May 12, 2021 09:57
Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise

src/autocomplete/AutocompleteProvider.tsx Outdated Show resolved Hide resolved
src/autocomplete/CommandProvider.tsx Show resolved Hide resolved
@germain-gg germain-gg force-pushed the gsouquet/limit-autocomplete-results branch from b45ac88 to 7d8aa0f Compare May 12, 2021 10:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tab completing @mentions with many candidates is slow and CPU hungry
2 participants