ssborbis / ContextSearch-web-ext

Search engine manager for modern browsers
314 stars 35 forks source link

suggestion for drag and drop search feature #279

Open Amin884 opened 3 years ago

Amin884 commented 3 years ago

Is it possible to have a drag and drop search feature like Captain Caveman's Web Search Pro?I am currently using Simple Drag & Drop Search alongside ContextSearch for some of my most used search engines but it is very limited.for me it is the only feature that is missing from ContextSearch to make it perfect.

ssborbis commented 3 years ago

I'm not familiar with that extension. What is the drag & drop feature you're wanting?

Amin884 commented 3 years ago

I suggest you use "Simple Drag & Drop Search" add-on.you can select a text and when you drag that text your search engines will shown as tiles and you drop your text in engine you want.

ssborbis commented 3 years ago

Interesting feature. Would you want the same 8 tile setup ( first 8 engines in menu )?

Amin884 commented 3 years ago

actually one of the limits "Simple Drag & Drop Search" has is the number of engines."Web Search Pro" had 3 options up to 64 tiles which I personally think is too much.and you could assign tiles to search engines.maybe you can do that with a drop down list with tile number in engine setting? web_search_pro_08 web_search_pro_10

ssborbis commented 3 years ago

It's not too complicated to add something similar, but I'm wondering if I could simply add the option to open the quick menu on text-drag and you could use some CSS to enlarge the menu to achieve more or less the same effect. The menu already handles text drop ( in FF at least )

What's the benefit of having the larger tiles vs using the icons in the quick menu? Speed?

Amin884 commented 3 years ago

Yes it is faster and easier to use because tiles position are fixed but quick menu position is based on text position. but I guess if you could open quick menu on text drag and maximize it with transparent background it's almost the same thing.maybe just the pattern and lack of empty tiles are differences?

ssborbis commented 3 years ago

It's not pretty and options are limited, but I have it working. I'll spend some time refining it a little for testing before uploading anything to the repo.

Amin884 commented 3 years ago

Thank you for working on it.I appreciate it

ssborbis commented 3 years ago

My original idea was to make a special folder in the search engines manager to drag & drop engines to, but it's a pain to copy each engine and place the copy in the folder. I'll probably have to build a grid-like widget similar to what the original add-on used. I might not have anything great before the next release, but I'll get something.

Amin884 commented 3 years ago

thanks again.when do you think the next release come out?

ssborbis commented 3 years ago

The UI is coming along. I'm sure there are plenty of bugs, but hopefully I'll get a release out in a few days for testing.

Untitled

ssborbis commented 3 years ago

Can you use a simple gif to demonstrate the functionality of Page Tiles ?

enablePageTiles of /options.html#advanced , I never knew what it meant

In the latest repo version, there's a new tab in CS options named Page Tiles. The old way ( using the option in advanced ) is obsolete. It required a special folder in the search engines manager. The new way is managed in the Page Tiles tab. Enable, set rows / cols, drag icons where you want them. To test, highlight text in a web page, drag ( menu opens ), drop on a search tile.

ssborbis commented 3 years ago

@dnknn I just realized there was still some old code that was requiring a "Page Tiles" folder to exist causing Page Tiles to not work for other users. That's fixed now in the repo.

dnknn commented 3 years ago

@ssborbis I want to trouble you to record a simple gif demo, because I still don't understand, Because the browser(fork of Chromium) I use has a drag and drop function.

Details ![2010_15174438](https://user-images.githubusercontent.com/10995302/96106739-220a6f00-0f0e-11eb-9dcc-fd52415b11c9.png)
ssborbis commented 3 years ago

using a test profile with default settings...

demo

dnknn commented 3 years ago

using a test profile with default settings...

Thank you very much, I fully understand now. and I tested it with the latest repo experience, I personally think that this function is not necessary and has little practical significance. In addition, there are many browsers (especially fork of Chromium) Google's official Chrome/Chromium may also natively support the super drag-drop function in the future. So, I personally think that this feature is not necessary, for me personally, I will not enable it.

2010_15174438

123456

ssborbis commented 3 years ago

@Amin884 v1.27 live on AMO. ChromeStore in a day or 2

Amin884 commented 3 years ago

thank you.I've been using it for hours now.I really liked the freedom with the number of tiles.there are some issues but nothing important. you can even add some default tiles like "save image/link..." , "copy text/link..." or things like that.

ssborbis commented 3 years ago

there are some issues but nothing important.

I'm sure there will be bugs, but at least it's out there to test now.

you can even add some default tiles like "save image/link..." , "copy text/link..." or things like that.

That sounds like what some chromium forks have built-in. @dnknn mentioned them earlier in the thread . I guess FIrefox is late to that particular party, or they're leaving it to some other mouse gesture add-ons.

dnknn commented 3 years ago

Yes, Generally, some third-party chromium forks browsers will have drag-drop function, so this and CS drag-drop function cannot be enabled at the same time. For Chrome, there also are two extensions about drag-drop&gestures, can also achieve many functions ((I personally don't use there because I use the browser built-in)) smartUp https://chrome.google.com/webstore/detail/bgjfekefhjemchdeigphccilhncnjldn crxMouse https://chrome.google.com/webstore/detail/jlgkpaicikihijadgifklkbpdajbkhjo

Amin884 commented 3 years ago

That sounds like what some chromium forks have built-in. @dnknn mentioned them earlier in the thread . I guess FIrefox is late to that particular party, or they're leaving it to some other mouse gesture add-ons.

I know but they are usually direction-base not tile-base

ssborbis commented 3 years ago

@Amin884

I'm open to suggestions if you want to make a list here to append / edit

Amin884 commented 3 years ago

@Amin884

I'm open to suggestions if you want to make a list here to append / edit

I think blank tiles should be transparent.also when you drag and drop to a blank tile it should close the window but currently it remains open.they should work as some kind of a cancel button.

there is a issue with direction of tiles. it is inherited from the page. in rtl sites the first tile goes to right side of the screen.

another problem for me was favicons.most of them are 16*16 and they don't look good in this design.

ssborbis commented 3 years ago

there is a issue with direction of tiles. it is inherited from the page. in rtl sites the first tile goes to right side of the screen.

Do you have an site url I can test on?

I think blank tiles should be transparent

Fully transparent seems weird to me but I'll try it and add a css rule so you can modify empty tiles with custom css.

.also when you drag and drop to a blank tile it should close the window but currently it remains open.they should work as some kind of a cancel button.

Seems reasonable

another problem for me was favicons.most of them are 16*16 and they don't look good in this design.

Oh, they look terrible, but they're easy to recognize blown up. There's a balance there somewhere, I just haven't found it yet.

Amin884 commented 3 years ago

Do you have an site url I can test on?

sure.check this for example: https://www.tarafdari.com/

ssborbis commented 3 years ago

sure.check this for example: https://www.tarafdari.com/

K, fix is ready.

Amin884 commented 3 years ago

thank you

ssborbis commented 3 years ago

Any suggestions or changes you'd like to see on this feature? I can probably get them in before the next release.

Amin884 commented 3 years ago

Any suggestions or changes you'd like to see on this feature? I can probably get them in before the next release.

No I don't have any new suggestion except the things we discussed before.but there is a new problem.sometimes when you select a text and drag it, nothing is selected in the pop-up screen.you have to select the text again.

Everything else is perfect.thank you.

ssborbis commented 3 years ago

https://github.com/ssborbis/ContextSearch-web-ext/issues/304#issuecomment-763455841

ssborbis commented 3 years ago

Tons of new features in v1.28

ssborbis commented 3 years ago

Heads up to anyone using this, as of the latest push, the menu was moved from the host page's document to an IFRAME for security and other reasons. User styles CSS selectors have changed and there will be a slight increase in loading time.

ssborbis commented 3 years ago

@Amin884

there is a new problem.sometimes when you select a text and drag it, nothing is selected in the pop-up screen.you have to select the text again.

I think I have this figured out. I'm guessing you're using a HOLD method for opening the quick menu?

hg42 commented 3 years ago

nice feature...very useful

I recall something from the beginning... I used to drag text to the firefox search bar at that time, but I also tried this tiling thing. Then you implemented dragging to the sidebar (or if closed, to the little icon), because firefox restricted access to it's own areas. Basically, when dragging, the context menu could be opened. The rest is more a matter of size. But it is especially nice to have all folders open. On my 43" screen there is plenty of space for this :-)

suggestions:

ssborbis commented 3 years ago

when clicking on something outside of the tiles, they should close

Did you mean elsewhere on the desktop? I'm trying some event listeners and nothing seems to register a click outside the browser or elsewhere in the browser UI as an event ( no window blur, etc )

when canceling the drag (escape), the tiles should also close, because they do nothing in this case

drag events seem to capture keypress events, and the first ESC will cancel the drag ( in FF at least ). It doesn't register with keypress listeners so I can't see it. It doesn't even throw a dragend event. You need to press ESC twice. I don't think I can do anything about it, but I'll look.

maybe the tiles should open after some configurable timeout, in case there are other targets for dragging. It didn't happen, yet, but I am waiting for such a situation...

Working on some ideas. In the latest code, you can shake the mouse left and right a few times to cancel.

I think the tiles should not be rounded, it's a bit irritating, if something lurks through the holes, especially when animated

Hah, yeah that could be unnerving. Just override the border-radius in user styles .pageTile { border-radius:none; } should do the trick (untested )

I would generally prefer the look of the context menu (but big) and it would be more consistent to use the same design. I guess, something (e.g. colors) that works with the context menu should also work with the tiles.

That was my original idea, but it just didn't scale well. It needed a separate interface. I could add a button to copy the qm layout over.

I have several engines with longer titles, I would suggest attaching the icon to the bottom and a smaller font size (though I already changed it in CSS).

Accommodating all string lengths is nearly impossible, and getting something that looks nice for every DPI is a challenge, but I'll see if some scaling can be done.

ssborbis commented 3 years ago

drag events seem to capture keypress events, and the first ESC will cancel the drag ( in FF at least ). It doesn't register with keypress listeners so I can't see it. It doesn't even throw a dragend event. You need to press ESC twice. I don't think I can do anything about it, but I'll look.

Did you mean elsewhere on the desktop? I'm trying some event listeners and nothing seems to register a click outside the browser or elsewhere in the browser UI as an event ( no window blur, etc )

Got it. Events were on the parent window.

hg42 commented 3 years ago

when clicking on something outside of the tiles, they should close Did you mean elsewhere on the desktop?

would be even nicer, but I meant inside the page, which may be surprising, but I have a bigger tile number than engines, so about 1/3 of the page is still free. I would eventually also reduce the size of the tiles area via CSS to be able to click outside.

Motivation: For some reason clicking is usually easier than pressing escape, because I am using the mouse in this situation. I could also imagine pressing another mouse button combination (e.g. adding the right button while dragging) as end of the operation.

I'm trying some event listeners and nothing seems to register a click outside the browser or elsewhere in the browser UI yes, I am aware of this... May be the strategy could be much simpler: just close the tiles, when the dragging button is released (or generally dragging is finished), then the other cases are no more necessary

drag events seem to capture keypress events, ... well just close the tiles at the end of the drag Either you have a target at that point (dropped on a tile) or not (escape, dropped somewhere else)

maybe the tiles should open after some configurable timeout, in case there are other targets for dragging. It didn't happen, yet, but I am waiting for such a situation...

nor sure about that...this was just a feeling...I am still searching for a situation where it would matter or help... it mainly depends on other extensions doing similar things...most of the time I do not drag text, but often links (e.g. to bookmark folders on the bookmarks bar). I probably felt it would happen there...but links are not selected and thus don't trigger this kind of drag...seems to be safe.

Ok, just by saying it, I found a situation. I sometimes drag text to an editor or text input fields in another window.

Working on some ideas. In the latest code, you can shake the mouse left and right a few times to cancel.

yeah, that would eventually help, while it may also cancel if you are unsure where to drop (shaking the mouse)

I think the tiles should not be rounded, it's a bit irritating, if something lurks through the holes, especially when animated

Hah, yeah that could be unnerving. Just override the border-radius in user styles .pageTile { border-radius:none; } should do the trick (untested )

I tried, actually border-radius: 0, but it didn't work ad hoc, may be I made a syntax error or something... e.g. my first try used .PageTile instead of .pageTile, wait I used .CS_pageTile I think...will try again if I am at my PC

I would generally prefer the look of the context menu (but big) and it would be more consistent to use the same design. I guess, something (e.g. colors) that works with the context menu should also work with the tiles.

That was my original idea, but it just didn't scale well. It needed a separate interface. I could add a button to copy the qm layout over.

yes, I see it would be suboptimal to directly reuse the design...

I have several engines with longer titles, I would suggest attaching the icon to the bottom and a smaller font size (though I already changed it in CSS). Accommodating all string lengths is nearly impossible, and getting something that looks nice for every DPI is a challenge, but I'll see if some scaling can be done.

right...at least on my screen the text was very big, so only some short word like "Search" fits in the tile (well, also depending on my higher tile count...). Not sure about a working strategy.

Btw. my Browser window is either right half of the 4K screen or more or less full screen. This makes the tiles very big and very different in aspect ratio from the other size. I would probably prefer a maximum size, so they always look similar. That way it should be easier to find the engine I want. I will probably use some CSS to limit the size of the tile container or similar. I didn't look deeper into the CSS, yet.

hg42 commented 3 years ago

well, for some reasons, I usually don't use the quick menu. It seems to be too complicated with the configurations I tried (mainly in conjunction with other extensions etc.).

But looking at the tile solution I get the feeling, this could work exactly the same with the quick menu. In fact we already have a "hold" mouse button feature. If I set it to the left mouse button, it behaves quite similar, but not exactly. It waits some time (while not moving the mouse) to distinguish from a drag, before opening the quick menu. Dragging is more convenient and faster, you already move to the target button, before it is even displayed.

So [sorry, a feature request] it would be nice to add a "drag" setting to it (not sure if it would work directly, but at least dropping is already implemented).

I guess, I would use this instead of tiles, because it works with shorter distances for the mouse (quicker and identical usage, same places for engines etc.). I could even make the quick menu bigger. Should I open another "issue" for that?

Amin884 commented 3 years ago

@Amin884

there is a new problem.sometimes when you select a text and drag it, nothing is selected in the pop-up screen.you have to select the text again.

I think I have this figured out. I'm guessing you're using a HOLD method for opening the quick menu?

no just by dragging text.it rarely happens recently. btw, new update is great

ssborbis commented 3 years ago

@hg42

I have a bigger tile number than engines, so about 1/3 of the page is still free

If the tiles are actually there, just empty, ( no search engine there ) they should close when you drop / click.

.pageTile { border-radius:0; } worked for me, but I am on slightly newer code locally.

I guess, I would use this instead of tiles, because it works with shorter distances for the mouse (quicker and identical usage, same places for engines etc.).

So you'd like a "drag" opening method added to the quick menu?

hg42 commented 3 years ago

I have a bigger tile number than engines, so about 1/3 of the page is still free If the tiles are actually there, just empty, ( no search engine there ) they should close when you drop / click.

no, the empty tiles are not drawn, I'm just clicking elsewhere on the page. If I would shrink the tiles, I would even have more chance to click beneath. But anyways, that's only relevant, if end of dragging doesn't close the tiles, which they should in my opinion.

.pageTile { border-radius:0; } worked for me, but I am on slightly newer code locally.

I first need to revive my github repo installation. Currently, I am runnning normal releases.

So you'd like a "drag" opening method added to the quick menu?

yes

ssborbis commented 3 years ago

@hg42

Currently, I am runnning normal releases.

That's probably the reason we're seeing different results. The repo and the last release are very different in a number of ways. There are a ton of changes / upgrades.

ssborbis commented 3 years ago

@hg42

Option added. Right now, only really viable in FF due to Chromium-based drag behaving badly over iframes.

ssborbis commented 3 years ago

@Amin884

no just by dragging text.it rarely happens recently.

I was seeing this issue with this behavior

  1. Open qm using a HOLD method
  2. close qm
  3. drag text to open pagetiles

It was opening the qm on the page before using pagetiles that was causing it for me. Your bug may be slightly different.

hg42 commented 3 years ago

I am now using the repo version (at 9ae7ba59 but no drag option?)

hg42 commented 3 years ago

That's probably the reason we're seeing different results

yes, formatting works now

hg42 commented 3 years ago

I have a hidden folder (using Hide in the context menu). It should not be shown in tiles. EDIT: btw. in the preview it is hidden...

The root folder "/" is also shown (or can it be used for something? well, it will probably open in all sub-engines :-) ) EDIT: also shown in preview

ssborbis commented 3 years ago

@hg42

No drag in the repo yet. I have some changes that need completed first, but it's coded and does work. I added the same "shake to close" as page tiles, although it gets buggy when used over the qm ( drag events get weird over iframes )

I have a hidden folder (using Hide in the context menu). It should not be shown in tiles.

I'm not sure how I want to handle that. Since it's easy to add / remove a folder from the tiles, I may leave it to the user to decide what nodes to use, hidden or not. Maybe I'll leave them in the tree, but represent them as hidden with a low opacity, and display them as empty when the menu opens. Minor details...

The root folder "/" is also shown (or can it be used for something? well, it will probably open in all sub-engines :-) )

That was the idea

ssborbis commented 3 years ago

big push going up

@hg42

~I disabled the shake-to-close on the qm for now, but~ the drag option is there. You will get both the qm and pagetiles if both are enabled

hg42 commented 3 years ago

that was funny... :-)

First, I forgot that the extension is only loaded temporary from the sources... I once had a firefox startup modification... but Murphy demands that it's not working. Unfortunately I changed my CSS until it was like it was before using the repo...well that made me think again :-)

Second, I looked for "Drag" in the "Click and Hold" menu, and there's none... haha...how blind can I be? the new option is only some mm below...

Also, I wasn't aware, that I can use that preview to configure the tiles. That's nice, and I can use display: none on empty tiles (well it worked with the release version, but now the selector seems to be different and see below why I can't find the current selectors).

After "solving" all that, I tested pagetiles. Works well so far, canceling drag also removes the tiles, nice. While this is very convenient for normal usage...it makes inspecting difficult (impossible?). Do you have a trick? any tricky way to stop dragging without closing the tiles? maybe a Modifier-Escape or similar? It's the same problem for screenshots. Well, I know this is a more general problem, that I get with other menus or dragging situations, too. One solution for screenshots is using a timeout (some tools can do this). Maybe the debugger has a similar solution...

Quickmenu+Dragging is awesome... I get all the nice features, like

With choosing a much bigger menu (and comparing features to the tiles), there could be some more for quick menus:

btw. for the tiles I am currently using background-position: center bottom 10%; to position the icons attached to the bottom with a configurable distance (here 10%). For a smaller tile the distance shrinks automatically.