feat(workflow-form): embed the read-only workflow preview - #8429
Conversation
Automated Reviewer SuggestionsBased on the
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8429 +/- ##
============================================
- Coverage 94.02% 94.02% -0.01%
Complexity 4818 4818
============================================
Files 1207 1207
Lines 49167 49207 +40
Branches 5972 5978 +6
============================================
+ Hits 46230 46265 +35
- Misses 1464 1466 +2
- Partials 1473 1476 +3
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3019582 to
11e0079
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Rapid collapse can permanently mis-size the mini-map, and structural locking does not cover context-menu deletion paths.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a collapsible, read-only workflow graph preview to Form View using the shared editor and mini-map.
Changes:
- Embeds and lazily initializes the preview.
- Adds structural locking, container resizing, and state repainting.
- Adds preview interaction tests and styling.
File summaries
| File | Description |
|---|---|
workflow-form.spec-harness.ts |
Adds graph-centering mock support. |
workflow-form.rendered.spec.ts |
Tests the preview-bar binding. |
workflow-form.component.ts |
Implements deferred preview initialization. |
workflow-form.component.spec.ts |
Tests preview lifecycle behavior. |
workflow-form.component.scss |
Styles the collapsible preview. |
workflow-form.component.html |
Embeds the editor and mini-map. |
workflow-editor.component.ts |
Adds structural locking, resizing, repainting, and cursor suppression. |
Review details
Suppressed comments (1)
frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.ts:308
- The new
structureLockedbranch has no regression test: the existing editor test only toggles the workflow-modification stream. Add coverage withstructureLocked = truethat verifies dragging/linking and all deletion paths stay disabled while workflow modification remains enabled, plus the default-false case. This is especially important because the two locks intentionally diverge.
// marks all the available magnets or elements when a link is dragged
markAvailable: true,
// disable jointjs default action of adding vertexes to the link
interactive: this.interactive ? defaultInteractiveOption : disableInteractiveOption,
- Files reviewed: 7/7 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Add the collapsible workflow preview to the Form View frame, and the read-only support the embedded editor needs: a structureLocked mode on the shared workflow editor that locks the graph shape (dragging, linking, deleting) without touching the modification lock the property panel rides on, suppresses the shared cursor, and a container ResizeObserver so the paper draws correctly wherever it is mounted. The preview builds that editor and its mini-map the first time the reader opens the strip. 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. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
11e0079 to
8f4d7bd
Compare
|
/request-review: @mengw15 |
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.
structureLockedon the sharedworkflow-editor: a mode that locks the paper's own interactions (dragging, linking, the editor's delete/cut/port commands) 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 tofalse, so the operator canvas is unchanged. A containerResizeObserverkeeps the paper sized to its own container (the strip toggles it viadisplay: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.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):

Any related issues, documentation, discussions?
Closes #8020.
Part of the Form View feature (parent issue #8011). Builds on the now-merged page shell (#8376) and title bar (#8391); this PR's diff is only its own change on current main.
How was this PR tested?
Unit tests (vitest):
workflow-form.component.spec.ts(direct construction) andworkflow-form.rendered.spec.ts(TestBed-rendered template) cover the strip's open/build/close/walk-away behaviour and the rendered bar; the sharedworkflow-editor.component.spec.ts(106 tests) is unchanged and green, confirming thestructureLockedsplit leaves the canvas untouched. The page component is at 100% of its TypeScript, and every line added toworkflow-editoris 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 buildis 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.