pop-os / shell

Pop!_OS Shell
GNU General Public License v3.0
4.87k stars 266 forks source link

Improve program name launcher sort order #1087

Closed nathansgithub closed 3 years ago

nathansgithub commented 3 years ago

This is a minor thing, but it would improve usability.

(1) Issue/Bug Description: Launcher program search should prioritize matching first part of word.

(2) Steps to reproduce (if you know): Install Steam and install the Microsoft Teams flatpak from Pop Shop. Bring up the launcher and type 'team'. Steam shows up before Microsoft Teams. image

(3) Expected behavior: Both of these should show up, but Microsoft Teams should show up first in the search. It is more likely that users will search for an app by typing one of the words in the name than typing out the middle part of one of the words.

(4) Distribution (run cat /etc/os-release): NAME="Pop!_OS" VERSION="21.04" ID=pop ID_LIKE="ubuntu debian" PRETTY_NAME="Pop!_OS 21.04" VERSION_ID="21.04" HOME_URL="https://pop.system76.com" SUPPORT_URL="https://support.system76.com" BUG_REPORT_URL="https://github.com/pop-os/pop/issues" PRIVACY_POLICY_URL="https://system76.com/privacy" VERSION_CODENAME=hirsute UBUNTU_CODENAME=hirsute LOGO=distributor-logo-pop-os

(5) Gnome Shell version: 3.38.5

(6) Pop Shell version (run apt policy pop-shell or provide the latest commit if building locally):

  Installed: 1.1.0~1626203716~21.04~021c931
  Candidate: 1.1.0~1626357201~21.04~c1f2ea4
  Version table:
     1.1.0~1626357201~21.04~c1f2ea4 1001
       1001 http://ppa.launchpad.net/system76/pop/ubuntu hirsute/main amd64 Packages
       1001 http://ppa.launchpad.net/system76/pop/ubuntu hirsute/main i386 Packages
 *** 1.1.0~1626203716~21.04~021c931 100
        100 /var/lib/dpkg/status
nathansgithub commented 3 years ago

I checked and the default Gnome app search doesn't bring up programs if you type a sequence in the middle of a word: Searching 'team' only brings up Microsoft Teams and not Steam.

If that is less complicated than showing both and changing the sort order, I think that's a better behavior. If I'm trying to open Steam, I won't try searching for 'team'.

jacobgkau commented 3 years ago

Thank you for pointing out this scenario. I think search algorithm improvements are currently waiting on some work to move searching from the extension's JavaScript process into a separate Rust component, as the last few search improvements caused noticeable speed reductions in JavaScript. Once that's been done, prioritizing matches that follow a space over matches that follow any other character shouldn't be too difficult.

jacobgkau commented 3 years ago

This is going to be fixed by https://github.com/pop-os/shell/pull/1139, since https://github.com/pop-os/launcher/commit/b5514a6e24f8d35a993b7e109bab393e7812f241 changed the sort algorithm from Levenshtein distance to Jaro-Winkler distance, with Jaro-Winkler including a prefix weight for up to four characters. With Microsoft Teams and Steam both installed, searching team, tea, or teams now displays Microsoft Teams as the first result instead of Steam.