Skip to content

Commit 9b5cd02

Browse files
authored
Backport PR #14063 on branch 3.6.x (Fix non-document wide undo stack) (#14162)
* Backport PR #14063: Fix non-document wide undo stack * Bump jupyter-ydoc to ~0.2.3 * Lint
1 parent 4673a47 commit 9b5cd02

File tree

19 files changed

+43
-29
lines changed

19 files changed

+43
-29
lines changed

dev_mode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"watch": "webpack --watch"
1717
},
1818
"resolutions": {
19-
"@jupyter/ydoc": "~0.2.0",
19+
"@jupyter/ydoc": "~0.2.3",
2020
"@jupyterlab/application": "~3.6.1",
2121
"@jupyterlab/application-extension": "~3.6.1",
2222
"@jupyterlab/apputils": "~3.6.1",

packages/cells/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"watch": "tsc -b --watch"
4343
},
4444
"dependencies": {
45-
"@jupyter/ydoc": "~0.2.0",
45+
"@jupyter/ydoc": "~0.2.3",
4646
"@jupyterlab/apputils": "^3.6.1",
4747
"@jupyterlab/attachments": "^3.6.1",
4848
"@jupyterlab/codeeditor": "^3.6.1",

packages/cells/src/model.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -936,9 +936,11 @@ export class CodeCellModel extends CellModel implements ICodeCellModel {
936936
): void {
937937
const codeCell = this.sharedModel as models.YCodeCell;
938938
globalModelDBMutex(() => {
939-
codeCell.execution_count = args.newValue
940-
? (args.newValue as number)
941-
: null;
939+
codeCell.transact(() => {
940+
codeCell.execution_count = args.newValue
941+
? (args.newValue as number)
942+
: null;
943+
}, false);
942944
});
943945
this.contentChanged.emit(void 0);
944946
this.stateChanged.emit({

packages/codeeditor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"watch": "tsc -b --watch"
4242
},
4343
"dependencies": {
44-
"@jupyter/ydoc": "~0.2.0",
44+
"@jupyter/ydoc": "~0.2.3",
4545
"@jupyterlab/coreutils": "^5.6.1",
4646
"@jupyterlab/nbformat": "^3.6.1",
4747
"@jupyterlab/observables": "^4.6.1",

packages/codemirror/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"watch": "tsc -b --watch"
4040
},
4141
"dependencies": {
42-
"@jupyter/ydoc": "~0.2.0",
42+
"@jupyter/ydoc": "~0.2.3",
4343
"@jupyterlab/apputils": "^3.6.1",
4444
"@jupyterlab/codeeditor": "^3.6.1",
4545
"@jupyterlab/coreutils": "^5.6.1",

packages/docprovider-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"watch": "tsc -w --listEmittedFiles"
3535
},
3636
"dependencies": {
37-
"@jupyter/ydoc": "~0.2.0",
37+
"@jupyter/ydoc": "~0.2.3",
3838
"@jupyterlab/application": "^3.6.1",
3939
"@jupyterlab/coreutils": "^5.6.1",
4040
"@jupyterlab/docprovider": "^3.6.1",

packages/docprovider/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"watch": "tsc -b --watch"
4040
},
4141
"dependencies": {
42-
"@jupyter/ydoc": "~0.2.0",
42+
"@jupyter/ydoc": "~0.2.3",
4343
"@jupyterlab/apputils": "^3.6.1",
4444
"@jupyterlab/coreutils": "^5.6.1",
4545
"@jupyterlab/services": "^6.6.1",

packages/docregistry/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"watch": "tsc -b --watch"
4242
},
4343
"dependencies": {
44-
"@jupyter/ydoc": "~0.2.0",
44+
"@jupyter/ydoc": "~0.2.3",
4545
"@jupyterlab/apputils": "^3.6.1",
4646
"@jupyterlab/codeeditor": "^3.6.1",
4747
"@jupyterlab/codemirror": "^3.6.1",

packages/notebook-extension/schema/tracker.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@
877877
"title": "Experimental settings to enable the undo/redo on the notebook document level.",
878878
"description": "Disable the undo/redo on the notebook document level, so actions independent cells can have their own history. The undo/redo never applies on the outputs, in other words, outputs don't have history. A moved cell completely looses history capability for now.",
879879
"type": "boolean",
880-
"default": false
880+
"default": true
881881
},
882882
"renderingLayout": {
883883
"title": "Rendering Layout",

packages/notebook-extension/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,8 +1433,8 @@ function activateNotebookHandler(
14331433
factory.shutdownOnClose = settings.get('kernelShutdown')
14341434
.composite as boolean;
14351435

1436-
modelFactory.disableDocumentWideUndoRedo = settings.get(
1437-
'experimentalDisableDocumentWideUndoRedo'
1436+
modelFactory.disableDocumentWideUndoRedo = !settings.get(
1437+
'documentWideUndoRedo'
14381438
).composite as boolean;
14391439

14401440
updateTracker({

0 commit comments

Comments
 (0)