urbit / landscape

Product board for Landscape.
20 stars 6 forks source link

chat: inverted scroll on vimium #282

Open arawnx opened 3 years ago

arawnx commented 3 years ago

I use vimium, so the k/j keys are what I use to scroll up and down. The video below has screenkey enabled, the keys on the bottom of the screen are what I press in real-time. Typically, pressing j should scroll down and k should scroll up. Unexpectedly, the behavior is inverted when using the chat application on Landscape (but not elsewhere). See below:

https://user-images.githubusercontent.com/26530883/103425331-a7053c00-4b7f-11eb-89a5-8db8bc7d7bf7.mp4

To Reproduce Steps to reproduce/view the behavior:

  1. Use either qutebrowser or a vimium-enabled Chromium browser and boot up a Landscape instance
  2. Enter a chat session, attempt to scroll up or down using any of the available vim-keys (k, j, gg, G, d, or u)
  3. Scrolling is inverted using these keys

Expected design behavior k, u, and gg should scroll up, up one page, and to the top of the page respectively. j, d, and G should scroll down, down one page, and to the bottom of the page respectively. This behavior is inverted.

Desktop (please complete the following information):

tylershuster commented 3 years ago

This is understandable. To help explain it might be useful to know that the chat window is inverted vertically. This allows certain desirable behaviors such as appending messages to log without having to re-calculate the position of all previous messages. Unfortunately it also results in somewhat mysterious inverted behavior such as the symptoms you have mentioned. The implementation accounts for standard navigation keys such as arrows, page up, and page down, but you are the first to report using a browser with these key shortcuts. 

tylershuster commented 3 years ago

Theoretically, you could get around this by adding a listener to all scroll events. However, because there is no interface for discovering what triggered a scroll event, you end up with an infinite loop when you try to invert all scroll events