Open nickolay-kondratyev opened 2 years ago
I like this idea of being able to easily modify the sort order directly within the lookup experience (either via keybinding, button, keyword, or something else), and I think it'd make lookup much more powerful.
We were just discussing internally about potential ways of how Lookup can be if we were to design it from first-principles, and I was also thinking about dynamically controlled sort-order.
No guarantees on delivery date, but hopefully you won't need to hand edit your extension.js
for too long :)
Linking a related issue:
It suggests a UI toggle in the quickpick component to modify the sorting order.
instead of shortest meeting note.
Did you mean "shortest" as in the amount of text in the note? In either case, I think it would make a great ordering ordering option to sort results by their word count. I think Implement Text Statistics (aka 'word count') needs to be done first though.
@aleksey-rowan In this case no I meant actually shortest length of the note name. If two notes have the same fuseJS matching score but one of those notes has a shorter name it will show up higher in the sorting results.
As example lets say we search for meetin
And our notes are meeting.made-in-1990
and meeting.created-yesterday-in-2022
meeting.made-in-1990
will show up on top of the meeting.created-yesterday-in-2022
. Since it will have a closer levenshteinDistance to meetin
than meeting.created-yesterday-in-2022
Code: https://github.com/dendronhq/dendron/blob/master/packages/common-all/src/fuse.ts#L332
Please select if your request is either something new or an enhancement
Please select the area your request applies to. (Multiple selections are Possible. You can leave blank if you're not sure.)
Is your feature request related to a problem? Please describe
Current look up sorting favors levenshtein distance in favor of last update date. Which makes shorter results bubble up to the top even if those notes haven't been touched in a long time. For many use cases this is the right behavior but also often there are other lookups when we want a different sort order of lookup result to take precedence. For example when looking for recently edited file.
Example: Looking up
meeting
note we would want to have the most recently edited meeting note bubble up, instead of shortest meeting note.Describe the solution you'd like
Add optional argument to look up command to override default sort ordering.
Possible implementation:
Which can allow users to customize their lookup commands for different use cases:
Describe alternatives you've considered
edt mru
provided by VSCode, does not look up files that haven't been recently edited, while also not being as flexible as FuseJS. And also does NOT sort by update date.