Description
This is a very useful feature! I miss having something like this from classic, when bootstrap-tour
was always right there.
I'd love to see the DX of building a tour extended into a more declarative format. While joyride has a lot of features that only make sense with the full JS API, there's a lot of stuff one could build declaratively without having to learn any React/JSX... or, more importantly, recompile Lab to see a small change. Draft 7 JSON Schema seems like a good choice, as ajv
is already hanging around.
I guess the simplest form of this would be a lumino command, e.g. jupyterlab-tour:start-tour
with an args
of {steps: [{target: '#main', content: 'hello world!'}]}
. This would allow an extension to not even have to know about the ITourManager
.
Document: Putting a conforming schema instance into a file e.g. my-feature.tour.json
would also make it possible to have a default "Start Tour" from the file browser. This would play very nicely with existing features like the router commands, e.g. lab/tree/my-feature.tour.json
, and would feel great with nbgitpuller, etc. It could be JSON5, again, because it's already lying around and slightly improve the end user experience, but JSON is probably a more portable solution, while YAML/TOML would be more humane.
Editing: An Open With... ▶︎ Tour Editor with something like react-jsonschema-form could then do round-trip editing of a tour, with a one-click "preview". I've wrapped rjsf up in lumino/lab stuff, with a few goodies like a codemirror widget, in jupyterlab-rjsf so it could be relatively straightforward to drop into a MainAreaWidget without a lot of effort.
Cosmetics: A few key props, llke step.content
and .title
, which are expecting a react component, could also be markdown, perhaps with a flag or alternate prop, e.g. markdownContent
. Or, an even more jupyter-like way to do it would be a mimembundle... i don't know why you'd want to have a CSV, but you could!
Commands: Having access to calling JupyterLab/lumino commands at different stages would further reduce the amount of coding required to put together a really interesting tour. Perhaps being able to match and dispatch commands from the argument to callback
would be sufficient, e.g.
steps: ...
callback:
- on:
step: 0
type: step:after
command:
id: some-ext:some-command
args:
some: arg
Anyhow, food for thought!