I can add some details to this bug report, as it is a daily pain point for me in both the Move & Jump to autocompletes.
I have a simple reproduction of the basic problem of result order being pretty random and also changing even as you type characters that donāt change which results are valid:
Above, you see that the order of results doesnāt match the document structure. And then after typing the next character:
The results themselves havenāt changed, but their order DID change. The order here looks like the desired order.
I talked with Shida on the Dynalist discord and he said the current expected behavior is:
Every matched item is given a score based on how many pieces your query breaks into (lower is better), how far apart are the match hits (closer is better), where the first match hits (earlier is better), and how long the matching item is (shorter is better).
Those 4 scores are combined into a single score which is used for sorting the results.
I think if their score is identical then they get to keep the order they were in the document originally, since javascript uses stable sort
So this is definitely a bug.
I can also clarify what the secondary bug is that causes completed items to show up in the autocomplete results: it happens when the item itself is NOT completed, but it is a child of completed items. For example:
While understandable, I believe that is still a bug, and children of completed items should NOT be included in these autocomplete results.
Iāll make a separate feature request for making a better sort order. I agree with BigChungus that an item being at hierarchy level 1 should appear before an item at deeper levels even if the deeper item occurs earlier in the document.