CanisLupus / swift-selection-search

Swift Selection Search (SSS) is a simple Firefox add-on that lets you quickly search for some text in a page using your favorite search engines.
https://addons.mozilla.org/firefox/addon/swift-selection-search/
MIT License
215 stars 26 forks source link

Pop-up mouseover jitter introduced by 3.40.2 #158

Closed seascape closed 4 years ago

seascape commented 4 years ago

Describe the problem I had the pop-up configured to stay static as I moused over its icons, only moving the blue highlight underscore to whichever icon was moused over. Now, something (the highlight underscore?) pushes the non-moused-over icons in the same row various elements of the pop-up downward, creating a visual jitter.

I still have 3.33.1 running in another instance of Firefox. Here is how I expect it to behave: GIF2

In the other Firefox instance that updated to 3.40.2, with the exact same SSS Options settings (though slightly different search engines), it now jitters: GIF

How to reproduce the problem Mouseover an icon of the pop-up with the below settings. Icons to the left and right of the moused-over icon Various elements of the pop-up will scoot downward as you move the cursor around.

Anything else you'd like to include Both Firefox instances use these identical settings Clip 000044 DR 354  SSS Options

Clip 000045 DR 354  SSS Options

System info: Windows 10 / Firefox 70.0.1

Also Thank you for this excellent add-on. :)

CanisLupus commented 4 years ago

Hi! Thanks for reporting this. Internally several things changed in the formatting of the popup in this version. I hoped they would be invisible to previous users, but I think you found an exception. ;)

I haven't looked into this yet, but it's possible that the negative vertical padding of -2 has something to do with it. I will check this when I can and see if it's fixable with the new "internals".

Also: You're welcome. Happy that you like it! :)

Cheers! Daniel

Btw, I really appreciate the work that went into this report. The gifs are very useful!

CanisLupus commented 4 years ago

Hi @seascape! Version 3.41.0 fixes this, but you may not like the solution. :(

Let's see... First of all, this was working before the update because the icons were positioned by calculating their exact position in JavaScript. The size of each icon didn't affect the others, so it could move or be highlighted without a problem.

This wasn't the way I wanted to do this originally. CSS formatting can easily create a grid. The problem was that custom CSS was blocked by some website policies, so I could not reliably use it until a new feature was added to Firefox. When the feature arrived I changed SSS's code to use CSS again, hence why you began seeing the problem.

Now, the issue is... I don't think I ever intended to support negative icon padding. :p There was supposed to be a minimum of 0 for the padding values but it was missing, so I enforced that minimum in this new version, both in the settings page (which was allowing the number to go below 0), and in the code that uses the padding.

This means that, unfortunately, all users that were using negative padding (and in the case of "Highlight and Move" also 0 padding) now get slightly bigger padding (the minimum allowed by SSS). The other solution to the problem would be reimplementing the icon positioning again with a lot more code, and that would probably cause trouble elsewhere with little improvement, so I hope you understand my decision.

I just hope this doesn't make the design too "spacey" in your case, but it was really the most sensible approach I could think of to this issue.

I'm closing this but feel free to respond!

Daniel

seascape commented 4 years ago

Hi Daniel. Interesting explanation!

I updated my settings and for whatever reason I notice no difference in my layout. Nice and svelte!

Clip 000275 DR 75  Pop-up mouseover jitter introduced by 3 40 2 · Issue #158 · CanisLupus_sw

Thanks for the fix and, again, the great add-on!

CanisLupus commented 4 years ago

Great! I'm very glad that you were not bothered by the change. It probably increased your vertical padding a bit (1 or 2 pixels between icons) but it may be hard to notice (in that case, all is well!).

Cheers! ;) And you are welcome.

seascape commented 4 years ago

Ah yes, you're right re: vert padding. But life's too short to be bothered by such. Gotta choose my battles. :)

CanisLupus commented 4 years ago

Haha fair enough! ;)