xuang7 commented on code in PR #9367:
URL: https://github.com/apache/texera/pull/9367#discussion_r4521007767
##########
frontend/src/app/dashboard/service/user/workflow-version/workflow-version.service.ts:
##########
@@ -267,6 +267,21 @@ export class WorkflowVersionService {
this.setDisplayParticularVersion(false);
}
+ /**
+ * Drops a version preview still open when the workspace closes, so the next
workflow opened does
+ * not inherit it. The graph is left alone: the workflow is closing, and
reloading it here would
+ * reach the co-editing room only half done.
+ */
+ public discardOpenVersionDisplay(): void {
+ if (!this.displayParticularWorkflowVersion.getValue()) {
+ return;
+ }
+ this.workflowActionService.resetTempWorkflow();
+ this.workflowPersistService.setWorkflowPersistFlag(true);
+ this.modificationEnabledBeforeTempWorkflow = undefined;
Review Comment:
`displayReadonlyWorkflow` disabled modification (and undo); the ← path
re-enables it in `closeReadonlyWorkflowDisplay`, this one does not. Opening a
blank workflow right after leaving a preview then lands on a read-only canvas,
since `resetAsNewWorkflow()` never re-enables it.
```suggestion
this.workflowActionService.enableWorkflowModification();
this.modificationEnabledBeforeTempWorkflow = undefined;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]