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

Deprecate the extension for JupyterLab 4.0 #81

Closed
jtpio opened this issue May 17, 2022 · 12 comments · Fixed by #92
Closed

Deprecate the extension for JupyterLab 4.0 #81

jtpio opened this issue May 17, 2022 · 12 comments · Fixed by #92
Labels
enhancement New feature or request

Comments

@jtpio
Copy link
Member

jtpio commented May 17, 2022

JupyterLab 4.0 will have support for customizing top bar items via the settings: jupyterlab/jupyterlab#12586

We should then deprecate this extension, and link to the JupyterLab documentation.

After JupyterLab 4.0 is released, we can then archive this repository as well.

@jtpio jtpio added the enhancement New feature or request label May 17, 2022
@mahendrapaipuri
Copy link
Member

@jtpio I have been trying to migrate these extensions to JupyterLab 4 without a lot of luck. For simple commands, I noticed that I can define my custom commands and then add it to TopBar settings as

"jupyter.lab.toolbars": {
    "TopBar": [
      {
        "name": "Custom Command",
        "command": "mycustomnamespace:my-custom-command",
        "rank": 1000
      }
    ]
  },

But how can I add widgets to TopBar toolbar? For instance, if I want to migrate theme-toggler, how can I add the React Widget to the TopBar toolbar? Any help would be appreciated. Cheers!!

@jtpio
Copy link
Member Author

jtpio commented Jun 14, 2023

Thanks @mahendrapaipuri.

Maybe we could try to have a look at https://github.com/jtpio/jupyterlab-theme-toggle to migrate the extension to JupyterLab 4, which would serve as a good example?

@jtpio
Copy link
Member Author

jtpio commented Jun 14, 2023

Just opened jtpio/jupyterlab-theme-toggle#22

@mahendrapaipuri
Copy link
Member

Cheers @jtpio for coming back. I have been trying to do exactly the same thing. Just to give you a bit of the context, I have created few topbar buttons which are simple hyperlinks like Logout button. And defining them in settings will render these buttons neatly in the JupyterLab.

The theme-toggler that you did is effectively a Switch widget and you are adding that widget to topbar explicitly. The thing that is not clear for me how can we add this widget to the new topbar extension? From my understanding, the new topbar extension execute commands and render either a name or icon in the frontend. The theme-toggler, however, is an interactive widget and I am not able to figure out how can I add it to the topbar!!

@jtpio
Copy link
Member Author

jtpio commented Jun 14, 2023

Thanks @mahendrapaipuri for looking into this!

I think a good example would be the checkpoint indicator in Notebook 7, which is like a custom component:

image

A plugin defines a new toolbar factory called checkpoint here: https://github.com/jupyter/notebook/blob/33a383d3f857b4de0da10892121de7bd4d932162/packages/notebook-extension/src/index.ts#L83-L90

Which is then used here: https://github.com/jupyter/notebook/blob/33a383d3f857b4de0da10892121de7bd4d932162/packages/notebook-extension/schema/checkpoints.json#L4-L6

For the theme toggle extension, the toolbar factory would return the Switch widget.

@mahendrapaipuri
Copy link
Member

Sweet! Cheers @jtpio. I will look into that example and try to implement theme toggler and let you know. Thanks again!!

@mahendrapaipuri
Copy link
Member

@jtpio Worked beautifully. Cheers! I will put up a PR in theme-toggler repo soonish.

Do you think we can create a monorepo for topbar-text, logout-button and theme-toggler as they are very similar?

@jtpio
Copy link
Member Author

jtpio commented Jun 15, 2023

Do you think we can create a monorepo for topbar-text, logout-button and theme-toggler as they are very similar?

Good question. Initially they were all in a monorepo, but then split into multiple repos. Having multiple repos does add maintenance effort for sure.

But since they are similar, it would indeed make sense to put them back in a monorepo, as long as the extensions can be installed individually by end users. For reference the renderer extensions for JupyterLab are also in a monorepo: https://github.com/jupyterlab/jupyter-renderers

@mahendrapaipuri
Copy link
Member

Alright. I will work on it in the coming weeks. Would you create a new repo to host these extensions or use an existing one?

@jtpio
Copy link
Member Author

jtpio commented Jun 16, 2023

Or we bring everything back in this repo instead of archiving it, and update the description of the repo:

"jupyterlab-topbar is a collection of components for the JupyterLab Top Area"

But still removing the jupyterlab-topbar-extension and jupyterlab-topbar extensions currently in https://github.com/jupyterlab-contrib/jupyterlab-topbar/tree/main/packages.

@mahendrapaipuri
Copy link
Member

I agree, that makes sense. Cheers @jtpio for the help. I will work on the PR.

@jtpio
Copy link
Member Author

jtpio commented Jun 16, 2023

That would be perfect, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants