HTML Reporter: Faster and fuzzier module dropdown filter #1685
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Threshold
I love the super fast fuzzysort.js library. Previously we ommitted results with a score lower than
-10000
. fuzzysort does not return results that don't contain the input characters, so names that don't match the input at excluded no matter what. The previous threshold more or less correlated with allowing some letters to be skipped in the first word, and leaving off letters from the end of later words. For example,suort for promise
matchedsupport for promise
. Butsupport for pomise
already yielded zero results, despite only missing one letter! I've simply removed the threshold. More details in the commit message.Debounce
Previously there was a debounce of 200ms. The fuzzysearch algo takes ~1ms even when there are hundreds of test modules in the dataset. I considered removing the debounce entirely, but that would risk an ever-growing backlog of old events with both the input field and the results very far behind. Debounce demo on Codepen. More details in the commit message.