add fuzzy trigram searching to add-on store#19309
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds trigram-based fuzzy search functionality to the NVDA add-on store, improving search usability by allowing typos and partial matches. The search results are now filtered and ordered by relevance, with the ability to restore the previous sort order when the search is cleared.
Key changes:
- Implemented trigram-based similarity scoring for add-on search with a threshold of 0.3
- Added "Search relevance" as a sortable field that becomes the default when searching
- Automatically switches sort field to "Search relevance" when search is active and reverts to previous sort when cleared
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| source/gui/addonStoreGui/viewModels/addonList.py | Adds trigram search implementation, searchRank field, searchableText property, and logic to handle sort field transitions |
| source/gui/addonStoreGui/controls/storeDialog.py | Updates UI to clear selection on search, switch to search relevance sorting, and synchronize column filter display |
| source/gui/addonStoreGui/controls/addonList.py | Updates column click handling to use sortableFields instead of presentedFields |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Here are points of feedback after my first tests:
|
|
Hi @CyrilleB79 - I've updated this significantly, please let me know what you think. I couldn't re-test with |
SaschaCowley
left a comment
There was a problem hiding this comment.
Please add a change log entry
Not yet had time to re-test. However, you can still find other Chinese text for the name of subtitle reader add-on in languages where it has not yet been translated, e.g. if you start NVDA in German: |
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.
Link to issue number:
None
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:
searchRankfield toAddonListFieldand made it the default sorting method when a search is active. [1] [2] [3]sortableFieldsproperty, 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]Testing strategy:
Tested manually by filtering the add-on store
Known issues with pull request:
None
Code Review Checklist: