pop-os / launcher

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

Calculator: entering "1pass" displays math result above 1Password app result #60

Open titojankowski opened 2 years ago

titojankowski commented 2 years ago

OS: 21.04

Typing "system76" into the Launcher now suggests the #1 result is "= approx. 206.58942 ug^2 / kPa"

Kind of a fun easter egg but I figure since it's your brand name may be worth fixing.

edit (added a screenshot)

Screenshot from 2021-11-12 06-09-23

jacobgkau commented 2 years ago

A calculator result does show up in the results as soon as the 7 is entered: Screenshot from 2021-11-12 09-01-39

I wonder if it would be too disruptive to make the non-isolated Calculator search results only show up if the query starts with a number, or to have them sorted above .desktop files only if the query starts with a number. If someone needs to do an equation starting with a letter, they could always use the = prefix. The current regex to display a result is .*[0-9].*.

isantop commented 2 years ago

Getting a similar issue trying to open 1Password (password manager):

image

Also, highlights that making it for queries that start with a number wouldn't necessarily fix the issue. Perhaps a better solution would be to sort them at the bottom of the results unless they include the = prefix

ppvolto commented 2 years ago

I think this is easy fixable with a prefix so that the first char after trimming is used like with the find command. The result is you "request" calculation with example =1+1.

jacobgkau commented 2 years ago

I think this is easy fixable with a prefix so that the first char after trimming is used like with the find command. The result is you "request" calculation with example =1+1.

The prefix is already implemented. The non-prefix result was a feature added later, intentionally, in response to a user request.

Sorting non-prefixed calculations last would fix the issue.

titojankowski commented 2 years ago

Confirming this is still an issue in 21.10.

JonathanTroyer commented 2 years ago

95 should not have closed this, as we still have the pathologic case of 1password requiring six strokes to be the top priority. Ostensibly you can get around this using the ctrl key, but I suspect most users find this less than optimal. I also agree that sorting non-prefixed calculations last would fix this in a more intuitive way.

jacobgkau commented 2 years ago

@JonathanTroyer This issue was titled regarding the search query system76, which was fixed by #95. However, I can see an argument for re-opening this rather than opening a new issue for 1password, since it was brought up here before the fix and is a similar root issue of the calculator plugin getting precedence over an app when trying to search for an app. Renamed & re-opening for the 1Password issue.