pop-os / launcher

Modular IPC-based desktop launcher service
Mozilla Public License 2.0
228 stars 45 forks source link

[COSMIC Epoch; regression] Search results don't show apps when too many windows are open #228

Closed jacobgkau closed 1 month ago

jacobgkau commented 1 month ago

This seems to be caused by 172532056b404923b0bc068b524b23e81a371f18. It does not happen on ab7a71a057e3e2ce5fc200b056799a07cf3a9bb5. (FYI, @wiiznokes in case you have an idea of why this might be happening.)

Previously, search results would return application names even if a lot of windows are open:

screenshot-2024-07-17-14-20-20

On the latest commit, searching for the same string, I'm getting a bunch of irrelevant (but presumably closest-matching) window results, and no application results:

screenshot-2024-07-17-14-21-46

This essentially breaks launching apps with the launcher once more than 8 windows are open.

The good news is, this is not happening in the GNOME session (which is why I didn't catch it during regression testing).

mmstick commented 1 month ago

It's a difference in behavior between the cosmic and pop-shell launcher plugins.

wiiznokes commented 1 month ago

This is because the new commit match more field of the desktop entries. In this case, it will match the "internet" categorie of firefox.

Somehow, strsim::jaro_winkler("terminal", "internet"); return a score of 0.66, which is a lot. The plugin accept match > 0.6.

I'm not sure the best way of fixing this. This is kinda related to https://github.com/pop-os/cosmic-launcher/issues/145. Maybe is would make sense to use different matching algorithm for different field. Like using a substring algo for Categories.

wash2 commented 1 month ago

Maybe is would make sense to use different matching algorithm for different field. Like using a substring algo for Categories.

Ya, I think that could work. Alternatively, requiring a higher score like 0.8 for matching the desktop entry, and a lower score like 0.6 for matching title and app id in the toplevel plugin seems to work pretty well too.

wiiznokes commented 1 month ago

Maybe is would make sense to use different matching algorithm for different field. Like using a substring algo for Categories.

Ya, I think that could work. Alternatively, requiring a higher score like 0.8 for matching the desktop entry, and a lower score like 0.6 for matching title and app id in the toplevel plugin seems to work pretty well too.

https://github.com/pop-os/freedesktop-desktop-entry/pull/22 does smtg like this