Copilot commented on code in PR #8429:
URL: https://github.com/apache/texera/pull/8429#discussion_r3939672075
##########
frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.ts:
##########
@@ -118,7 +118,22 @@ export class WorkflowEditorComponent implements OnInit,
AfterViewInit, OnDestroy
metricLabel: string;
heatLabel: string;
} | null = null;
- private interactive: boolean = true;
+ private paperInteractive: boolean = true;
+ // Keeps the paper sized to its OWN container (not just the window) and
rebuilds cell geometry
+ // when the container goes 0 -> real size. Needed by embedded previews like
the Form View strip,
+ // which toggles this editor's container via display:none.
+ private paperResizeObserver?: ResizeObserver;
+
+ /**
+ * Set by a view that shows the graph but must never re-shape it. Separate
from the
+ * workflow-modification lock (which also gates property editing, so reusing
it would disable
+ * the property panel); this gates dragging, linking and deleting only.
+ */
+ @Input() structureLocked = false;
Review Comment:
`structureLocked` does not fully enforce its documented deletion lock when
workflow modification is enabled. The nested context menu only observes
`getWorkflowModificationEnabledStream()` and its delete/cut handlers directly
mutate the graph, so a property-editable, structure-locked editor can still
delete selected cells through right-click. Propagate this lock to the context
menu (and other structural commands) independently of the property-editing flag.
This issue also appears on line 305 of the same file.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -158,6 +175,28 @@ export class WorkflowFormComponent implements OnInit,
OnDestroy {
this.workflowActionService.disableWorkflowModification();
}
+ /** Open or close the workflow preview; opening it builds the canvas the
first time. */
+ public toggleWorkflow(): void {
+ this.workflowOpen = !this.workflowOpen;
+ if (this.workflowOpen) {
+ this.openWorkflowStrip();
+ }
+ }
+
+ /**
+ * Reveal the strip, then build the canvas a frame later (so JointJS
measures the strip's
+ * real size, not a zero-sized frame that misroutes links), then centre the
graph a frame
+ * after that so the fit runs against a canvas that exists. The editor keeps
its own paper
+ * sized via its container ResizeObserver, so nothing more is needed here.
+ */
+ private openWorkflowStrip(): void {
+ this.later(() => {
+ this.workflowEverOpened = true;
+ this.cdr.detectChanges();
+ this.later(() =>
this.workflowActionService.getTexeraGraph().triggerCenterEvent());
+ });
+ }
Review Comment:
Closing the strip before the first animation frame does not cancel this
callback. It then instantiates both children under `[hidden]`; the mini-map
reads a width of 0 once in `ngAfterViewInit` and has no resize observer, so
reopening can leave it permanently zero-sized. Recheck `workflowOpen` before
mounting and before centering.
--
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]