notebook
notebook copied to clipboard
[7.1.0a0+] Default file browser writes to a custom drive if installed
Testing with:
7.1.0a0,7.1.0a1or7.1.0a2(or newer)- A custom drive, for example https://github.com/jupyterlab/jupyterlab-github/
The default file browser on the tree page tries to create files and directories in the installed drive, instead of the default file browser:
Looking more closely, the model seems to be pointing to the custom drive (GitHub:)
This is not an issue with 7.0.6, so this is likely related to a change in the JupyterLab 4.1 pre-releases, or in some PRs targeting Notebook 7.1.
Also this does not appear to be an issue in JupyterLab:
This could be related to an upstream change w.r.t focus handling, as first clicking on the file browser widget and then creating the new directory seems to be fine:
In the related command for creating a new directory, the file browser tracker currentWidget seems to be set to the custom drive (in this case the GitHub: drive):
https://github.com/jupyterlab/jupyterlab/blob/07b93390cf74fbf14d3a1dac3f662fdb4664afed/packages/filebrowser-extension/src/index.ts#L1143-L1147
const widget = tracker.currentWidget;
if (widget) {
return widget.createNewDirectory();
}
Looking more into it, and setting a handler for the tracker currentChanged signal:
const { tracker } = factory;
tracker.currentChanged.connect(() => {
console.log('current changed');
});
The underlying file browser tracker only seems to update its currentWidget when actively clicking on the widget themselves (clicking on the tab is not enough):
This was mitigated in https://github.com/jupyter/notebook/pull/7224.
Moving to 7.1.x, in case this gets fixed upstream in JupyterLab: https://github.com/jupyterlab/jupyterlab/issues/15629