-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Open
Labels
Milestone
Description
Follow-up to #6888
#6888 added a few patches to be able to know when the file browser selected items change:
notebook/packages/tree-extension/src/index.ts
Lines 139 to 153 in fd45f31
// TODO: use upstream signal when available to detect selection changes | |
// https://github.com/jupyterlab/jupyterlab/issues/14598 | |
const selectionChanged = new Signal<FileBrowser, void>(browser); | |
const methods = [ | |
'_selectItem', | |
'_handleMultiSelect', | |
'handleFileSelect', | |
] as const; | |
methods.forEach((method: (typeof methods)[number]) => { | |
const original = browser['listing'][method]; | |
browser['listing'][method] = (...args: any[]) => { | |
original.call(browser['listing'], ...args); | |
selectionChanged.emit(void 0); | |
}; | |
}); |
Ideally there should be a built-in signal emitted when this is the case. Tracked upstream in jupyterlab/jupyterlab#14598.
For this issue to be solved jupyterlab/jupyterlab#14598 would first have to be fixed and released in JupyterLab, so Notebook 7 can be updated with the latest versions of the packages.