feat(workflow-form): Form View title bar, save, and modification lock - #8391
Conversation
Automated Reviewer SuggestionsBased on the
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8391 +/- ##
=========================================
Coverage 94.03% 94.03%
Complexity 4821 4821
=========================================
Files 1207 1207
Lines 49109 49167 +58
Branches 5963 5972 +9
=========================================
+ Hits 46180 46235 +55
- Misses 1461 1462 +1
- Partials 1468 1470 +2
*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:
|
418e104 to
fe7807d
Compare
fe7807d to
71637a1
Compare
|
/request-review: @mengw15 |
There was a problem hiding this comment.
🟢 Approval recommended
The implementation is coherent with the stated Form View scope and has focused component and rendered-template coverage.
Pull request overview
Adds the Form View title bar behavior and shared workflow persistence while keeping the workflow graph read-only.
Changes:
- Adds inline workflow renaming and last-saved status.
- Adds debounced, navigation-time, and teardown-time persistence while preserving operator positions.
- Extends direct and rendered component tests plus title-bar styling.
File summaries
| File | Description |
|---|---|
workflow-form.spec-harness.ts |
Adds metadata/change streams and save-related mocks. |
workflow-form.rendered.spec.ts |
Covers editable title rendering and rename events. |
workflow-form.component.ts |
Implements rename, saved state, persistence, position preservation, and modification locking. |
workflow-form.component.spec.ts |
Tests title metadata, save guards, failure reporting, debounce, and teardown. |
workflow-form.component.scss |
Styles the editable name and saved state. |
workflow-form.component.html |
Adds the name input and saved-at display. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mengw15
left a comment
There was a problem hiding this comment.
Left two comments, both on the save path. The canvas parity otherwise holds up: same workflowChanged + SAVE_DEBOUNCE_TIME_IN_MS pipeline, same rename flow as menu.component's onWorkflowNameChange, same saved-at wording and format, same measure-span width trick; and the wid guard is a justified divergence — the canvas deliberately lets a no-id save create the workflow, this page must not.
On top of the page shell: the title bar's workflow name (renamable in place, exactly as on the operator canvas), its 'Saved at ...' state, and the debounced save both views share -- so an edit made in the form is not lost on the canvas, and vice versa. A save fills in a position for every operator and reports a failure rather than losing it silently. The read-only preview, inputs, running and results are added by later PRs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
71637a1 to
6accf6f
Compare
mengw15
left a comment
There was a problem hiding this comment.
LGTM, thanks for addressing the comments
### What changes were proposed in this PR? Building on the title-bar frame (apache#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 apache#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 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 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): <img width="1247" height="543" alt="Screenshot 2026-09-04 at 1 25 22 PM" src="https://github.com/user-attachments/assets/bf5ce08e-6df9-4c68-9629-6cff55f3b491" /> ### Any related issues, documentation, discussions? Closes apache#8020. Part of the Form View feature (parent issue apache#8011). Builds on the now-merged page shell (apache#8376) and title bar (apache#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) 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. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
What changes were proposed in this PR?
Building on the Form View page shell (#8376), this PR adds the title bar and the save it needs (parent issue #8011). Frontend only.
workflowMetaDataChangedsubscription the canvas uses, so a rename or save (this page's own, or a co-editor's) refreshes the name, its width, and the saved-at state from one place, and the two views never drift apart.disableWorkflowModification): the graph and its properties are shown, not edited. A later PR's authoring mode makes them editable with write access.The read-only preview, the inputs, running and results are added by later PRs.
Screenshot
The title bar (renamable name, "Saved at ..." state, the Canvas / Form View switch) on the read-only page:

Any related issues, documentation, discussions?
Part of the Form View feature (parent issue #8011); stacked on #8376 (the page shell). Until #8376 merges, this PR's diff includes that PR's commit as well. close #8019
How was this PR tested?
Unit tests (vitest):
workflow-form.component.spec.ts(21 tests). As with the shell, the component injects heavy services and child components, so its spec constructs it directly with the shared harness's mocks rather than through TestBed; template rendering is therefore not exercised, but the component and the harness are at 100% of the TypeScript lines this PR adds. The template compiles cleanly underng build.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.