Add a setting to filter apt/Flatpak results for the same application, with a fix for search sorting #398
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The setting allows the user to choose a preferred package type, or keep the current behavior of no filtering (the default). When enabled, search results for applications that are provided as both apt and Flatpak packages will be filtered to only show the preferred package type. As before, the type can still be changed on the package details page before installation. Applications that only have a single package will still be shown regardless of type.
I also fixed an issue I noticed with the sorting of search results. Previously, if a Flatpak package's display name and summary/description matched the search terms, but the ID did not, then it would have been ranked as if there was a match in the summary/description but not in the name. (E.g. search for "document viewer", and notice the ranking of org.gnome.Evince, despite its display name literally being "Document Viewer".)
I bundled these two commits into the same PR, because they touch some of the same code.