ipyparallel icon indicating copy to clipboard operation
ipyparallel copied to clipboard

Support RetroLab/NB7?

Open bollwyvl opened this issue 4 years ago • 3 comments

Elevator Pitch

Replicate the nbextension UI in RetroLab Tree page, so that it's ready for Notebook 7.

Motivation

Existing internal/course content might refer to Open the IPython Clusters tab.

Alternatives

  • do nothing
    • maybe the Python API is better?

References

  • from #642

Design Ideas

A really quick (yet functional) hack:

Screenshot from 2021-12-02 08-43-54

  • It does point out that the control surface for "number of engines" is missing.
    • it probably doesn't have to look exactly the same as it did when it first released!
      • does need at least the same number of knobs, buttons, and read-outs as currently in the nbextension
      • would have to think carefully about adding more (e.g. snippet)

Limitations

There's presently no way to communicate to an already-open notebook in another tab (hint: there darned well should be!) so that would probably fall away... though it (and the nbextension) could grow more of a "snippet generator".

bollwyvl avatar Dec 02 '21 14:12 bollwyvl

Definitely happy to have this if folks want it!

I have no idea how retrolab extensions work.

The server-side API should have everything needed (because the classic notebook UI still works with ipp 8), so adding it to the ts and/or UI shouldn't be much. Maybe it should be in the lab extension as well!

One option for the snippet generator is to have a "copy connection snippet" button that puts the code in the clipboard, rather than lab's drag & drop. We already have getClientCode(cluster) so adding a command like injectClientCode(cluster, editor) called copyClientCode(cluster) that puts it in the clipboard should only be a few lines (assuming writing to the clipboard is easy on the web now). That is definitely a feature the classic clusters tab never had (new random cluster ids makes it more useful than it would have been long ago, where it was ~always rc = ipp.Client(), though, so it's more a feature-parity with lab thing than a feature-parity with classic thing.

minrk avatar Dec 03 '21 14:12 minrk

if folks want it!

Right, of course: on the one side, i'm not looking for more work! But I also really want this transition to go smoothly and remove as many roadblocks as possible for "old friend" extensions. Also, showing "first-party" at (least pre-Big-Split :rofl:) extensions are getting on the bus is a signal to the broader community that we Love You and Want You To Be Happy.

server-side API should have everything needed

yeah... and who knows, maybe people are using that API for cool stuff!

no idea how retrolab extensions work.

On the point above: having more simple example PRs of supporting Retro, and exactly these kinds of design discussions, is super useful.

As a preview: that's the great part, for the most part They Just Do! The delta for that screenshot was:

  • add a retrolab in extras
  • install that
  • run retrolab
    • see a few js console error messages about missing tokens in the /tree
      • make LabShell optional
      • remove a bunch of unused requires tokens
      • if LabShell is avaialble
        • add sidebar to shell
      • otherwise if app.shell.currentWidget is a TabPanel
        • add sidebar to it
        • add sidebar.title to app.shell.currentWidget.tabBar
  • restart retro
  • get candy

Some of the tokens might get ironed out, but it's pretty much possible to reuse most things directly.

"copy connection snippet

I like it as an alternative to injecting a cell (even in regular lab), as it would make it work in different kinds of editors.

writing to the clipboard is easy on the web

easy-ish... but I usually prefer backstopping it with an (auto) selectable text box that shows the code, so that the old ctrl-c muscle memory works.

bollwyvl avatar Dec 03 '21 16:12 bollwyvl

That's awesome! If you wanted to make even a draft PR with what you have, I can give it a go.

minrk avatar Dec 08 '21 07:12 minrk