Skip to content

Commit f5d8aea

Browse files
Default to the full windowing mode (#7321)
* Remove custom windowing plugin * remove full css workaround * update ref snapshots * fix CSS for the full mode * update css * lint * update UI tests * Update Playwright Snapshots * Update Playwright Snapshots * update mobile ui test * update locator * Update Playwright Snapshots * Update Playwright Snapshots * update ui test * update ui tests * Update Playwright Snapshots * Update Playwright Snapshots --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent b180848 commit f5d8aea

File tree

7 files changed

+11
-44
lines changed

7 files changed

+11
-44
lines changed

packages/notebook-extension/src/index.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -563,22 +563,6 @@ const editNotebookMetadata: JupyterFrontEndPlugin<void> = {
563563
},
564564
};
565565

566-
/**
567-
* A plugin to set the default windowing mode to defer for the notebook
568-
* TODO: remove?
569-
*/
570-
const windowing: JupyterFrontEndPlugin<void> = {
571-
id: '@jupyter-notebook/notebook-extension:windowing',
572-
autoStart: true,
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-
});
579-
},
580-
};
581-
582566
/**
583567
* Export the plugins as default.
584568
*/
@@ -592,7 +576,6 @@ const plugins: JupyterFrontEndPlugin<any>[] = [
592576
scrollOutput,
593577
tabIcon,
594578
trusted,
595-
windowing,
596579
];
597580

598581
export default plugins;

packages/notebook-extension/style/base.css

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ body[data-notebook='notebooks'] .jp-WindowedPanel-outer {
3737

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

4244
body[data-notebook='notebooks'] .jp-Notebook-cell {
@@ -52,12 +54,6 @@ body[data-notebook='notebooks']
5254
min-height: 100px;
5355
}
5456

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

6359
body[data-notebook='notebooks'] .jp-WindowedPanel-outer > * {
@@ -70,18 +66,6 @@ body[data-notebook='notebooks']
7066
background: var(--jp-layout-color0) !important;
7167
}
7268

73-
/**
74-
Extra padding to the first and and last cell of the notebook.
75-
TODO: revisit when https://github.com/jupyterlab/jupyterlab/issues/13151 is fixed
76-
*/
77-
.jp-Notebook-cell[data-windowed-list-index='0'] {
78-
padding-top: calc(2 * var(--jp-notebook-padding));
79-
}
80-
81-
body[data-notebook='notebooks'] .jp-WindowedPanel-viewport > *:last-child {
82-
padding-bottom: calc(2 * var(--jp-notebook-padding));
83-
}
84-
8569
body[data-notebook='notebooks']
8670
.jp-Notebook
8771
.jp-Notebook-cell:not(:first-child)::before {
@@ -124,9 +108,9 @@ body[data-notebook='notebooks']
124108

125109
/* Tweak the notebook footer (to add a new cell) */
126110
body[data-notebook='notebooks'] .jp-Notebook-footer {
111+
background: unset;
127112
width: 100%;
128113
margin-left: unset;
129-
background: unset;
130114
}
131115

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

146-
/* Virtual Notebook fixes */
147-
148130
body[data-notebook='notebooks'] .jp-WindowedPanel-viewport {
149131
background: var(--jp-layout-color0);
132+
box-shadow: var(--jp-elevation-z4);
150133
padding: unset;
134+
135+
/* Extra padding at the top and bottom so the notebook looks nicer */
136+
padding-top: calc(2 * var(--jp-notebook-padding));
137+
padding-bottom: calc(2 * var(--jp-notebook-padding));
151138
}
152139

153140
/* Notebook box shadow */
154141

155-
body[data-notebook='notebooks']
156-
.jp-WindowedPanel-outer
157-
> *:first-child:not(:last-child) {
158-
box-shadow: var(--jp-elevation-z4);
159-
}
160-
161142
body[data-notebook='notebooks']
162143
.jp-Notebook
163144
> *:first-child:last-child::before {

ui-tests/test/general.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ test.describe('General', () => {
4343
// hover somewhere else to make the add cell disappear
4444
await page.hover('#jp-top-bar');
4545

46+
// click to make the blue border around the cell disappear
47+
await page.click('.jp-WindowedPanel-outer');
48+
4649
// special case for firefox headless issue
4750
// see https://github.com/jupyter/notebook/pull/6872#issuecomment-1549594166 for more details
4851
if (browserName === 'firefox') {
60 Bytes
Loading
47 Bytes
Loading
83 Bytes
Loading
-9.77 KB
Loading

0 commit comments

Comments
 (0)