Skip to content

Switch pipeline and workflow undo/redo to XML snapshots, fixes #8037 - #8042

Merged
hansva merged 1 commit into
apache:mainfrom
mattcasters:issue-8037
Aug 21, 2026
Merged

Switch pipeline and workflow undo/redo to XML snapshots, fixes #8037#8042
hansva merged 1 commit into
apache:mainfrom
mattcasters:issue-8037

Conversation

@mattcasters

Copy link
Copy Markdown
Contributor

What

Replace incremental ChangeAction replay for pipelines and workflows with gzip-compressed XML snapshots of the whole document.

Undo/redo no longer reconstructs graphs from typed deltas (new/delete/change/position + nextAlso chaining). It restores the previous or next snapshot into the existing PipelineMeta / WorkflowMeta object.

This is the same approach that made undo/redo reliable in hop-data-vault modelers.

Why

The old system was error-prone:

  • Replay depends on indexes, clones, hop endpoint names, and nextAlso.
  • Combined transform+note moves could desync because addUndoPosition dropped nextAlso.
  • Workflow redo of an action edit hit ChangeTransform instead of ChangeAction.
  • Transform dialogs only recorded undo when a clone/XML compare said so, so missed edits were neither undone nor marked dirty.

PipelineMeta.clone() already tells callers to serialize to XML. Snapshots use that path (XmlMetadataUtil, no license header / formatter).

How

  • New XmlSnapshotUndo stores gzip XML stacks, trimmed to PropsUi.getMaxUndo() (default 100).
  • Pipeline and workflow graphs own the stacks and restore into the live meta without firing file-load extension points.
  • Dialogs, paste, drag, snap/align, and notes snapshot before the mutation (one undo step for compound actions).
  • Leftover hopGui.undoDelegate.addUndo* calls still work through a post-change shim (plugins included).
  • After undo/redo, the dirty asterisk follows whether the current snapshot matches the last saved one.
  • TableView cell undo is unchanged.

GUI

Configuration perspective → Explorer Perspective: Maximum undo operations (PropsUi.getMaxUndo()). CLI: --max-undo.

Tests

XmlSnapshotUndoTest covers pipeline/workflow round-trip, redo clearing, max-undo trim, apply-without-recording, and gzip content equality.

Issue

Fixes #8037

…#8037

Replace incremental ChangeAction replay with gzip-compressed document
snapshots so undo/redo restores the whole pipeline or workflow instead of
puzzling typed deltas back together. TableView cell undo is unchanged.

Add a Maximum undo operations field on the Explorer Perspective options
tab that reads and writes PropsUi.getMaxUndo().
@hansva
hansva merged commit 24274a9 into apache:main Aug 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: Switch pipeline and workflow undo/redo to snapshots

2 participants