The GitHub Actions job "Backport Approval Check" on 
texera.git/feat/form-view-switch-without-reload has failed.
Run started by GitHub user Copilot (triggered by Copilot).

Head commit for run:
b88e8212300e1de85025feab3f00556a27fd1d1f / Yang Zhang <[email protected]>
fix(frontend): keep a handed-over run visible and locked, and let each view 
clean up after itself

Addresses the Copilot review on #8581. All four are defects older than
this PR that routing between a workflow's two views turns into real
problems, because a mount now happens on every switch rather than once
per page load.

Two of them are the half of a root cause this PR already fixed for the
workflow metadata, missed for the execution state. `getExecutionStateStream`
is a plain Subject and carries no current value, so a view handed a live
session subscribes after the last state change and hears nothing:

- the Form View showed **Run** for a workflow that was running, and its
  lock rule, which reads `isRunning`, would have let edit mode unlock a
  graph mid-run. It reads `getExecutionState()` before settling in now.
- the canvas unlocked the graph outright on arrival, and the execute
  service reapplies its state-to-lock rule only when the state changes,
  so a workflow that was still running stayed editable until its run
  happened to end. It asks the service to reapply that rule instead,
  through a new `republishExecutionState`, which also says the state
  again for the subscribers the new page has just mounted. The rule
  stays in the one place that owns it.

The other two are teardown:

- neither `WorkflowEditorComponent` nor `MiniMapComponent` disposed its
  JointJS paper, so each mount left one listening to the root-provided
  graph from a detached node (#8582). Both call `paper.remove()` now.
- the editor added its keydown listener with one `.bind(this)` and tried
  to remove another, which never matched: one stale listener per mount,
  and a single Ctrl/Cmd-Z handled several times over after a few
  switches. One bound reference is stored and used for both.

The mini-map also found its own container, and the main canvas's, by
document-wide id lookup, which has the same problem the editor's did:
both views mount a mini-map. It uses its own host and the main paper's
own `el` now.

Deletion-checked: removing either `paper.remove()`, restoring the
mismatched `bind`, restoring the unconditional unlock, dropping the
form's state read, or emptying `republishExecutionState` each turns
exactly the intended named tests red.

Full frontend suite: 224 files, 6157 passed, 1 skipped, 0 failed. AOT
build, eslint and prettier clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FVvP3ttj22f9LB4p9u2anY

Report URL: https://github.com/apache/texera/actions/runs/35515487000

With regards,
GitHub Actions via GitBox

Reply via email to