Skip to content

Commit b45d666

Browse files
authored
For notebook windowing mode to defer (#7335)
1 parent 20243fc commit b45d666

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

packages/notebook-extension/src/index.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -564,27 +564,18 @@ const editNotebookMetadata: JupyterFrontEndPlugin<void> = {
564564
};
565565

566566
/**
567-
* A plugin to set the default windowing mode for the notebook
568-
* TODO: remove
567+
* A plugin to set the default windowing mode to defer for the notebook
568+
* TODO: remove?
569569
*/
570570
const windowing: JupyterFrontEndPlugin<void> = {
571571
id: '@jupyter-notebook/notebook-extension:windowing',
572572
autoStart: true,
573-
requires: [ISettingRegistry],
574-
activate: (app: JupyterFrontEnd, settingRegistry: ISettingRegistry): void => {
575-
// default to `none` to avoid notebook rendering glitches
576-
const settings = settingRegistry.load(
577-
'@jupyterlab/notebook-extension:tracker'
578-
);
579-
Promise.all([settings, app.restored])
580-
.then(([settings]) => {
581-
if (settings.user.windowing === undefined) {
582-
void settings.set('windowingMode', 'defer');
583-
}
584-
})
585-
.catch((reason: Error) => {
586-
console.error(reason.message);
587-
});
573+
requires: [INotebookTracker],
574+
activate: (app: JupyterFrontEnd, notebookTracker: INotebookTracker): void => {
575+
notebookTracker.widgetAdded.connect((sender, widget) => {
576+
widget.content['_viewModel'].windowingActive = false;
577+
widget.content.notebookConfig.windowingMode = 'defer';
578+
});
588579
},
589580
};
590581

packages/notebook-extension/style/base.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ body[data-notebook='notebooks']
5151
min-height: 100px;
5252
}
5353

54+
/* Workaround for disabling the full windowing mode */
55+
body[data-notebook='notebooks']
56+
.jp-Toolbar-item[data-jp-item-name='scrollbar'] {
57+
display: none;
58+
}
59+
5460
/* Fix background colors */
5561

5662
body[data-notebook='notebooks'] .jp-WindowedPanel-outer > * {

0 commit comments

Comments
 (0)