linuxmint / mintinstall

Software Manager
137 stars 98 forks source link

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

Closed ulrikdem closed 7 months ago

ulrikdem commented 10 months ago

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.

clefebvre commented 10 months ago

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

mtwebster commented 7 months ago

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 commented 7 months ago

Thanks for your suggestion - that does seem like an overall improvement. I've implemented it in 04c9393b3f2a6b9d21478f7b49c4da62532a2fea, 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 commented 7 months ago

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

The menu changes look nice.

Thanks