markusfisch / PieLauncher

Android home screen launcher that uses a dynamic pie menu instead of tables of icons.
https://play.google.com/store/apps/details?id=de.markusfisch.android.pielauncher
MIT License
290 stars 39 forks source link

Improve Search-functionality #23

Open Glitchy-Tozier opened 2 years ago

Glitchy-Tozier commented 2 years ago

Not sure what's the issue here but this is what is happening: There is an app called "F-Droid". I'm trying to search for it.

If I type "fd", i can find it. (Great) If I type "fdr", it's not found. (Weird)

This seems like a bug to me, and I suggest doing something about it.

Screenshots:

Screenshot_20210808-080959_Pie Launcher.jpg

Screenshot_20210808-081008_Pie Launcher.jpg

markusfisch commented 2 years ago

Good catch! But it's not really a bug, and I'm not too sure how to fix it 🤔

The reason why "F-Droid" isn't there with "fdr" is the "-" in "F-Droid". See, the app tries to match the input against the app names by calculating the Hamming distance between the two strings (the app name gets cut to the length of the input). This is done to allow one - but just one - mistyping.

So "fd" is matching "F-" because there's just one difference. "fdr" doesn't match "F-D" becaue there are two differences - and I allow just one.

Allowing more than one difference would give you irrelevant matches. Allowing no difference would require you to always type correctly.

Now, we may drop the minus "-" from app names when matching and make "fdr" match. But another user may type "F-D" what wouldnt match "FDr" 😬 So I'm not really sure what to do here 😉

Glitchy-Tozier commented 2 years ago

A last option (the one i expected) is this:

Check whether those characters exist in the correct order. If yes, show app.

It's the way KISS launcher works. Screenshot:

Screenshot_20210809-063154_KISS launcher.jpg

I understand that this might give a lot of false positives (see the second app), but do you think it could be viable? The results could be sorted according to their hamming-distance 🤔

markusfisch commented 2 years ago

Well, yes, this can be done for sure. I will give it a try.

Glitchy-Tozier commented 2 years ago

Let me know how it turns out! :)