cmdk
cmdk copied to clipboard
Sort groups in addition to items
The default search function is fuzzy (which makes sense #55) however the order could still be improved. In this example, maybe Figma is a good suggestion for ex
but the ones containing "Extension" should definitely rank first.
I believe this is expected functionality due to the fact they are separate sections and defined by two different Command.Group
components in code.https://github.com/pacocoursey/cmdk/blob/13f11c4f918cb4f7eb6254b4087a9cc83928b503/website/components/cmdk/raycast.tsx#L25-L77
I don't think ranking groups and changing their order based on the item's rank would be a good idea as I believe the intention for the group is to allow the user to define static ordering and separation.
I personally would prefer the ordering of groups I have defined in my codebase to always be in that order, upon multiple uses I believe this improves user experience as the groups are always in the same order and "place".
Groups should be sorted. Not sure why they're not… will take a look!
try fix in https://github.com/pacocoursey/cmdk/pull/271