Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a setting to filter apt/Flatpak results for the same application, with a fix for search sorting #398

Merged
merged 3 commits into from
Mar 4, 2024

Conversation

ulrikdem
Copy link
Contributor

@ulrikdem ulrikdem commented Nov 26, 2023

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.

When enabled, search results for applications that are provided as both
apt and flatpak packages will be filtered to only show the user's
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.
Previously, if a Flatpak package's display name and summary or
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 or description
but not in the name.
@clefebvre
Copy link
Member

Pretty cool idea. That said, I need to postpone this, we're too close to release for it to get in.

@clefebvre clefebvre changed the title Add a setting to filter apt/Flatpak results for the same application, with a fix for search sorting [Next] Add a setting to filter apt/Flatpak results for the same application, with a fix for search sorting Nov 27, 2023
@mtwebster mtwebster changed the title [Next] Add a setting to filter apt/Flatpak results for the same application, with a fix for search sorting Add a setting to filter apt/Flatpak results for the same application, with a fix for search sorting Feb 19, 2024
@mtwebster
Copy link
Member

Hi, this looks fine, I'm just wondering about the menu layout. This would give us two search options in the base menu, then a sub-menu with these options. Maybe we could combine all of the search related items into their own submenu? Also the effects of this option can be a bit subtle, so maybe we could be a bit more detailed with their labels as well:

Show Installed
--------------------
Search preferences ->
   | ■  Search in packages summary..
   | □  Search in packages descriptions..
   | ------------------
   | ●  Include all package types in results.
   | ○  Include only the Flatpak version of an app, if one exists.
   | ○  Include only system apps when possible.
---------------------
Refresh the list of packages
---------------------
About

I'm not really sure about those new labels, I reworded them a few times, but still not completely satisfied..

There's another PR here to add another menu entry to open Software Sources, so it's getting a little crowded. This would also make it so only 'actions' are shown in the base menu, with search options organized separately.

Thoughts? @clem?

@ulrikdem
Copy link
Contributor Author

Thanks for your suggestion - that does seem like an overall improvement. I've implemented it in 04c9393, but with the last option changed to "Include only the system package, if one exists", to hopefully make it clearer that it is the same as the Flatpak option, but for the other package type.

It is hard to come up with good single-line descriptions for these options. Alternatively, we could flip it to "Hide the system package for apps with a Flatpak available" and vice versa, but I'm not sure whether that is an improvement.

@mtwebster
Copy link
Member

We'll go with this for now, though we might revisit the strings later.

The menu changes look nice.

Thanks

@mtwebster mtwebster closed this Mar 4, 2024
@mtwebster mtwebster reopened this Mar 4, 2024
@mtwebster mtwebster merged commit ad39ac7 into linuxmint:master Mar 4, 2024
5 checks passed
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.

3 participants