damianavila / RISE

RISE: "Live" Reveal.js Jupyter/IPython Slideshow Extension
Other
3.66k stars 414 forks source link

let users create a new cell even if we're on the last one on the slide #616

Open parmentelat opened 2 years ago

parmentelat commented 2 years ago

if in slide mode I press e.g. 'Option-Enter', a new cell is created all right

except if I'm already on the last cell in the slide (no time at this point to say what with fragments and all, so for now assume there's no fragment); in that case the cell is created all right but it's not rendered in that slide, I have to toggle to notebook and back, to see the newly created cell

this of course is about the classic RISE

matthigger commented 1 year ago

I have the same concern, it'd be a big benefit while I teach to be able to add cells at the end of the current slide.

Thanks for your help!

parmentelat commented 1 year ago

did a bit of reading about this; it feels like what's happening is

this is where I lost track, it looks like this .before method is a jquery one, not entirely sure; but that clearly suggests that the new DOM element is inserted before the next cell (and not after the current cell)

which is quite consistent with the observed behaviour, because: RISE does not in itself interfere with cell creation; it's mostly about transforming the 'flat' notebook structure into a slide-by-slide reveal structure so when a cell gets created in the middle of a slide, its element ends up in the right place it's kind of coincidental; however in the case of the last cell in a slide, the new element ends up in the wrong slide...


not quite sure how to fix it then; even more so as the classic notebook is frozen

ideas welcome...