Fuzzy find in command palette
Replace flexsearch with match-sorter to allow fuzzy finding in command palette
Closes https://github.com/beekeeper-studio/beekeeper-studio/issues/3266
I don't code in Vue, so please double check my work here. I've tested this locally and it all seems to work.
I've used match-sorter instead of flexsearch since the latter does not support substring matching because it's architecture means it processes char-by-char.
@valtism Thanks so much for this! I'm going to mention this to the team just to make sure no one has any issues with switching, but I've given this a test with one of my load test dbs and it performed well!
The only issue I can see right now is that quicksearch doesn't highlight the matches properly for fuzzyfinding. Here's a fuzzy match:
Whereas this is how I'd want it to highlight:
Fully sequential matches still highlight:
If this isn't something you'd want to work on, no worries. Just want to make sure it's at least documented.
That's a good point. I'll look into implementing that now
@not-night-but I've switched out match-sorter to microfuzz because it supports match ranges and have used them to highlight characters in the search titles. Let me know if that looks good
@valtism How did you choose this library? I'm not totally sold on microfuzz, as it doesn't seem to be super popular and hasn't been updated in a while. What about something like uFuzzy?
@not-night-but Yeah, hadn't really used it so just picked it as something that supported highlights, but uFuzzy seems better. I've replaced it with that and also moved the highlighting to the search module so it returns the highlight formatted (and escaped) string directly. Hope that works