ssborbis / ContextSearch-web-ext

Search engine manager for modern browsers
329 stars 37 forks source link

Visual bug on Quick Menu's "Filter search engines..." feature when no search engines match #554

Closed redactedscribe closed 1 year ago

redactedscribe commented 1 year ago

All my search engines only have selection enabled as the filter and Quick Menu's "Filter search engines..." option is enabled. When clicking a link, I see:

cswe

This is clearly because none of the search engines are using link as their filter so ContextSearch tries to draw the Quick Menu but there are no engines to display, but fails for some reason.

The Quick Menu should display in this scenario, and I think it would be a good choice to put message such as "No link filtered search engines found" (dependant on the filter category with nothing to show) in the area where the list/grid normally display:

cswe2

If the Quick Menu shows when no search engine is found due to the filters being enabled, we could at least then switch to a different page(tab?) of the Quick Menu if we wanted to use selection, or video instead, for example.

Thanks.

ContextSearch 1.43 Firefox 104.0.2

redactedscribe commented 1 year ago

I just added one search engine to the link filter and attempted to open the Quick Menu on a link:

cswe3

Why is it now a thin strip? Because of the presence of only a single search engine? Can the Quick Menu open at a more regular size because if you notice, the box at the bottom which shows the term (i.e. "Dictionary.com" in the previous screenshot) is completely compacted.

Maybe it's related to

[data-menu="quickmenu"] #titleBar {
    display: block !important;
}

which was something I believe you had suggested when I previously needed help with the look of the Quick Menu.

ssborbis commented 1 year ago

The qm gets a bit weird with low numbers of engines. It automatically adjusts width for the number of columns needed to be displayed. When there are few engines, this makes for a narrow menu. The problem is more noticeable now, since adding the contexts bar.

I'll see what can be done about both issues

ssborbis commented 1 year ago

This is clearly because none of the search engines are using link as their filter so ContextSearch tries to draw the Quick Menu but there are no engines to display, but fails for some reason.

Which CS version are you on? I did some testing on the latest version, and I'm not seeing this issue, I think because links now give both selection and link contexts ( so the link text can be used with selection-context engines ). That doesn't quite fix the problem, but I wonder if you'd still have that particular issue on the latest version.

redactedscribe commented 1 year ago

Which CS version are you on?

ContextSearch 1.43 (which I believe is the latest version). I refreshed the page when I noticed it and it would still draw that thin line. What should be happening?

redactedscribe commented 1 year ago

Correction, just upgraded to 1.44 now the bug appears to be gone: Quick Menu shows up with both the link and selection icons highlighted at the top when triggering the QM on a link.

redactedscribe commented 1 year ago

Also, something that I've noticed: New search engines aren't created with any default filters. Maybe when the advanced feature is turned on, it should be part of the new search engine creation process that's displayed when clicking the "Add to ContextSearch" context menu option on a site's search field. This way, new search engines could be immediately used without needing to go to the options to check say selection for the new entry.

redactedscribe commented 1 year ago

Another thing: When the Context Menu has the advanced filter option enabled, it doesn't seem to work right. If it's enabled and I right click a selected word, it reads "Search for SELECTION", but if I do the same on a bit of linked text, the option doesn't even show up when one would expect it to perhaps say "Search for LINK". Or maybe because it's both a link and a selection you've chosen to ignore those cases for the context menu? The QM handles both scenarios fine.

ssborbis commented 1 year ago

New search engines aren't created with any default filters

I've seen this too. Context filtering is still pretty new so there are a few loose ends to correct like this one.

if I do the same on a bit of linked text, the option doesn't even show up when one would expect it to perhaps say "Search for LINK"

This is probably happening because you don't have any engines with a link context. I'll have to check that code because it should be serving up the link text, provided you're using the correct CTRL toggle ( you can default to text, and show url if holding CTRL, or vice-versa ), but that appears broken when using filtering.

redactedscribe commented 1 year ago

Correction, just upgraded to 1.44 now the bug appears to be gone: Quick Menu shows up with both the link and selection icons highlighted at the top when triggering the QM on a link.

I guess it was just fixed for links in 1.44. Triggering the QM for videos still shows the thin vertical bar.

ssborbis commented 1 year ago

If you want a useful workaround while I figure out something more permanent, you can set a minimum width for the tile menu in CS options -> General -> User Styles

#quickMenuElement { min-width: 200px; }
ssborbis commented 1 year ago

I've added a new option to the qm. You can now set a minimum number of columns to display. This will prevent the menu from shrinking below a certain width, in the event you have few engines to display. I've also set the qm to resize when changing contexts.

These changes should fix the bulk of the problems your seeing. Test code in the development branch.

Peek 2022-09-15 21-30

redactedscribe commented 1 year ago

Both the minimum number of icons and the resizing feature are good additions, thanks.

Feedback:

In my attempt to figure out how you have two rows of icons above the search engines, I managed to get the Contexts Toolbar stuck at the bottom of the QM:

ffqm

I unchecked its show option, and re-checked it, and now it's at the bottom and I can't seem to be able to get it above the Tools bar (I've tried setting the Tools bar's Position to Bottom but it won't move either):

fftoolsbar

I have "Apply custom CSS styling to menus" disabled.

ssborbis commented 1 year ago

You're probably aware, but the right-click menu is always displaying over the QM in the dev branch version.

That may be fixed now in the latest pushes. The context menu is stubbornly problematic due to the lack of developer control; fix one thing, break another.

The Columns/Rows subsections under Layout for the QM are confusing, well, in particular Columns. Why "Columns"? The options "Max/min number of search engine icons per row (grid view)" control the row length, not the column height.

It's the number of columns per row. Same thing as saying row length, really. The initial idea was a grid layout, so columns, rows seemed like the natural terminology.

It may be a good idea to set the initial value of the "Min num...per row" option to whatever the Max option is currently set to. This way, the jumping around of the header icons as seen in your screen-capture wouldn't be a thing. The default auto resizing would then only happen vertically. If someone wants less, they could set it, but in my opinion, at the cost of some UX.

Not a bad idea.

I unchecked its show option, and re-checked it, and now it's at the bottom and I can't seem to be able to get it above the Tools bar (I've tried setting the Tools bar's Position to Bottom but it won't move either):

Click the layout editor tool ( add if you dont have it, or assign a shortcut ), then you should be able to rearrange the menu how you like it.

ssborbis commented 1 year ago

I think this is fixed. Reopen if not.