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

Default to the full windowing mode #7321

Merged
merged 17 commits into from
May 13, 2024
17 changes: 0 additions & 17 deletions packages/notebook-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,22 +563,6 @@ const editNotebookMetadata: JupyterFrontEndPlugin<void> = {
},
};

/**
* 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: [INotebookTracker],
activate: (app: JupyterFrontEnd, notebookTracker: INotebookTracker): void => {
notebookTracker.widgetAdded.connect((sender, widget) => {
widget.content['_viewModel'].windowingActive = false;
widget.content.notebookConfig.windowingMode = 'defer';
});
},
};

/**
* Export the plugins as default.
*/
Expand All @@ -592,7 +576,6 @@ const plugins: JupyterFrontEndPlugin<any>[] = [
scrollOutput,
tabIcon,
trusted,
windowing,
];

export default plugins;
35 changes: 8 additions & 27 deletions packages/notebook-extension/style/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ body[data-notebook='notebooks'] .jp-WindowedPanel-outer {

body[data-notebook='notebooks'] .jp-WindowedPanel-inner {
margin-top: var(--jp-notebook-toolbar-margin-bottom);
/* Adjustments for the extra top and bottom notebook padding */
margin-bottom: calc(4 * var(--jp-notebook-padding));
}

body[data-notebook='notebooks'] .jp-Notebook-cell {
Expand All @@ -52,12 +54,6 @@ 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 All @@ -70,18 +66,6 @@ body[data-notebook='notebooks']
background: var(--jp-layout-color0) !important;
}

/**
Extra padding to the first and and last cell of the notebook.
TODO: revisit when https://github.com/jupyterlab/jupyterlab/issues/13151 is fixed
*/
.jp-Notebook-cell[data-windowed-list-index='0'] {
padding-top: calc(2 * var(--jp-notebook-padding));
}

body[data-notebook='notebooks'] .jp-WindowedPanel-viewport > *:last-child {
padding-bottom: calc(2 * var(--jp-notebook-padding));
}

body[data-notebook='notebooks']
.jp-Notebook
.jp-Notebook-cell:not(:first-child)::before {
Expand Down Expand Up @@ -124,9 +108,9 @@ body[data-notebook='notebooks']

/* Tweak the notebook footer (to add a new cell) */
body[data-notebook='notebooks'] .jp-Notebook-footer {
background: unset;
width: 100%;
margin-left: unset;
background: unset;
}

/* Mobile View */
Expand All @@ -143,21 +127,18 @@ body[data-format='mobile'] .jp-ToolbarButton .jp-DebuggerBugButton {
display: none;
}

/* Virtual Notebook fixes */

body[data-notebook='notebooks'] .jp-WindowedPanel-viewport {
background: var(--jp-layout-color0);
box-shadow: var(--jp-elevation-z4);
padding: unset;

/* Extra padding at the top and bottom so the notebook looks nicer */
padding-top: calc(2 * var(--jp-notebook-padding));
padding-bottom: calc(2 * var(--jp-notebook-padding));
}

/* Notebook box shadow */

body[data-notebook='notebooks']
.jp-WindowedPanel-outer
> *:first-child:not(:last-child) {
box-shadow: var(--jp-elevation-z4);
}

body[data-notebook='notebooks']
.jp-Notebook
> *:first-child:last-child::before {
Expand Down
3 changes: 3 additions & 0 deletions ui-tests/test/general.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ test.describe('General', () => {
// hover somewhere else to make the add cell disappear
await page.hover('#jp-top-bar');

// click to make the blue border around the cell disappear
await page.click('.jp-WindowedPanel-outer');

// special case for firefox headless issue
// see https://github.com/jupyter/notebook/pull/6872#issuecomment-1549594166 for more details
if (browserName === 'firefox') {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/test/mobile.spec.ts-snapshots/notebook-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading