You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "yangzhang75 (via GitHub)" <gi...@apache.org> on 2026/09/04 18:15:54 UTC

[PR] feat(workflow-form): embed the read-only workflow preview [texera]

yangzhang75 opened a new pull request, #8429:
URL: https://github.com/apache/texera/pull/8429

   ### What changes were proposed in this PR?
   
   Building on the title-bar frame (#8391), this PR adds the collapsible read-only **workflow preview** to the Form View, and the read-only support the embedded editor needs (parent issue #8011). Frontend only.
   
   * A "Workflow" strip on the page that opens to show the same workflow editor and mini-map the operator canvas uses, embedded here read-only. It is built the first time the reader opens the strip (a frame after the strip is revealed, so JointJS measures a real size rather than a zero-sized one that misroutes links), then centred.
   * `structureLocked` on the shared `workflow-editor`: a mode that locks the graph shape (dragging, linking, deleting) without touching the workflow-modification lock the property panel rides on, and suppresses the shared cursor so a read-only view never broadcasts one. It defaults to `false`, so the operator canvas is unchanged. A container `ResizeObserver` keeps the paper sized to its own container (the strip toggles it via `display:none`, which the window-resize handler never hears), and operators already in the graph when this late-mounting editor appears are repainted so a completed run's colours are not missing.
   * With the flag on the form renders for any workflow, so the preview shows the graph read-only regardless of the workflow's default view.
   
   The inputs, running and results are added on top of this by later PRs.
   
   #### Screenshot
   
   The workflow preview open on the read-only page (the "Workflow" strip expanded to the embedded editor + mini-map):
   
   <!-- drag the screenshot here; GitHub replaces this line with the uploaded image -->
   
   ### Any related issues, documentation, discussions?
   
   Part of the Form View feature (parent issue #8011); stacked on #8391 (title bar) and #8376 (page shell). Until those merge, this PR's diff includes their commits as well.
   
   ### How was this PR tested?
   
   Unit tests (vitest): `workflow-form.component.spec.ts` (direct construction) and `workflow-form.rendered.spec.ts` (TestBed-rendered template) cover the strip's open/build/close/walk-away behaviour and the rendered bar; the shared `workflow-editor.component.spec.ts` (106 tests) is unchanged and green, confirming the `structureLocked` split leaves the canvas untouched. The page component is at 100% of its TypeScript, and every line added to `workflow-editor` is covered. Three template lines are not exercised: the `<texera-workflow-editor>` and `<texera-mini-map>` embed behind `*ngIf`, which need a real JointJS paper jsdom cannot provide (the editor's own paper code is v8-ignored for the same reason). `ng build` is clean.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Yes. Co-authored with Claude (Anthropic), reviewed line by line by the author before submission.


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(workflow-form): embed the read-only workflow preview [texera]

Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on PR #8429:
URL: https://github.com/apache/texera/pull/8429#issuecomment-5549971849

   /request-review: @mengw15 


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(workflow-form): embed the read-only workflow preview [texera]

Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on code in PR #8429:
URL: https://github.com/apache/texera/pull/8429#discussion_r3939699036


##########
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:
   Fixed in 8f4d7bd. `openWorkflowStrip` now rechecks `workflowOpen` inside each deferred frame: if the reader collapses the strip before the build frame, the children are no longer mounted into a hidden (0-sized) body, and centering is skipped too. Added a test (open then collapse in the same tick -> the canvas is never built). So the mini-map only ever mounts while the strip is visible.



##########
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:
   Good catch on the gap. In this PR it is not reachable: the Form View calls `disableWorkflowModification()`, so the context menu's structural commands (which follow that flag) are already locked -- the graph cannot be deleted through any path here. `structureLocked` locks the paper's own interactions (drag, link, keyboard delete/cut/port). The case you describe -- modification enabled while the structure stays locked -- first arises in the authoring slice; carrying `structureLocked` into the context menu belongs there, so it is not added now as a gate that would be redundant/dead in this read-only PR. I have tightened the `structureLocked` doc comment to state exactly this (what it locks, that the menu follows the modification flag, and that authoring must extend it). Leaving this thread open for that follow-up.



-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(workflow-form): embed the read-only workflow preview [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8429:
URL: https://github.com/apache/texera/pull/8429#issuecomment-5545043569

   <!-- texera-reviewer-suggestion -->
   ### Automated Reviewer Suggestions
   
   Based on the `git blame` history of the changed files, we recommend the following reviewers:
   
   - **Contributors with relevant context:** `@Neilk1021`, `@PG1204`
     You can notify them by mentioning `@Neilk1021`, `@PG1204` in a comment.
   


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(workflow-form): embed the read-only workflow preview [texera]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(workflow-form): embed the read-only workflow preview [texera]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #8429:
URL: https://github.com/apache/texera/pull/8429#issuecomment-5545433157

   ## [Codecov](https://app.codecov.io/gh/apache/texera/pull/8429?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `96.96970%` with `6 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 94.03%. Comparing base ([`1facefb`](https://app.codecov.io/gh/apache/texera/commit/1facefb183c96e7b426ff6be35e5b6aaa7b33345?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`7a61e73`](https://app.codecov.io/gh/apache/texera/commit/7a61e73dc420f2ba84c40207bbce14b5dbdd0cb9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 2 commits behind head on main.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/texera/pull/8429?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...mponent/workflow-form/workflow-form.component.html](https://app.codecov.io/gh/apache/texera/pull/8429?src=pr&el=tree&filepath=frontend%2Fsrc%2Fapp%2Fworkspace%2Fcomponent%2Fworkflow-form%2Fworkflow-form.component.html&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZnJvbnRlbmQvc3JjL2FwcC93b3Jrc3BhY2UvY29tcG9uZW50L3dvcmtmbG93LWZvcm0vd29ya2Zsb3ctZm9ybS5jb21wb25lbnQuaHRtbA==) | 93.18% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/texera/pull/8429?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...component/workflow-form/workflow-form.component.ts](https://app.codecov.io/gh/apache/texera/pull/8429?src=pr&el=tree&filepath=frontend%2Fsrc%2Fapp%2Fworkspace%2Fcomponent%2Fworkflow-form%2Fworkflow-form.component.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZnJvbnRlbmQvc3JjL2FwcC93b3Jrc3BhY2UvY29tcG9uZW50L3dvcmtmbG93LWZvcm0vd29ya2Zsb3ctZm9ybS5jb21wb25lbnQudHM=) | 98.27% | [0 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/texera/pull/8429?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...onent/workflow-editor/workflow-editor.component.ts](https://app.codecov.io/gh/apache/texera/pull/8429?src=pr&el=tree&filepath=frontend%2Fsrc%2Fapp%2Fworkspace%2Fcomponent%2Fworkflow-editor%2Fworkflow-editor.component.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZnJvbnRlbmQvc3JjL2FwcC93b3Jrc3BhY2UvY29tcG9uZW50L3dvcmtmbG93LWVkaXRvci93b3JrZmxvdy1lZGl0b3IuY29tcG9uZW50LnRz) | 87.50% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/texera/pull/8429?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##               main    #8429    +/-   ##
   ==========================================
     Coverage     94.02%   94.03%            
     Complexity     4819     4819            
   ==========================================
     Files          1202     1207     +5     
     Lines         48925    49184   +259     
     Branches       5942     5972    +30     
   ==========================================
   + Hits          46002    46248   +246     
   - Misses         1459     1464     +5     
   - Partials       1464     1472     +8     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/texera/pull/8429/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | *Carryforward flag |
   |---|---|---|---|
   | [access-control-service](https://app.codecov.io/gh/apache/texera/pull/8429/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `81.00% <ø> (ø)` | | Carriedforward from [fe7807d](https://app.codecov.io/gh/apache/texera/commit/fe7807d331875ea2ff0343bedcb62ffd41bf5df6?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [agent-service](https://app.codecov.io/gh/apache/texera/pull/8429/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `99.32% <ø> (ø)` | | Carriedforward from [fe7807d](https://app.codecov.io/gh/apache/texera/commit/fe7807d331875ea2ff0343bedcb62ffd41bf5df6?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [amber](https://app.codecov.io/gh/apache/texera/pull/8429/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `89.90% <ø> (ø)` | | Carriedforward from [fe7807d](https://app.codecov.io/gh/apache/texera/commit/fe7807d331875ea2ff0343bedcb62ffd41bf5df6?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [computing-unit-managing-service](https://app.codecov.io/gh/apache/texera/pull/8429/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.67% <ø> (ø)` | | Carriedforward from [fe7807d](https://app.codecov.io/gh/apache/texera/commit/fe7807d331875ea2ff0343bedcb62ffd41bf5df6?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [config-service](https://app.codecov.io/gh/apache/texera/pull/8429/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `87.12% <ø> (ø)` | | Carriedforward from [fe7807d](https://app.codecov.io/gh/apache/texera/commit/fe7807d331875ea2ff0343bedcb62ffd41bf5df6?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [file-service](https://app.codecov.io/gh/apache/texera/pull/8429/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `87.91% <ø> (ø)` | | Carriedforward from [fe7807d](https://app.codecov.io/gh/apache/texera/commit/fe7807d331875ea2ff0343bedcb62ffd41bf5df6?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [frontend](https://app.codecov.io/gh/apache/texera/pull/8429/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `96.79% <96.96%> (-0.03%)` | :arrow_down: | |
   | [notebook-migration-service](https://app.codecov.io/gh/apache/texera/pull/8429/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.57% <ø> (ø)` | | Carriedforward from [fe7807d](https://app.codecov.io/gh/apache/texera/commit/fe7807d331875ea2ff0343bedcb62ffd41bf5df6?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [pyamber](https://app.codecov.io/gh/apache/texera/pull/8429/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `98.41% <ø> (ø)` | | Carriedforward from [fe7807d](https://app.codecov.io/gh/apache/texera/commit/fe7807d331875ea2ff0343bedcb62ffd41bf5df6?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [workflow-compiling-service](https://app.codecov.io/gh/apache/texera/pull/8429/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.19% <ø> (ø)` | | Carriedforward from [fe7807d](https://app.codecov.io/gh/apache/texera/commit/fe7807d331875ea2ff0343bedcb62ffd41bf5df6?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   *This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/texera/pull/8429?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(workflow-form): embed the read-only workflow preview [texera]

Posted by "mengw15 (via GitHub)" <gi...@apache.org>.
mengw15 merged PR #8429:
URL: https://github.com/apache/texera/pull/8429


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org