You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, kmenu only supports exact searches through and keyword detection. However, when users type something like "bercel" instead of "vercel" (which is like so common that the people over at vercel bought the domain), so an existing, lightweight algorithm for fuzzy search using JavaScript would be awesome. Also, a way to control the strictness of the match, like most fuzzy search algoithms give on a 0-1 float number basis, would be an awesome addition.
Also, since kmenu can be used in commercial software as well, where performance is critical and users would love to use their own in-house algorithms for text search, a custom search logic (preferably through hooks) would be cool to have.
Describe the solution you'd like
For the built-in fuzzy search, a config option, like fuzziness: int, that has possible values from 0-1 and 0 by default, which means only exact searches would be matched.
For the out-sourced matching logic, since users could already get the text from the input box in the kmenu, but only an option to conditionally render blocks is missing, a clever and out-of-the-box solution would be to have a variable like filterAutomatically: boolean or something similar, and when that's disabled, any text in the search bar wouldn't affect the command menu at all (basically like disconnecting the input-box from the command menu), and users could conditionally render the commands, like
// Get the input from the kmenu textboxconst{ input }=useKmenu();constconfig={filterAutomatically: false};constallCommands=[{name: "help",description: "Displays this message.",},];constmain=[{category: "main",// Conditionally render the commandscommands: allCommands.filter(command.keywords.include(input)||commands.name.include(input)),},];
Describe alternatives you've considered
The same as above, but haven't been able to turn off the searchAutomatically parameter yet.
Thanks!
The text was updated successfully, but these errors were encountered:
Currently working on a preventSearch parameter for this to prevent searches by default for using things like modals. I'll let you know about the search fuzziness algorithms when I get to them 😄.
Is your feature request related to a problem? Please describe.
Currently, kmenu only supports exact searches through and keyword detection. However, when users type something like "bercel" instead of "vercel" (which is like so common that the people over at vercel bought the domain), so an existing, lightweight algorithm for fuzzy search using JavaScript would be awesome. Also, a way to control the strictness of the match, like most fuzzy search algoithms give on a 0-1 float number basis, would be an awesome addition.
Also, since kmenu can be used in commercial software as well, where performance is critical and users would love to use their own in-house algorithms for text search, a custom search logic (preferably through hooks) would be cool to have.
Describe the solution you'd like
For the built-in fuzzy search, a config option, like
fuzziness: int
, that has possible values from 0-1 and 0 by default, which means only exact searches would be matched.For the out-sourced matching logic, since users could already get the text from the input box in the kmenu, but only an option to conditionally render blocks is missing, a clever and out-of-the-box solution would be to have a variable like
filterAutomatically: boolean
or something similar, and when that's disabled, any text in the search bar wouldn't affect the command menu at all (basically like disconnecting the input-box from the command menu), and users could conditionally render the commands, likeDescribe alternatives you've considered
The same as above, but haven't been able to turn off the
searchAutomatically
parameter yet.Thanks!
The text was updated successfully, but these errors were encountered: