From abb58f5bc998e56cc9a5740382ed40838d9b534f Mon Sep 17 00:00:00 2001 From: Xiao-zhen-Liu Date: Fri, 18 Jul 2025 15:43:26 -0700 Subject: [PATCH 1/3] fix output port writer thread closed by finalizing an input port. --- .../component/menu/menu.component.html | 32 +++++++++---------- .../workflow-editor.component.ts | 6 ++-- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/core/gui/src/app/workspace/component/menu/menu.component.html b/core/gui/src/app/workspace/component/menu/menu.component.html index c7c486ae284..e212169321f 100644 --- a/core/gui/src/app/workspace/component/menu/menu.component.html +++ b/core/gui/src/app/workspace/component/menu/menu.component.html @@ -291,22 +291,22 @@ nzType="database" nzTheme="twotone"> - - + + + + + + + + + + + + + + + + diff --git a/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.ts b/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.ts index ac241952167..bf8f3c15cb4 100644 --- a/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.ts +++ b/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.ts @@ -186,7 +186,9 @@ export class WorkflowEditorComponent implements AfterViewInit, OnDestroy { if ((event.metaKey || event.ctrlKey) && !event.shiftKey && event.key.toLowerCase() === "z") { // UNDO if (this.undoRedoService.canUndo()) { - this.undoRedoService.undoAction(); + // Temporarily disabling undo-redo because of a bug that can cause invalid workflow structures. + // TODO: enable after fixing the bug. + // this.undoRedoService.undoAction(); } } else if ( ((event.metaKey || event.ctrlKey) && !event.shiftKey && event.key.toLowerCase() === "y") || @@ -194,7 +196,7 @@ export class WorkflowEditorComponent implements AfterViewInit, OnDestroy { ) { // redo if (this.undoRedoService.canRedo()) { - this.undoRedoService.redoAction(); + // this.undoRedoService.redoAction(); } } // below for future hotkeys From 3702d6ea43815b20583b46ede2b62d0ef2cf2556 Mon Sep 17 00:00:00 2001 From: Xiao-zhen-Liu Date: Fri, 18 Jul 2025 15:43:26 -0700 Subject: [PATCH 2/3] temporarily disable undo redo. --- .../component/menu/menu.component.html | 32 +++++++++---------- .../workflow-editor.component.ts | 6 ++-- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/core/gui/src/app/workspace/component/menu/menu.component.html b/core/gui/src/app/workspace/component/menu/menu.component.html index c7c486ae284..e212169321f 100644 --- a/core/gui/src/app/workspace/component/menu/menu.component.html +++ b/core/gui/src/app/workspace/component/menu/menu.component.html @@ -291,22 +291,22 @@ nzType="database" nzTheme="twotone"> - - + + + + + + + + + + + + + + + + diff --git a/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.ts b/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.ts index ac241952167..bf8f3c15cb4 100644 --- a/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.ts +++ b/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.ts @@ -186,7 +186,9 @@ export class WorkflowEditorComponent implements AfterViewInit, OnDestroy { if ((event.metaKey || event.ctrlKey) && !event.shiftKey && event.key.toLowerCase() === "z") { // UNDO if (this.undoRedoService.canUndo()) { - this.undoRedoService.undoAction(); + // Temporarily disabling undo-redo because of a bug that can cause invalid workflow structures. + // TODO: enable after fixing the bug. + // this.undoRedoService.undoAction(); } } else if ( ((event.metaKey || event.ctrlKey) && !event.shiftKey && event.key.toLowerCase() === "y") || @@ -194,7 +196,7 @@ export class WorkflowEditorComponent implements AfterViewInit, OnDestroy { ) { // redo if (this.undoRedoService.canRedo()) { - this.undoRedoService.redoAction(); + // this.undoRedoService.redoAction(); } } // below for future hotkeys From 2920eefe63db468c73ce8584754a88538319b73f Mon Sep 17 00:00:00 2001 From: Xiao-zhen-Liu Date: Fri, 18 Jul 2025 16:07:41 -0700 Subject: [PATCH 3/3] temporarily disable undo redo. --- .../workflow-editor.component.spec.ts | 100 +++++++++--------- .../workflow-editor.component.ts | 34 +++--- 2 files changed, 68 insertions(+), 66 deletions(-) diff --git a/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.spec.ts b/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.spec.ts index 161d217fd86..40574b0f7ef 100644 --- a/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.spec.ts +++ b/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.spec.ts @@ -897,54 +897,56 @@ describe("WorkflowEditorComponent", () => { expect(jointGraphWrapper.getCurrentHighlightedOperatorIDs()).toContain(mockResultPredicate.operatorID); }); - //undo - it("should undo action when user presses command + Z or control + Z", () => { - spyOn(workflowVersionService, "getDisplayParticularVersionStream").and.returnValue(of(false)); - spyOn(undoRedoService, "canUndo").and.returnValue(true); - let undoSpy = spyOn(undoRedoService, "undoAction"); - fixture.detectChanges(); - const commandZEvent = new KeyboardEvent("keydown", { key: "Z", metaKey: true, shiftKey: false }); - (document.activeElement as HTMLElement)?.blur(); - document.dispatchEvent(commandZEvent); - fixture.detectChanges(); - expect(undoSpy).toHaveBeenCalledTimes(1); - - const controlZEvent = new KeyboardEvent("keydown", { key: "Z", ctrlKey: true, shiftKey: false }); - (document.activeElement as HTMLElement)?.blur(); - document.dispatchEvent(controlZEvent); - fixture.detectChanges(); - expect(undoSpy).toHaveBeenCalledTimes(2); - }); - - //redo - it("should redo action when user presses command/control + Y or command/control + shift + Z", () => { - spyOn(workflowVersionService, "getDisplayParticularVersionStream").and.returnValue(of(false)); - spyOn(undoRedoService, "canRedo").and.returnValue(true); - let redoSpy = spyOn(undoRedoService, "redoAction"); - fixture.detectChanges(); - const commandYEvent = new KeyboardEvent("keydown", { key: "y", metaKey: true, shiftKey: false }); - (document.activeElement as HTMLElement)?.blur(); - document.dispatchEvent(commandYEvent); - fixture.detectChanges(); - expect(redoSpy).toHaveBeenCalledTimes(1); - - const controlYEvent = new KeyboardEvent("keydown", { key: "y", ctrlKey: true, shiftKey: false }); - (document.activeElement as HTMLElement)?.blur(); - document.dispatchEvent(controlYEvent); - fixture.detectChanges(); - expect(redoSpy).toHaveBeenCalledTimes(2); - - const commandShitZEvent = new KeyboardEvent("keydown", { key: "z", metaKey: true, shiftKey: true }); - (document.activeElement as HTMLElement)?.blur(); - document.dispatchEvent(commandShitZEvent); - fixture.detectChanges(); - expect(redoSpy).toHaveBeenCalledTimes(3); - - const controlShitZEvent = new KeyboardEvent("keydown", { key: "z", ctrlKey: true, shiftKey: true }); - (document.activeElement as HTMLElement)?.blur(); - document.dispatchEvent(controlShitZEvent); - fixture.detectChanges(); - expect(redoSpy).toHaveBeenCalledTimes(4); - }); + // Temporarily disabling undo-redo because of a bug that can cause invalid workflow structures. + // TODO: enable after fixing the bug. + // //undo + // it("should undo action when user presses command + Z or control + Z", () => { + // spyOn(workflowVersionService, "getDisplayParticularVersionStream").and.returnValue(of(false)); + // spyOn(undoRedoService, "canUndo").and.returnValue(true); + // let undoSpy = spyOn(undoRedoService, "undoAction"); + // fixture.detectChanges(); + // const commandZEvent = new KeyboardEvent("keydown", { key: "Z", metaKey: true, shiftKey: false }); + // (document.activeElement as HTMLElement)?.blur(); + // document.dispatchEvent(commandZEvent); + // fixture.detectChanges(); + // expect(undoSpy).toHaveBeenCalledTimes(1); + // + // const controlZEvent = new KeyboardEvent("keydown", { key: "Z", ctrlKey: true, shiftKey: false }); + // (document.activeElement as HTMLElement)?.blur(); + // document.dispatchEvent(controlZEvent); + // fixture.detectChanges(); + // expect(undoSpy).toHaveBeenCalledTimes(2); + // }); + // + // //redo + // it("should redo action when user presses command/control + Y or command/control + shift + Z", () => { + // spyOn(workflowVersionService, "getDisplayParticularVersionStream").and.returnValue(of(false)); + // spyOn(undoRedoService, "canRedo").and.returnValue(true); + // let redoSpy = spyOn(undoRedoService, "redoAction"); + // fixture.detectChanges(); + // const commandYEvent = new KeyboardEvent("keydown", { key: "y", metaKey: true, shiftKey: false }); + // (document.activeElement as HTMLElement)?.blur(); + // document.dispatchEvent(commandYEvent); + // fixture.detectChanges(); + // expect(redoSpy).toHaveBeenCalledTimes(1); + // + // const controlYEvent = new KeyboardEvent("keydown", { key: "y", ctrlKey: true, shiftKey: false }); + // (document.activeElement as HTMLElement)?.blur(); + // document.dispatchEvent(controlYEvent); + // fixture.detectChanges(); + // expect(redoSpy).toHaveBeenCalledTimes(2); + // + // const commandShitZEvent = new KeyboardEvent("keydown", { key: "z", metaKey: true, shiftKey: true }); + // (document.activeElement as HTMLElement)?.blur(); + // document.dispatchEvent(commandShitZEvent); + // fixture.detectChanges(); + // expect(redoSpy).toHaveBeenCalledTimes(3); + // + // const controlShitZEvent = new KeyboardEvent("keydown", { key: "z", ctrlKey: true, shiftKey: true }); + // (document.activeElement as HTMLElement)?.blur(); + // document.dispatchEvent(controlShitZEvent); + // fixture.detectChanges(); + // expect(redoSpy).toHaveBeenCalledTimes(4); + // }); }); }); diff --git a/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.ts b/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.ts index bf8f3c15cb4..3275291b4bc 100644 --- a/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.ts +++ b/core/gui/src/app/workspace/component/workflow-editor/workflow-editor.component.ts @@ -182,23 +182,23 @@ export class WorkflowEditorComponent implements AfterViewInit, OnDestroy { .pipe(takeUntil(this._onProcessKeyboardActionObservable)) .subscribe(displayParticularWorkflowVersion => { if (!displayParticularWorkflowVersion) { - // cmd/ctrl+z undo ; ctrl+y or cmd/ctrl + shift+z for redo - if ((event.metaKey || event.ctrlKey) && !event.shiftKey && event.key.toLowerCase() === "z") { - // UNDO - if (this.undoRedoService.canUndo()) { - // Temporarily disabling undo-redo because of a bug that can cause invalid workflow structures. - // TODO: enable after fixing the bug. - // this.undoRedoService.undoAction(); - } - } else if ( - ((event.metaKey || event.ctrlKey) && !event.shiftKey && event.key.toLowerCase() === "y") || - ((event.metaKey || event.ctrlKey) && event.shiftKey && event.key.toLowerCase() === "z") - ) { - // redo - if (this.undoRedoService.canRedo()) { - // this.undoRedoService.redoAction(); - } - } + // Temporarily disabling undo-redo because of a bug that can cause invalid workflow structures. + // TODO: enable after fixing the bug. + // // cmd/ctrl+z undo ; ctrl+y or cmd/ctrl + shift+z for redo + // if ((event.metaKey || event.ctrlKey) && !event.shiftKey && event.key.toLowerCase() === "z") { + // // UNDO + // if (this.undoRedoService.canUndo()) { + // this.undoRedoService.undoAction(); + // } + // } else if ( + // ((event.metaKey || event.ctrlKey) && !event.shiftKey && event.key.toLowerCase() === "y") || + // ((event.metaKey || event.ctrlKey) && event.shiftKey && event.key.toLowerCase() === "z") + // ) { + // // redo + // if (this.undoRedoService.canRedo()) { + // this.undoRedoService.redoAction(); + // } + // } // below for future hotkeys } this._onProcessKeyboardActionObservable.complete();