nteract / hydrogen

:atom: Run code interactively, inspect data, and plot. All the power of Jupyter kernels, inside your favorite text editor.
https://nteract.gitbooks.io/hydrogen/
MIT License
3.92k stars 334 forks source link

Atom Hydrogen Freezes #1680

Closed optionsraghu closed 5 years ago

optionsraghu commented 5 years ago

Dear Atomists! After I updated to 2.10.0 Hydrogen , the CURSOR on the editor freezes whenever an output window is closed or whenever I come back from another window into atom. I tried re-installing Hydrogen, tried re-installing atom itself but it persists. Any advice please? Thanks

wadethestealth commented 5 years ago

You could try downgrading back to 2.9 and letting us know if the freezing still happens, in which case it would be something else causing it.

optionsraghu commented 5 years ago

Brilliant! Thanks Wade. That did the trick. Appreciate your help. But that means there is a bug on 2.10.0.

wadethestealth commented 5 years ago

I prefer not to close the issue, and could you gives us some simple steps to reproduce what happened

optionsraghu commented 5 years ago

well as i mentioned, I just upgraded to a newer version (2.10.0) and whenever I ran a line of code or a bunch of it, and when the output window was closed manually by clicking on the cross, the cursor on the window just froze and wouldn't budge. the same issue was observed when i had to toggle between different windows (chrome, firefox, atom etc). one way i was able to adjust to this was by clicking on the mouse button once and the cursor would 'wake up'. as per your suggestion i have gone back to the older ver (2.9.0) and it works like a peach. thank you.

shr00mie commented 5 years ago

i can confirm this behavior as well in 2.10.0.

under 2.10.0, to get the cursor to unstick, you'd have to do a combination of either using arrow keys or clicking on another line with the mouse. behavior stopped after reverting to 2.9.0.

BenRussert commented 5 years ago

https://github.com/nteract/hydrogen/blob/695adf9608a2d5987cba7a5f9765f0964222e1c9/lib/components/result-view/result-view.js#L149

@wadethestealth From messing around in devtools a bit I'm pretty sure this line causes the issue. I'm hoping there is a way to keep the selection behavior, but not set the tab index. I assume the tab index part is important though?

wadethestealth commented 5 years ago

I don't understand how that causes a freeze, I think I tried removing it before, but I think it's necessary.

wadethestealth commented 5 years ago

It may be because of the output pane being selectable too. May it should only have -1 when there is no output pane?

wadethestealth commented 5 years ago

I am not too sure how tabIndex works behind the scenes though

BenRussert commented 5 years ago

It's not exactly a "freeze", it just removes focus from the cursor/editor element and makes the root body the active element.

So basically the user has to click back to where they were.

wadethestealth commented 5 years ago

Ok will take a look later and update this comment

BenRussert commented 5 years ago

To reproduce, just run any code with multi-line (in editor) output. Then click the close box to destroy the output. Your cursor will visibly still be there, but focus changes unexpectedly from where you were.

For easy repro:

from IPython.display import HTML

display(HTML("<h1>Multiple</h1>"))
wadethestealth commented 5 years ago

@BenRussert I have working fix now. I am just trying to see if there is a better way to implement. I will open a PR soon.

optionsraghu commented 5 years ago

so does it mean i can upgrade to 2.10.0 now? thanks.

wadethestealth commented 5 years ago

2.10.2 @optionsraghu

optionsraghu commented 5 years ago

Thanks @wadethestealth

optionsraghu commented 5 years ago

@wadethestealth I also have issues with atom freeze when I run some intensive time series models (such as Sarimax etc). Is this the forum to report it too? Thanks.

wadethestealth commented 5 years ago

@optionsraghu No it does not, but it may be beneficial for you to look and measure your kernels performance to see what hangs. You could also view atom dev tools performance to see if hydrogen is causing the large delays. If you found out it's hydrogen, it would be nice if you could open up an issue show a screenshot of the performance with code to replicate