zap-hud icon indicating copy to clipboard operation
zap-hud copied to clipboard

Bugfix/scrolling entire page

Open dscrobonia opened this issue 6 years ago • 8 comments

fixes a broken fix in #504 for

dscrobonia avatar Jul 11 '19 06:07 dscrobonia

Seeing some problems with WebSockets tab:

  1. Go to https://www.websocket.org/echo.html;
  2. Select WebSockets tab;
  3. Connect and send some messages until it starts to scroll (as expected);
  4. Disconnect and connect again;
  5. Send a message and notice that the scroll goes to the top.

thc202 avatar Jul 11 '19 09:07 thc202

btw, worth updating the change log with the fix.

thc202 avatar Jul 11 '19 10:07 thc202

ah the messageid's on the websocket events aren't unique :( That's why this latest scrolling issue popped up @thc202. Good find!

dscrobonia avatar Jul 12 '19 06:07 dscrobonia

Should work well now.

One behavior with it that I don't like though is that if you were to scroll up to find a specific request, and new request comes in, it will jump you to the bottom. :/ but scrolling is much better now.

dscrobonia avatar Jul 12 '19 06:07 dscrobonia

couldn't figure out how to detect scroll on the table. would be nice to match the behavior of the network tab

Feel free to merge if y'all like the behavior. its probably worth fixing the way it is currently

dscrobonia avatar Jul 12 '19 07:07 dscrobonia

Hum, that could also be really annoying - jumping to the bottom when you've explicitly scrolled to find something :/ Imagine you're looking at a modern web app that keeps making XHR requests - you'd never be able to find anything before it jumped to the bottom again.

Cant we use scroll events to detect scrolling? https://developer.mozilla.org/en-US/docs/Web/API/Document/scroll_event

I think we want:

  • Normal case, new request comes in we scroll to the bottom
  • User scolls up, new request doesnt scroll
  • User scrolls to the bottom, back to normal case

The other option is something like a checkbox for auto scrolling to the bottom.

psiinon avatar Jul 12 '19 07:07 psiinon

Yeah, that's the behaviour we have in desktop UI, if the scroll it's at the bottom it keeps scrolling on new entries otherwise it doesn't scroll (the auto-scroll can also be disabled).

thc202 avatar Jul 12 '19 08:07 thc202

Yeah that's definitely the behavior we want. I spent a few hours trying to figure that out yesterday and wasn't able to figure out where to tap for the onscroll event. I couldn't find any js hooks or DOM events to see that the user had scrolled. :/

dscrobonia avatar Jul 12 '19 13:07 dscrobonia