jupyter / jupyter-js-notebook

JupyterLab notebook
BSD 3-Clause "New" or "Revised" License
46 stars 18 forks source link

Smooth markdown cell editing #176

Closed willingc closed 8 years ago

willingc commented 8 years ago

Using the editor is still a bit wonky when working with markdown cells.

I'll revisit this next week when I'm working with JupyterLab as a user (I did promise that I would use JL one day each week.)

ellisonbg commented 8 years ago

Great! Can you clarify what aspects are wonky? I have used JupyterLab for markdown a tiny bit, but didn't notice anything that I remember.

On Wed, Apr 13, 2016 at 12:02 PM, Carol Willing notifications@github.com wrote:

Using the editor is still a bit wonky when working with markdown cells.

I'll revisit this next week when I'm working with JupyterLab as a user (I did promise that I would use JL one day each week.)

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/jupyter/jupyter-js-notebook/issues/176

Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger@calpoly.edu and ellisonbg@gmail.com

willingc commented 8 years ago

@ellisonbg Sure thing. There seems to be a weird flicker/flash of the help text that says input text or LaTeX. It also seems to be losing focus when entering multiple lines of markdown and flipping between markdown and code mode. I started using JupyterLab to make this and wound up switching back to the regular notebook.

ellisonbg commented 8 years ago

Perfect, does sound wonky - that will be helpful in fixing the behavior.

On Wed, Apr 13, 2016 at 2:50 PM, Carol Willing notifications@github.com wrote:

@ellisonbg https://github.com/ellisonbg Sure thing. There seems to be a weird flicker/flash of the help text that says input text or LaTeX. It also seems to be losing focus when entering multiple lines of markdown and flipping between markdown and code mode. I started using JupyterLab to make this https://github.com/willingc/newsletter/blob/planning/planning/newsletter.ipynb and wound up switching back to the regular notebook.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/jupyter/jupyter-js-notebook/issues/176#issuecomment-209662977

Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger@calpoly.edu and ellisonbg@gmail.com

willingc commented 8 years ago

@ellisonbg Here's a link to a screencast of the experience: https://www.dropbox.com/s/8th1ad7um9rzo3t/jlab-lo.mov?dl=0

Another minor little thing: When creating a new notebook, it would be nice if the notebook would launch once I hit return after typing the notebook name (would save a button click on create).

willingc commented 8 years ago

Oh yuck the low res version above looks awful. Here's the full res version: https://www.dropbox.com/s/lof5b3uv0ukig3y/jlab.mov?dl=0

blink1073 commented 8 years ago

Yikes, looks like a weird feedback loop with mathjax.

blink1073 commented 8 years ago

I also use Chrome on OSX and haven't seen that behavior.

ellisonbg commented 8 years ago

Yikes, that is wonky :-)

I can reproduce this on Chrome + OS X. Here are the steps I used:

  1. Create a markdown cell
  2. Double click to put into unrendered edit mode
  3. Now click away to put into unrendered command mode
  4. Now click back on the cell and it will flicker.

The important observation in debugging this is to see that the cell is going back and forth between command and edit mode. This is a classic problem when there are cycles in the event loops related to cell focus and command/edit mode. These occur when user triggered focus events (mouse clicks) trigger further programmatic focus events and those echo back and forth.

The best way of debugging all this stuff is to put in debug statements upon swtiching command/edit mode and then watching to make sure that as you perform interactions that change the mode, those debug statements only show up once. In early implementations of command/edit mode, @jdfreder and I found situations where in a single mode change by the user, there were many mode changes along the way. It took weeks of debugging to get all this logic right and avoid these event cycles. My advice based on this experience:

On Wed, Apr 13, 2016 at 4:54 PM, Steven Silvester notifications@github.com wrote:

I also use Chrome on OSX and haven't seen that behavior.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/jupyter/jupyter-js-notebook/issues/176#issuecomment-209694714

Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger@calpoly.edu and ellisonbg@gmail.com

blink1073 commented 8 years ago

Thanks for the helpful video, @willingc. Thank you for the insights, @ellisonbg. We are going to do a full audit of the focus handling starting with phosphor-ui and a focus-request message when that is released.

blink1073 commented 8 years ago

@willingc, the changes are confined to this repo for now, I am not yet ready to propagate them to JupyterLab.

willingc commented 8 years ago

@blink1073 Got it. Thanks for letting me know. 👍

willingc commented 8 years ago

@blink1073 This seems to be working nicely in the latest JLab alpha. Markdown and editing work well. I'm going to close this. Feel free to reopen if needed.

blink1073 commented 8 years ago

Great! Thanks for beta-testing ;)

willingc commented 8 years ago

I also really like the new pop up. One small thing UI thing - I had some trouble finding out how to save a new text file. I tried command S on my mac but no love. Then I clicked Files thinking Save would be there. Ultimately I clicked commands and life was good ;)

blink1073 commented 8 years ago

Yep, that is on our roadmap pending a refactoring effort.