Opened 10 months ago

Last modified 5 weeks ago

#14809 new enhancement

Implement 1-letter search shortcuts (easy)

Reported by: pulkomandy Owned by: pulkomandy
Priority: normal Milestone: Unscheduled
Component: Applications/WebPositive Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

WebPositive should allow easy searching on some common websites. The search preferences should be reworked to allow listing multiple search engines (of which one would be the default for the current use of typing something that's not an URL). For example, typing "w foo" in the address bar should search "foo" on wikipedia. "g foo" on Google. "q foo" on Qwant, etc.

Attachments (1)

web+_one_input.png (21.8 KB ) - added by humdinger 5 weeks ago.
mockup: tabbed pop-up

Download all attachments as: .zip

Change History (10)

comment:1 by yatendra1999, 9 months ago

If i wanted to search "q bit" on the default engine, redirecting to Qwant may cause problems.

in reply to:  1 comment:2 by yatendra1999, 9 months ago

Replying to yatendra1999:

If i wanted to search "q bit" on the default engine, redirecting to Qwant may cause problems.

Or is it compulsory to define the search engine to be used like "g q bit"?

comment:3 by pulkomandy, 9 months ago

It depends what you type. The existing code already tries to do smart things

For example:

  • stdio.h -> contains a . so it is searched as a domain (annoying)
  • q bit -> search on qwant
  • g q bit -> search on google
  • g stdio.h -> search on google

We could make this even better by having suggestions in the completion popup. For example if you type q bit, the first and selected by default entry would be "search 'bit' on qwant", but using up/down arrow keys you can easily select "search q bit with default search engine". At least it would not be too annoying this way.

I think the Vivaldi browser does something like that, it is great because it gives you an idea of what will happen.

Note that if by default no shortcuts are configured, nothing will happen. It's just a possibility for the user to add more search engines.

If single-letter is found too easy to trigger, we can also use a different shortcut, for example !g or &g or whatever we decide one (slight preference for these because they are the syntax used by duckduckgo and qwant to search on other engines - but using a character not allowed in URLs may be a good idea too).

comment:4 by SyedSouban890, 8 months ago

Hi there. I am working on this ticket and would like to contribute to it. (This is to improve my GSOC application)

comment:5 by SyedSouban890, 7 months ago

Here is my implementation https://review.haiku-os.org/c/haiku/+/1359. @PulkoMandy please review my code.

comment:6 by nephele, 5 weeks ago

charaters that are not allowed in URL's are already allowed in searches, like space :) Personally i really really dislike implementation of this based on letters, it has caused me nothing but grief in the past (thus make it opt-out pretty please, if this is the way to go). On the other hand the way chromium does this feals quite natural to me, maybe that would be a possibility too?

Last edited 5 weeks ago by nephele (previous) (diff)

comment:7 by humdinger, 5 weeks ago

About 10 years ago I made this mockup:

mockup: tabbed pop-up

When you enter a string this tabbed menu pops up, cursor down lets you choose from the presented options, just like it does now. Once down there, a cursor left/right lets you change tabs.

I can't remember where I posted about this back then, but not everybody was a fan, I think... :)

Last edited 5 weeks ago by humdinger (previous) (diff)

by humdinger, 5 weeks ago

Attachment: web+_one_input.png added

mockup: tabbed pop-up

comment:8 by pulkomandy, 5 weeks ago

I'm not sure I like it with tabs, because you have to move to the other tabs to see what's there. A single list may work, with, in order (for example, but that's open for discussion):

  • Bookmarks
  • Search engines
  • History (sorted by "today", "yesterday", "last week", "old")

This way you can see at a glance what you are looking for.

Note that these shortcuts will not replace the default behavior (if it looks like an URL, open it directly, otherwise, if it starts with 1 letter + space, and there is a matching shortcut, use that, and if nothing works, throw the string to the default search engine).

And yes, we may not provide a huge list of preset search engines, so that it is not too easy to trigger this by accident.

comment:9 by humdinger, 5 weeks ago

I'm not sure I like it with tabs, because you have to move to the other tabs to see what's there. A single list may work, with, in order (for example, but that's open for discussion):

Generally, it's always a good to see everything in one glance. This is a slightly different situation:

  • we only show 8 lines in the popup menu (we don't want to obscure too much of the current website, and I suppose a short list is quicker to scan).
  • having bookmarks, search engines, history, (and maybe keywords) vertically in a single list means lots of scrolling to get from one to the next.
  • when we start typing, we almost always know what we want to do: search, open a (keyworded) bookmark, open from history. Normally, we don't need to see the tabs we're not interested in. Pressing down and left/right accordingly should quickly enter muscle memory
Note: See TracTickets for help on using tickets.