Skip to content

add fuzzy trigram searching to add-on store#19309

Merged
seanbudd merged 14 commits intomasterfrom
trigramAddonSearch
Feb 6, 2026
Merged

add fuzzy trigram searching to add-on store#19309
seanbudd merged 14 commits intomasterfrom
trigramAddonSearch

Conversation

@seanbudd
Copy link
Copy Markdown
Member

@seanbudd seanbudd commented Dec 1, 2025

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:

  • 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.

Testing strategy:

Tested manually by filtering the add-on store

Known issues with pull request:

None

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@seanbudd seanbudd requested a review from a team as a code owner December 1, 2025 07:47
@seanbudd seanbudd changed the title add trigram searching to add-on store add fuzzy trigram searching to add-on store Dec 1, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread source/gui/addonStoreGui/viewModels/addonList.py Outdated
Comment thread source/gui/addonStoreGui/viewModels/addonList.py Outdated
Comment thread source/gui/addonStoreGui/viewModels/addonList.py Outdated
Comment thread source/gui/addonStoreGui/controls/storeDialog.py
Comment thread source/gui/addonStoreGui/viewModels/addonList.py Outdated
@seanbudd seanbudd marked this pull request as draft December 1, 2025 07:57
@seanbudd seanbudd marked this pull request as ready for review December 2, 2025 06:30
@seanbudd seanbudd requested a review from Copilot December 2, 2025 06:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread source/gui/addonStoreGui/viewModels/addonList.py Outdated
Comment thread source/gui/addonStoreGui/controls/storeDialog.py Outdated
Comment thread source/gui/addonStoreGui/viewModels/addonList.py
Comment thread source/gui/addonStoreGui/viewModels/addonList.py Outdated
Comment thread source/gui/addonStoreGui/viewModels/addonList.py Outdated
seanbudd and others added 4 commits December 2, 2025 17:36
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment thread source/gui/addonStoreGui/viewModels/addonList.py Outdated
@CyrilleB79
Copy link
Copy Markdown
Contributor

Here are points of feedback after my first tests:

  • "福恩", the author of subtitle reader, cannot be found.
  • Assertion error when typing 3 spaces in the search field, or "AI " (e.g. when typing "AI image generator")
  • the add-on list is very slow to navigate with regular 1-second freeze
  • Maybe, if not already done, a more important weight should be given to the add-on's name, e.g. with respect to description, so that, for example, "Check Input Gestures" or "Enhanced Touch Gestures" appear on the top of the results.
  • Seems that you have implemented the algorithm manually. Why didn't you use a dedicated library for this?

@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Dec 4, 2025
@seanbudd seanbudd marked this pull request as draft December 5, 2025 03:13
@seanbudd seanbudd added the merge-early Merge Early in a developer cycle label Dec 8, 2025
@seanbudd seanbudd marked this pull request as ready for review February 4, 2026 06:29
@seanbudd
Copy link
Copy Markdown
Member Author

seanbudd commented Feb 4, 2026

Hi @CyrilleB79 - I've updated this significantly, please let me know what you think. I couldn't re-test with 福恩 as it seems data has changed but ㅓㅐㄴ데ㅗ니 was working as a string

Copy link
Copy Markdown
Member

@SaschaCowley SaschaCowley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a change log entry

Comment thread pyproject.toml
Comment thread source/gui/addonStoreGui/controls/storeDialog.py Outdated
Comment thread source/gui/addonStoreGui/viewModels/addonList.py Outdated
@SaschaCowley SaschaCowley marked this pull request as draft February 5, 2026 01:37
@seanbudd seanbudd requested a review from SaschaCowley February 5, 2026 02:36
@seanbudd seanbudd marked this pull request as ready for review February 5, 2026 02:36
@CyrilleB79
Copy link
Copy Markdown
Contributor

Hi @CyrilleB79 - I've updated this significantly, please let me know what you think. I couldn't re-test with 福恩 as it seems data has changed but ㅓㅐㄴ데ㅗ니 was working as a string

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:
nvda -n de

@seanbudd seanbudd merged commit 8dbe0fd into master Feb 6, 2026
41 of 43 checks passed
@seanbudd seanbudd deleted the trigramAddonSearch branch February 6, 2026 02:13
@github-actions github-actions Bot added this to the 2026.2 milestone Feb 6, 2026
@seanbudd seanbudd mentioned this pull request Feb 10, 2026
5 tasks
tareh7z pushed a commit to tareh7z/nvda that referenced this pull request Feb 16, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. merge-early Merge Early in a developer cycle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants