Skip to content

feat(workflow-form): Form View title bar, save, and modification lock - #8391

Merged
mengw15 merged 1 commit into
apache:mainfrom
yangzhang75:formview-pr7
Sep 5, 2026
Merged

feat(workflow-form): Form View title bar, save, and modification lock#8391
mengw15 merged 1 commit into
apache:mainfrom
yangzhang75:formview-pr7

Conversation

@yangzhang75

@yangzhang75 yangzhang75 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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.

  • The workflow name, renamable inline exactly as on the operator canvas, with the same "Saved at ..." state beside it. Both follow the workflow's metadata live through the same workflowMetaDataChanged subscription 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.
  • The debounced save both views share, so an edit in one view is not lost in the other. It saves only the workflow this page opened (never spawning a stray "Untitled workflow" from a payload with no id), preserves a position for every operator (a partial map makes a workflow unopenable), saves once more on the way out and before handing back to the canvas, and reports a failed save rather than losing it silently.
  • Locks the workflow to read-only on this page (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:
Screenshot 2026-09-03 at 11 18 10 PM

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 under ng 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.

@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • No candidates found from git blame history.

@codecov-commenter

codecov-commenter commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.03%. Comparing base (dcb25ef) to head (6accf6f).

Files with missing lines Patch % Lines
...component/workflow-form/workflow-form.component.ts 95.74% 0 Missing and 2 partials ⚠️
...mponent/workflow-form/workflow-form.component.html 75.00% 1 Missing ⚠️
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     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from dcb25ef
agent-service 99.32% <ø> (ø) Carriedforward from dcb25ef
amber 89.91% <ø> (ø) Carriedforward from dcb25ef
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from dcb25ef
config-service 87.12% <ø> (ø) Carriedforward from dcb25ef
file-service 87.91% <ø> (ø) Carriedforward from dcb25ef
frontend 96.78% <95.00%> (-0.01%) ⬇️
notebook-migration-service 83.57% <ø> (ø) Carriedforward from dcb25ef
pyamber 98.47% <ø> (ø) Carriedforward from dcb25ef
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from dcb25ef

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yangzhang75
yangzhang75 force-pushed the formview-pr7 branch 2 times, most recently from 418e104 to fe7807d Compare September 4, 2026 17:42
@yangzhang75
yangzhang75 marked this pull request as ready for review September 4, 2026 20:47
@yangzhang75

Copy link
Copy Markdown
Contributor Author

/request-review: @mengw15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 mengw15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts Outdated
Comment thread frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts Outdated
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>

@mengw15 mengw15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for addressing the comments

@mengw15
mengw15 added this pull request to the merge queue Sep 5, 2026
Merged via the queue into apache:main with commit 873c91c Sep 5, 2026
25 of 26 checks passed
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Sep 5, 2026
### 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(workflow-form): Form View title bar, save, and modification lock

4 participants