deathbeds / jupyterlab-deck

Lightweight presentations for JupyterLab
https://jupyterlab-deck.rtfd.io
BSD 3-Clause "New" or "Revised" License
40 stars 9 forks source link

Confused by navigation: space and shift-space skipping certain sublisdes / fragments #49

Open nthiery opened 1 year ago

nthiery commented 1 year ago

Description

JupyterLab-Deck sounds very promising.

However, coming from rise / reveal, I am used to space (resp. shift-space) to move through the whole slide show by minimal step; e.g. move to the next (resp. previous) available fragment/subslide/slide. However, in certain situations, space skips subslides. And in certain situations, shift-space skips fragments and subslides. In particular, space and shift-space are not reverse operations.

Is this on purpose or a bug?

Thanks!

Reproduce

  1. Launch the jupyterlab-deck, e.g. from the jupyterlite demo.

  2. Upload the attached test.ipynb.zip (sorry, zipped, because github does not support ipynb attachments ...)

  3. Open test.ipynb notebook

  4. Toggle Deck
    The (first fragment of the) first slide is displayed

  5. Hit space
    The following fragment is displayed

  6. Hit space
    Expected: the following subslide "Subslide1" is displayed
    Got: the subslide "subslide2" is displayed

  7. Hit space until reaching Slide2

  8. Hit shift-space Expected: Subslide2 and its fragment is displayed Got: Slide 1 is displayed

Context

No message in the browser console, except for standard GET calls to kernels/sessions/...

bollwyvl commented 1 year ago

Yep, there was some cheating done. Correct, predictable navigation probably needs to be generalized as a parallel hierarchical finite state machine (e.g. xstate). Things also get complex when authoring a deck directly in deck view (adding new cells).

nthiery commented 1 year ago

Just for the record: if I make all subslides into slides, then Space / Shift-Space navigation is smooth. So a quick fix might be to have a dedicated Space/Shift-Space navigation that just ignore the difference between slides and subslides.

brichet commented 10 months ago

@nthiery @bollwyvl I can take a look at it. Just wondering what should be the correct workflow. Let's say we have the following schema:

Slide 1
   Sub slide 1.1
   Sub slide 1.2
Slide 2
   Sub slide 2.1

Pressing right arrow from Sub slide 1.1 should redirect to Slide 2. But then, should pressing left arrow (or shift space) redirect back to Sub slide 1.1 or to Sub slide 1.2 ?

The first case would require keeping the state of each slide when moving to another slide.

nthiery commented 9 months ago

Oops, I missed your question. I am not sure myself what the semantic should be for left/right arrow (I rarely use them). reveal.js being widely used, following the same convention is presumably a safe starting point:

https://revealjs.com/vertical-slides/

The documentation there is a bit ambiguous. However my understanding of the default behavior is that, when moving back and forth from one stack to the other, one always lands on the first slide of the stack.