Skip to content

Sort Dropdown's fuzzy search results by score and fix empty results on reopen#2051

Open
corcoran wants to merge 1 commit intoAvengeMedia:masterfrom
corcoran:fix/fuzzy-search-sorting-and-reopen
Open

Sort Dropdown's fuzzy search results by score and fix empty results on reopen#2051
corcoran wants to merge 1 commit intoAvengeMedia:masterfrom
corcoran:fix/fuzzy-search-sorting-and-reopen

Conversation

@corcoran
Copy link

fzf.js relied on stable Array.sort to preserve score ordering, which is not guaranteed in QML's JS engine. Results appeared in arbitrary order with low-relevance matches above exact matches. The sort comparator now explicitly sorts by score descending, with a length-based tiebreaker so shorter matches rank first when scores are tied.

Also fixed Object.assign mutating the shared defaultOpts object, which could cause options to leak between Finder instances.

DankDropdown's onOpened handler now reinitializes the search when previous search text exists, fixing the empty results shown on reopen.

Added resetSearch() for consumers to clear search state externally.

…ts on reopen

fzf.js relied on stable Array.sort to preserve score ordering, which is
not guaranteed in QML's JS engine. Results appeared in arbitrary order
with low-relevance matches above exact matches. The sort comparator now
explicitly sorts by score descending, with a length-based tiebreaker so
shorter matches rank first when scores are tied.

Also fixed Object.assign mutating the shared defaultOpts object, which
could cause options to leak between Finder instances.

DankDropdown's onOpened handler now reinitializes the search when previous
search text exists, fixing the empty results shown on reopen.

Added resetSearch() for consumers to clear search state externally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant