Skip to content

Conversation

@afshin
Copy link
Member

@afshin afshin commented Jan 24, 2023

This PR:

  • Updates the notebook:create-new command to support passing in an optional kernelId to create a new notebook that uses an existing kernel instance.
  • Adds a context menu to the kernels pane in the running sidebar that allows users to:
    • Create a new code console for the given kernel
    • Create a new notebook for the given kernel
    • Switch to an existing session connection for the given kernel
    • Shut down the given kernel
  • Adds a collapsible list of connected sessions beneath each kernel in the running kernels pane
  • Displays the icon in the kernel spec's resources instead of displaying the Jupyter icon when possible

References

Code changes

User-facing changes

running.kernels.mov

Backwards-incompatible changes

N/A

@afshin afshin added this to the 4.0.0 milestone Jan 24, 2023
@afshin afshin self-assigned this Jan 24, 2023
@jupyterlab-probot
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

@jupyterlab jupyterlab deleted a comment from github-actions bot Jan 25, 2023
@afshin afshin closed this Jan 25, 2023
@afshin afshin reopened this Jan 25, 2023
@afshin
Copy link
Member Author

afshin commented Jan 25, 2023

bot please update documentation snapshots

@github-actions
Copy link
Contributor

Documentation snapshots updated.

@afshin afshin marked this pull request as ready for review January 25, 2023 19:08
@afshin
Copy link
Member Author

afshin commented Jan 25, 2023

bot please update snapshots

@github-actions
Copy link
Contributor

Documentation snapshots updated.

@afshin afshin closed this Jan 25, 2023
@afshin afshin reopened this Jan 25, 2023
@afshin
Copy link
Member Author

afshin commented Jan 27, 2023

@fcollonval, thanks for the review!

The only place I'm finding a selector in the docs is for #jp-running-sessions, which still exists. I think I am not looking in the right place 🫤

@jtpio
Copy link
Member

jtpio commented Jan 27, 2023

Thanks @afshin for working on this!

I just tried the latest changes on this branch it's looking good.

Quick question: should a new console started with "New Console for Notebook" also be listed under the kernel? Similar to when a separate console is started and then its kernel changed to an existing one:

kernel-console.mp4

@afshin
Copy link
Member Author

afshin commented Jan 27, 2023

@jtpio yeah I noticed that too. I think because I'm only giving the create console command a kernel ID, it's generating a new Jupyter session (again, such a confusing name for this concept) whereas the one from the notebook's context menu must be passing more info, maybe the session ID or a path.

What do you think the behavior should be? I think it should appear in the list as well. But I don't know if there is a counterargument against that position.

@jtpio
Copy link
Member

jtpio commented Jan 27, 2023

I think it should appear in the list as well.

Same here. In the example above I would expect the new console started from the Untitled.ipynb notebook to also be listed under the kernel, with Untitled.ipynb as the name and with the console icon.

@fcollonval
Copy link
Member

The only place I'm finding a selector in the docs is for #jp-running-sessions, which still exists. I think I am not looking in the right place 🫤

To fix some tests with the first PR, I changed some selectors to use the text content (it is considered better for integration tests). There are two places:

await page.locator('text="Python 3 (ipykernel) {1}"').waitFor();

await expect(page.locator('text="Python 3 (ipykernel) {1}"')).toHaveCount(

As now the text is Python 3 (ipykernel), it is similar to the text use in the kernel status of the notebook. So the selector should be something like:

page.locator('#jp-running-sessions >> text="Python 3 (ipykernel)"')

If you want to read more about the selection in playwright, the doc is over there

@afshin
Copy link
Member Author

afshin commented Jan 27, 2023

bot please update snapshots

@github-actions
Copy link
Contributor

Documentation snapshots updated.

@afshin afshin closed this Jan 27, 2023
@afshin afshin reopened this Jan 27, 2023
@fcollonval
Copy link
Member

bot please update documentation snapshots

@github-actions
Copy link
Contributor

Documentation snapshots updated.

Copy link
Member

@fcollonval fcollonval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @afshin

@jtpio
Copy link
Member

jtpio commented Feb 6, 2023

Looks good, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants