albertlauncher / albert

A fast and flexible keyboard launcher
https://albertlauncher.github.io
Other
7.27k stars 305 forks source link

Websearch trigger shouldn't require a whitespace #321

Closed anavarre closed 7 years ago

anavarre commented 7 years ago
Environment
Steps to reproduce

I tried to add a new Websearch trigger. To do so I performed the following steps:

Then I launched Albert and typed p search_api.

Expected behaviour

Typingp search_api should bring me to https://www.drupal.org/project/search_api - I shouldn't have to add an extra white space to the trigger. It should be added automatically or add a delimiter (e.g. a column) between the trigger character and the string.

Actual behaviour

Typingp search_api brought me to https://www.drupal.org/project/%20search_api which returns a 404.

ManuelSchneid3r commented 7 years ago

What if you want neither a space nor a delimiter? Did you ever try =2+2? I use it pretty often. You see the point? Your suggestion is actually a reduction in flexibility. However you are right the actual behaviour is incorrect. There should be no space. Are you sure that you did not type two spaces by accident?

ManuelSchneid3r commented 7 years ago

@anavarre Btw: You could add the delimiter to your prefix. E.g. 'p:'.

ManuelSchneid3r commented 7 years ago

I just tried it on my machine, everything is fine. If you use 'p ' (note the space) as trigger it should work. I can't change this behavior because otherwise websearches with triggers without whitespace, e.g. wolfram alpha (=), would not work.

anavarre commented 7 years ago

What if you want neither a space nor a delimiter? Did you ever try =2+2?

I'm talking about Websearch triggers specifically. I can't see any valid use case without a white space or delimiter. Can you think of any?

My point is that whatever the default behavior is, it shouldn't be on the end user to know what to do. For example, KDE's Krunner has a web shortcut applet that lets you choose either the white space or column as a delimiter. I can totally sort this out myself but I'm trying to think about improving the UX for all.

anavarre commented 7 years ago

Didn't see your last comment before I posted.

I can't change this behavior because otherwise websearches with triggers without whitespace, e.g. wolfram alpha (=), would not work.

If there's a technical blocker I understand.

ttys3 commented 3 years ago

@anavarre I think we should fix it in the websearch plugin, not here

https://github.com/albertlauncher/plugins/pull/45

githorse commented 3 years ago

Alfred, Chrome, Firefox, DuckDuckGo, etc. assumes a whitespace after the web search trigger. Actually I really like how, say, Firefox and Chrome work here, where I type the trigger (gi for google images), press space, and then a little tag ([Google Images]) shows up at the left of the search bar to show me what "search engine" I'm using.

Websearch is definitely violating the principle of least surprise here out of the box. Took me a minute to figure out why searching for "Software Manager" only showed "Stack Overflow" instead (with trigger so). I agree the flexibility of using a custom delimiter (:?) is nice. Maybe this could be a configurable option for websearch?

Agreed this sounds like it probably belongs in websearch issues, so I posted there.

githorse commented 2 years ago

Still really confused about how this is supposed to work. I find the behavior kind of baffling. I have the following triggers defined:

trigger search engine
g Google
gi Google images
d Dictionary.com
ds Dark Sky

None of my triggers include any explicit whitespace.

Here are my results:

search result
g cheese Google search " cheese"
gcheese Google search "cheese"
gi cheese Google images search " cheese"
gicheese Google images search "cheese"
d cheese (nothing happens)
dcheese Dictionary.com search "cheese"

I still find it bizarre after a year of using Alfred that the way I'm supposed to use it is to type gcheese, without the space; this is hard to read, counterintuitive, and inconsistent with the standard used by all competitors. I'm also completely baffled why d cheese doesn't work at all while g cheese (kinda) does ...

ManuelSchneid3r commented 2 years ago

I know its not that intuitive but forcing to make the space mandatory narrows down the featureset. Think of file path triggers.

ManuelSchneid3r commented 2 years ago

Rather think of my personal trigger '=' for wolfram alpha. A valid use case. It's a feature not a bug.