Skip to content

Commit

Permalink
check for windowing mode and turn it off if set to 'full' with a warn…
Browse files Browse the repository at this point in the history
…ing in console
  • Loading branch information
parmentelat committed Jun 7, 2024
1 parent c81e7a5 commit 5420e3a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,22 @@ It was preferred not to re-use the term 'split', because in jupyterlab _split_ a

Starting with jlab 4.2, the `windowingMode` setting in the `notebook` extension defaults to `full`
This setting enables [an optimized display algorithm](https://jupyterlab.readthedocs.io/en/stable/developer/performance.html#windowed-list), that currently **is incompatible with the `gridwidth`** extension
So as a short-term workaround, for using this extension, you can set this back to `none` in the `Settings Editor`, like so
So as a short-term workaround, for using this extension, you can set this back to `none` in the `Settings Editor`, see the illustration below

```{admonition} Important Note
:class: warning
Starting with 0.4.0, the extension will **silently change this setting for you**
Next releases will likely include a more user-friendly way to handle this
```

[see also this issue for more details](https://github.com/parmentelat/jupyterlab-gridwidth/issues/16)

```{image} README-windowing-mode.png
:align: center
:width: 600px
```

[see also this issue for more details](https://github.com/parmentelat/jupyterlab-gridwidth/issues/16)

```python

## Requirements
Expand Down
16 changes: 16 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ const plugin: JupyterFrontEndPlugin<void> = {
) => {
console.log('extension jupyterlab-gridwidth is activating')

// force notebook windowing-mode to 'none'
// unconditionally for now, will soon provide a less autocratic approach
settingRegistry.load('@jupyterlab/notebook-extension:tracker').then(
(nbSettings: ISettingRegistry.ISettings) => {
const former = nbSettings.get('windowingMode').composite as string
if (former === 'full') {
nbSettings.set('windowingMode', 'none'),
console.warn('jupyterlab-gridwidth: windowing mode TURNED OFF')
} else {
console.log(`jupyterlab-gridwidth: windowing mode already ${former} - unchanged`)
}
},
(err: Error) =>
console.error(`jupyterlab-gridwidth: Could not turn off windowing mode: ${err}`)
)

let command

// gridwidth-1-2..gridwidth-1-6
Expand Down

0 comments on commit 5420e3a

Please sign in to comment.