Skip to content

Commit

Permalink
For notebook windowing mode to defer
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Apr 19, 2024
1 parent 20243fc commit 56f85cd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
25 changes: 8 additions & 17 deletions packages/notebook-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,27 +564,18 @@ const editNotebookMetadata: JupyterFrontEndPlugin<void> = {
};

/**
* A plugin to set the default windowing mode for the notebook
* TODO: remove
* A plugin to set the default windowing mode to defer for the notebook
* TODO: remove?
*/
const windowing: JupyterFrontEndPlugin<void> = {
id: '@jupyter-notebook/notebook-extension:windowing',
autoStart: true,
requires: [ISettingRegistry],
activate: (app: JupyterFrontEnd, settingRegistry: ISettingRegistry): void => {
// default to `none` to avoid notebook rendering glitches
const settings = settingRegistry.load(
'@jupyterlab/notebook-extension:tracker'
);
Promise.all([settings, app.restored])
.then(([settings]) => {
if (settings.user.windowing === undefined) {
void settings.set('windowingMode', 'defer');
}
})
.catch((reason: Error) => {
console.error(reason.message);
});
requires: [INotebookTracker],
activate: (app: JupyterFrontEnd, notebookTracker: INotebookTracker): void => {
notebookTracker.widgetAdded.connect((sender, widget) => {
widget.content['_viewModel'].windowingActive = false;
widget.content.notebookConfig.windowingMode = 'defer';
});
},
};

Expand Down
6 changes: 6 additions & 0 deletions packages/notebook-extension/style/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ body[data-notebook='notebooks']
min-height: 100px;
}

/* Workaround for disabling the full windowing mode */
body[data-notebook='notebooks']
.jp-Toolbar-item[data-jp-item-name='scrollbar'] {
display: none;
}

/* Fix background colors */

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

0 comments on commit 56f85cd

Please sign in to comment.