Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force notebook windowing mode to defer #7335

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading