att / rcloud

Collaborative data analysis and visualization
http://rcloud.social
MIT License
430 stars 142 forks source link

autoscroll doesn't always keep input field in view #2662

Open gordonwoodhull opened 5 years ago

gordonwoodhull commented 5 years ago

I would argue that interactive debugging is the most important use-case for autoscroll: one is already in an agitated state when debugging, so the cursor should definitely not be pushed offscreen by debug output.

Scrolling is noticeably jumpy when using debug, but it mostly keeps the input field scrolled into view. But if the output is longer (R often prints whole function "expressions") then it seems output is not done when scrolling happens, so it gets pushed out again.

gordonwoodhull commented 4 years ago

Autoscrolling the output works slightly better than the get_input hook we are using (especially with its useless animation) so I'm disabling the latter when the former is enabled.

But it's only part way in view, and doesn't work if there is no output before input, so it's just a mitigation not a solution. FWIW once you start typing, the input will autoscroll by browser magic.

I think get_input may happen before all output occurs, even when autoscroll buffering is disabled. (How is this possible?)

Needs deeper investigation than I can afford right now.