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

A side panel to display information from all kernels and extensions #4411

Closed
BoPeng opened this issue Apr 18, 2018 · 2 comments
Closed

A side panel to display information from all kernels and extensions #4411

BoPeng opened this issue Apr 18, 2018 · 2 comments
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.

Comments

@BoPeng
Copy link
Contributor

BoPeng commented Apr 18, 2018

A kernel or extension might need to display some information that is not part of the document, which are nonpersistent but not as transient as inspection results. For example,

  • The preview feature of SoS Notebook displays the "preview" of variables and files until it is overwritten by some other events. These previews are very helpful for interactive data analysis but are not part of the notebook. It is a bit similar to inspection but is much more flexible and can contain figures and tables that users can interact with (e.g. sort and search a table). Note that SoS provides automatic preview (e.g. preview a after stepping through a=1), which makes line-by-line execution a lot more useful.
  • The %taskinfo magic of sos displays information of remote tasks. This magic is SoS-specific but I am sure many other kernels/extensions have similar state/progress information to display.

I am therefore proposing a universal side panel that displays inspection results and information from all kernels and extensions. More specifically,

  1. The panel has an "input" for type of information and "output" for results.
  2. The content of the panel will be persistent until it is overwritten by next info.
  3. An API is provided for extensions to send information to this panel for display. An extension cannot update or interact with displayed information because there is no guarantee of the lifetime of the information.
  4. (Later) Add an information message type that a kernel can utilize to send information to the frontend as side effects of cell execution.

Note 1: I am not quite sure if there is a need to display the "source" of information, or what to do when users switch kernel. I tend to keep the panel simple by ignoring sources and kernel-switch events because the panel is updated by user-actions (e.g. inspect, execute a cell or a magic) and the information in the panel can be used beyond the current notebook.

Note 2. If a TOC belongs to this panel conceptually, perhaps @ian-r-rose can add his jupyterlab-toc as a button or subpanel to this panel.

Note 3: There have already been a Shift-Tab tooltip and a inspector panel, and it would be awkward to add another mechanism. I therefore believe that it is better to consolidate all these into a single panel and put it to a more prominent location (side panel). That is to say, we

  1. Move the inspector panel to the side panel as a tab named "inspect" (but it is ok to keep it as a panel because a panel has more flexible placement options).
  2. Shift-Tab will send inspect information to this panel (switch to it if needed)
  3. Add a "play/pause" button to enable/disable continuous inspection while user types. (I personally dislike the continuous update mode, see my comment in Inspector improvements #2826)
  4. Add API to allow extensions/kernels to send information to this panel proactively.
@BoPeng BoPeng changed the title A side panel for inspection results and information from all kernels and extensions A side panel to display information from all kernels and extensions Apr 19, 2018
@BoPeng
Copy link
Contributor Author

BoPeng commented Apr 20, 2018

screen shot 2018-04-19 at 9 35 57 pm

Proposal:

  1. Inspector goes to the side panel and will always be available
  2. The header bar has a button/switch that enables/disables continuous update (default to off). When this button is switched on, the panel will be updated with inspection results while typing. More buttons could be added, for example, to display a TOC.
  3. The input box shows what is being displayed. Users could input items to inspect (e.g. help message)
  4. Shift-Tab will send inspection result to this panel instead of showing a tooltip.
  5. Kernels/extensions can send information to this panel.

Note: As soon as we allow users to input items to inspect (e.g. variable var), users would input expressions (e.g. var**2) and expect to see results. It is only natural to turn this panel to a real cell like what SoS' side panel provides. This cell could also be used for line-by-line execution (PR4330 currently sends the code to console window), and help resolve the dilemma discussed in #4424. I would recommend anyone who is interested in such a multi-purpose panel to visit SoS website, click the rocket button at the top right corner of the page, open an example in the examples directory or create a notebook with SoS kernel, and try to enter expressions in the side panel and use 'Ctrl-Shift-Enter' to send code from notebook to side panel.

@BoPeng
Copy link
Contributor Author

BoPeng commented May 3, 2018

Invalidated by #4503, will create a new ticket with another design.

@BoPeng BoPeng closed this as completed May 3, 2018
@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Aug 9, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

No branches or pull requests

1 participant