Closed ggggggggg closed 2 months ago
I have a fairly long notebook, and when I navigate to the bottom of the notebook, then click the plus button for a new cell below the last cell, it scrolls up about 80% of the way to the top of the notebook. I would prefer it stay looking at the new cell I just made.
This notebook displays the same behavior. To reproduce scroll to the bottom, press the plus to make a new cell below the last cell.
@ggggggggg - i noticed that too - i fixed that here: https://github.com/marimo-team/marimo/pull/1782
It seems like when a cell ending with mo.mpl.interactive(plt.gcf())
finishes rendering, it still moves focus to that cell. So I basically lose my place in the notebook every time I run a cell that causes re-plotting.
Description
I'm working on a notebook that makes many plots using matplotlib (which works great btw! Thanks!). When I redfine a cell that causes many plots to be re-evaluated, I find that I have to just step back and wait for all the re-evaluation to finish before I can make any more changes to that or any other cells. This is because every time a new plot is rendered, the vertical position of cells within the browser changes.
Suggested solution
My features request is to minimize the extent to which the active cell (the one I'm typing in) visually moves during re-evaluation. I suspect that a rule like "stuff rendered off screen can't move the active cell" may be a good heuristic, but I don't have strong feeling about the details.
Alternative
No response
Additional context
This linked notebook reproduces the issue. To try it,
marimo edit
the notebook, then find the cell that definesn=2
and redefinen
. Then try to redefinen
again quickly with a more complex expression.