Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
parmentelat opened this issue May 9, 2022 · 3 comments

Comments

@parmentelat
Copy link
Collaborator

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
Copy link

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
Copy link
Collaborator Author

parmentelat commented Nov 6, 2022

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

  • when creating the new cell nbclassic does
    Notebook.prototype.insert_cell_at_index
    see code here
  • which in turn does
    Notebook.prototype._insert_element_at_index
    see code here
  • which in turn does
    this.get_cell_element(index).before(element);
    see code here

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...

@slxuphys
Copy link

slxuphys commented Jul 29, 2024

A workaround I found is to create a blank cell at the end of each slide with the slide type setting to 'skip'. Then any new cell created in the slides will be rendered.


Happy to see any other options as I need to teach Python again soon in a big classroom and really need this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants