notebook icon indicating copy to clipboard operation
notebook copied to clipboard

Edit notebook metadata

Open jtpio opened this issue 3 years ago • 3 comments

Problem

In the classic notebook it's possible to edit the notebook metadata:

image

image

Proposed Solution

We add a new plugin to replicate that UX and let users edit notebook metadata in a dialog.

Additional context

In JupyterLab the notebook tools is in the right area:

image

jtpio avatar Nov 03 '21 15:11 jtpio

Marking as a good first issue in case someone would like to take it, thanks!

jtpio avatar Nov 03 '21 16:11 jtpio

The new plugin could go the notebook-extension package: https://github.com/jupyterlab/retrolab/blob/main/packages/notebook-extension/src/index.ts

That file already has some places showing how to retrieve the current notebook. which can serve as an example.

jtpio avatar Nov 03 '21 16:11 jtpio

Hi! Can I try this one?

jaivanti avatar Sep 11 '22 18:09 jaivanti

Hi there! I would like to work on this issue. Can you please assign this issue to me!

ajjayymahato avatar Sep 25 '22 19:09 ajjayymahato

Just checking if anybody is still working on this

kostyafarber avatar Nov 18 '22 20:11 kostyafarber

@kostyafarber I don't think anyone is still working on this so if you want to have a look that would be great, thanks!

In the meantime there has been some work on adding support for (hidden by default) left and right panels:

image

The notebook metadata can be edited there, but there could also be the popup like the classic notebook so it's easier to find.

jtpio avatar Nov 21 '22 07:11 jtpio

Hey @jtpio I would like to try and solve this issue, can you please assign it to me?

ShobhanSrivastava avatar Dec 21 '22 18:12 ShobhanSrivastava

Thanks @ShobhanSrivastava.

I guess it could still make sense to implement the dialog to edit the notebook metadata to keep the same UX as with the classic notebook.

cc @brichet in case you have an input on this, since this might also be related to some upstream work in JupyterLab.

jtpio avatar Dec 22 '22 13:12 jtpio

I think we should use the existing MetadataEditor from Notebooktools. It could be extended into a new object that is displayed in a Dialog.

For example, I started to extend the MetadataEditor for an unrelated purpose in JupyterLab here.

brichet avatar Jan 02 '23 09:01 brichet

Maybe the simplest way for now would be to add a Edit Notebook Metadata command to the menu that would open the Notebook tools panel instead of a dialog.

jtpio avatar Jun 09 '23 06:06 jtpio

test

LornaJoyce avatar Aug 27 '23 17:08 LornaJoyce

Hi @jtpio I would like to try and solve the issue if it still persists.

abidkhan484 avatar Aug 29 '23 17:08 abidkhan484

Sure thanks @abidkhan484.

Feel free to open a Pr any time. Probably the suggestion from https://github.com/jupyter/notebook/issues/6402#issuecomment-1584042586 would be enough for now.

jtpio avatar Aug 29 '23 17:08 jtpio

Hi @jtpio I am new in open source contribution. I have read the contributing.md file. Can you please guide me regarding these?

  1. What is the Git branch strategy that I should follow? From which branch I should create a new one?
  2. Is there any guidance on which part I may update? If I am not wrong, it's maybe on the front end (UI).
  3. Is there any other suggestion for me as a newcomer?

abidkhan484 avatar Aug 30 '23 04:08 abidkhan484

What is the Git branch strategy that I should follow? From which branch I should create a new one?

You would first need to fork the repository on GitHub:

image

Then you can create a new branch on your fork. Once ready, you can open a PR against the main branch of the jupyter/notebook repo.

Is there any guidance on which part I may update? If I am not wrong, it's maybe on the front end (UI).

Yes, it should be a frontend only change. If we stick to just adding the menu entry as suggested above, then it mostly means adding a new setting file here to add the entry to the menu: https://github.com/jupyter/notebook/tree/main/packages/notebook-extension/schema

Is there any other suggestion for me as a newcomer?

If you would like to, you could also use Gitpod as an alternative to setting up a development environment locally.

jtpio avatar Aug 31 '23 14:08 jtpio

Hi, It looks like the issue is still not resolved and I guess no one is working on it. I'd like to take this up and close it asap, only a month before it turns two! So, maybe, you can assign this to me. Progress so far: I cloned the repo, only to realize the frontend code is no more within the notebook and shifted under jupyterlab. I understood I have to work on the frontend, specifically add an option under the Edit menu which on clicking will trigger same functionality as Right Sidebar option in View (probably, along with uncollapsing the Application tools too). Well, honestly, I am having a hard time understanding the code (jupyterlab, especially the structure). I started with project-wide searching 'Clear Outputs of All Cells' (just another option under Edit menu), to quickly understand the call-stack and it didn't help much. Maybe, you can help me out for it to get quicker, or else, I'll spend some time, sit focused, and try.

Dilip-Jain avatar Oct 02 '23 13:10 Dilip-Jain

Thanks @Dilip-Jain for looking into this :+1:

You can see the Notebook 7 application as a JupyterLab remix. This means the frontend reuses many JupyterLab plugins and extensions, and reassemble them in a different way to create this document-oriented notebook UI.

So most of the commands are inherited from JupyterLab. You can do a text search on the JupyterLab repo to find some hints: https://github.com/jupyterlab/jupyterlab. The documentation also lists the available in JupyterLab: https://jupyterlab.readthedocs.io/en/latest/user/commands.html#commands-list. Although in the case of Notebook 7 only a subset of the commands are available.

One way to start on this issue would be to have a look at how existing commands can be added as menu items to the Notebook 7 interface. For example the application extension uses the settings system to re-order the menu entries:

https://github.com/jupyter/notebook/blob/b397a3b834e6cf2e79e40ba9e1068abf97611192/packages/application-extension/schema/menus.json#L4-L75

jtpio avatar Oct 02 '23 14:10 jtpio

As a side note it would indeed be useful to expand the existing contributing guide to explain how Notebook 7 reuses JupyterLab plugins and extensions: https://jupyter-notebook.readthedocs.io/en/latest/contributing.html

jtpio avatar Oct 02 '23 14:10 jtpio

Hello everyone, I'm working on this issue on and off for a while for a college class. I've managed to change some stuff around in the menus.json file and thought I was almost done, just needed to add an option with a command to show the Notebook Tools panel as suggested. The thing is, when I run ctrl+shift+c and the command palette pops us, there's the "Show Notebook Tools" command easily, but I cannot find it in the commands page. Can I have any guidance? Thanks

joaovml avatar Oct 08 '23 17:10 joaovml

Hi @joaovml, what you are looking for is an application command application:toggle-right-area with arguments, particularly, side (right), title (Show Notebook Tools), and id (notebook-tools) passed as args.

Unfortunately, I didn't know you were working on the issue, and since the issue was inactive for quite a long duration, I picked it up last week and started working on it. I just created a pull request and realized you too were working on this.

Dilip-Jain avatar Oct 09 '23 16:10 Dilip-Jain

Hi @Dilip-Jain ! No problem, I hadn't mentioned anything here. Your solution will be great in helping me understand a bit better how the code works and hopefully I'll be able to contribute somewhere else.

joaovml avatar Oct 10 '23 13:10 joaovml

Good luck @joaovml

Dilip-Jain avatar Oct 13 '23 15:10 Dilip-Jain

Hey @jtpio, if you can please check the pull request I made to close this issue. Although, it is missing some "prettiness" and failing some other test cases, it totally works as expected. Help!

Dilip-Jain avatar Oct 13 '23 15:10 Dilip-Jain

Hi is there anyone still working on this? Would like to delve into this

stevearmstrong-dev avatar Jan 19 '24 19:01 stevearmstrong-dev

Hey @W0474997SteveArmstrong, I have already created a pull request for this enhancement. The only task left is adding the menu entry via the settings defined in the schema folder dropping the dependency on IMainMenu in the plugin. Not sure why, but I am unable to achieve this shift. I'll try, you can too, and feel free to push to my fork.

Dilip-Jain avatar Feb 04 '24 11:02 Dilip-Jain