diff --git a/packages/notebook-extension/src/index.ts b/packages/notebook-extension/src/index.ts index 9a9e08e95c..0ba7340cfe 100644 --- a/packages/notebook-extension/src/index.ts +++ b/packages/notebook-extension/src/index.ts @@ -563,22 +563,6 @@ const editNotebookMetadata: JupyterFrontEndPlugin = { }, }; -/** - * A plugin to set the default windowing mode to defer for the notebook - * TODO: remove? - */ -const windowing: JupyterFrontEndPlugin = { - 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. */ @@ -592,7 +576,6 @@ const plugins: JupyterFrontEndPlugin[] = [ scrollOutput, tabIcon, trusted, - windowing, ]; export default plugins; diff --git a/packages/notebook-extension/style/base.css b/packages/notebook-extension/style/base.css index 66d7a9a588..db3657c902 100644 --- a/packages/notebook-extension/style/base.css +++ b/packages/notebook-extension/style/base.css @@ -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 { @@ -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 > * { @@ -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 { @@ -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 */ @@ -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 { diff --git a/ui-tests/test/general.spec.ts b/ui-tests/test/general.spec.ts index f4225084a3..5efd76ad24 100644 --- a/ui-tests/test/general.spec.ts +++ b/ui-tests/test/general.spec.ts @@ -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') { diff --git a/ui-tests/test/general.spec.ts-snapshots/notebook-chromium-linux.png b/ui-tests/test/general.spec.ts-snapshots/notebook-chromium-linux.png index 494483f5ac..47280a321e 100644 Binary files a/ui-tests/test/general.spec.ts-snapshots/notebook-chromium-linux.png and b/ui-tests/test/general.spec.ts-snapshots/notebook-chromium-linux.png differ diff --git a/ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png b/ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png index e258b5cb39..0be6bd94d8 100644 Binary files a/ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png and b/ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png differ diff --git a/ui-tests/test/mobile.spec.ts-snapshots/notebook-chromium-linux.png b/ui-tests/test/mobile.spec.ts-snapshots/notebook-chromium-linux.png index 1e40aa4ea0..9a143454eb 100644 Binary files a/ui-tests/test/mobile.spec.ts-snapshots/notebook-chromium-linux.png and b/ui-tests/test/mobile.spec.ts-snapshots/notebook-chromium-linux.png differ diff --git a/ui-tests/test/mobile.spec.ts-snapshots/notebook-firefox-linux.png b/ui-tests/test/mobile.spec.ts-snapshots/notebook-firefox-linux.png index b5b71b35ea..4d72dfc1cb 100644 Binary files a/ui-tests/test/mobile.spec.ts-snapshots/notebook-firefox-linux.png and b/ui-tests/test/mobile.spec.ts-snapshots/notebook-firefox-linux.png differ