add fuzzy trigram searching to add-on store (#19309)
Summary of the issue:
Add-on store list searching uses an exact search, i.e. it doesn't allow for typos or similar text to be found.
This also means that we cannot sort by search results relevance.
Instead a trigram search can be used to improve the search usability of the add-on store.
Description of user facing changes:
When searching add-ons, add-ons are filtered and ordered by search results relevance. The order can be updated after searching, and the previous order will restore if the search is cleared.
Description of developer facing changes:
None
Description of development approach:
Introduced a trigram-based fuzzy search algorithm for add-on filtering, providing more relevant search results even with partial or misspelled queries. Added a new searchRank field to AddonListField and made it the default sorting method when a search is active. [1] [2] [3]
Updated sorting logic throughout the GUI to use a new sortableFields property, which includes the new "Search relevance" option, and ensured that sorting and column selection are synchronized with the current search/filter state. [1] [2] [3] [4] [5]
When a search filter is applied or cleared, the code now updates both the ViewModel and UI selection to avoid inconsistencies and ensures the sort field reflects the current context (e.g., switches to "Search relevance" when searching).
Added logic to clear both ViewModel and UI selection when the search filter changes, preventing multiple rows from appearing selected and ensuring a single source of truth for selection.