Back to Plate

Slate V2 Transforms SetNodes Cluster Recovery

docs/plans/2026-04-09-slate-v2-transforms-setnodes-cluster-recovery.md

53.0.62.1 KB
Original Source

Slate V2 Transforms SetNodes Cluster Recovery

Scope

Recover the deleted packages/slate/test/transforms/setNodes/inline/** cluster on the current engine instead of leaving Transforms.setNodes(...) as a path-only helper.

Recovered Contract

  • Transforms.setNodes(...) now supports:
    • exact Path
    • current-selection / explicit Location
    • Span
    • match
    • mode
    • voids
  • default mode is lowest
  • the helper applies one transaction across all matched nodes
  • runtime ids stay stable because the helper still routes through raw set_node

Direct Proof

Current direct rows:

  • selected inline element updates through match without an explicit path
  • block-spanning selection updates matched inline elements across blocks
  • nested inline matches default to the lowest matching inline
  • inline void props are preserved while adding the new prop
  • explicit Point, Range, and Span targets are proved directly
  • non-default mode: 'highest' is proved directly

Why This Was Worth Restoring

  • the deleted setNodes/inline/** cluster still mapped to real current-value command usage
  • the live walkthroughs were already teaching Transforms.setNodes(editor, props, { match }) even though the implementation only accepted { at: Path }
  • recovering the seam is better than pretending the docs or the deleted tests were wrong

Code Change

Docs Synced