jupyterlab-filesystem-access
jupyterlab-filesystem-access copied to clipboard
Update to JupyterLab 3.4 and fix toolbar
Fix #31
This is currently not working properly, the issue with this code it that it "steals" the toolbar buttons from the main filebrowser. The toolbar buttons don't show up anymore on the main filebrowser, they show up only on our custom one.
Also the "New Launcher" button should not be there as it doesn't work properly with our filesystem API (not yet?)
the issue with this code it that it "steals" the toolbar buttons from the main filebrowser
Maybe this discussion on the original PR might help (haven't double checked the details yet): https://github.com/jupyterlab/jupyterlab/pull/12281#discussion_r836607047
@jtpio I'm reusing the changes proposed in this discussion indeed. Though it does not seem to behave the way we want.
I pushed another commit that seems to work. I couldn't make it work with a custom config without breaking the main Filebrowser.
The toolbar generator from settings schema is registering a transformation of the settings to build them by gathering definition from multiple extensions. When using the same helper on the same settings, it fails as it is forbidden to register multiple transform operators on the same plugin.
This definitely needs to be fixed. But as mentioned above, as some buttons are not valid for this file browser, it will be better to use this extension settings.
Problematic call:
https://github.com/jupyterlab/jupyterlab/blob/a41b9816fdedb936be1589dbc98363f62f5f4574/packages/apputils/src/toolbar/factory.ts#L109
@martinRenou I pushed a patch to use the settings to customize the toolbar. It is independent of the standard filebrowser toolbar definition, hence the additional code (+ the need to wait for an upstream fix in jupyterlab/jupyterlab#12556)
Thanks!
@martinRenou wondering if this is now unblocked now that JupyterLab 3.4.3 is out with the fix in https://github.com/jupyterlab/jupyterlab/pull/12556?
I'll give this another try tomorrow :)
Is this still an open issue? I've lost track of what's working where across JL3/4 "standard" and lite (and where I had things that were woking but unpinned they're starting to break in ways that are hard to track as I try to update them for the new academic year!)
Yes this is still needed.
This extension does not work with JupyterLab 4.
Aside from JL4, is this fixed in JL3 too? Or is the extension deprecated now for JLv3 latest?
Sorry I did not mean to close this. It is not fixed for JupyterLab 4 or 3.
There is an issue to update to JupyterLab 4: https://github.com/jupyterlab-contrib/jupyterlab-filesystem-access/issues/54
@fcollonval I'm trying to pick this up as part of https://github.com/jupyterlab-contrib/jupyterlab-filesystem-access/pull/55.
What would be the recommended way to define toolbar items via the setting system for this custom drive, so it doesn't conflict with the default filebrowser? This custom drive uses createFileBrowser
to instantiate a new file browser, should the configuration still reference FileBrowser
like the following?
"jupyter.lab.toolbars": {
"FileBrowser": [
{ "name": "open-folder", "rank": 0 }
]
}
Answering my own question: this is possible using a combination of setToolbar
and createToolbarFactory
.
I'll check if there are mentions to that in the JupyterLab docs and post them here. Or open an issue in JupyterLab otherwise.
I'll check if there are mentions to that in the JupyterLab docs and post them here
This is the relevant bit: https://jupyterlab.readthedocs.io/en/latest/extension/extension_points.html#generic-widget-with-toolbar