feat(canvas): dissolve owning canvases without deleting their contents

This commit is contained in:
2026-11-11 18:41:26 +08:00
parent b05058a955
commit 15ee91772d
7 changed files with 174 additions and 3 deletions
+20
View File
@@ -52,6 +52,26 @@ an error after a staged edit leaves document, history, operations and indexes at
their original Root. Progressive imports still use their declared per-record
failure boundaries; this helper does not promise whole-import rollback.
### Dissolving an owning canvas
Dispatch `{type: 'canvas.dissolve', canvasId, entry: {id, incarnation}}` with the
current entry identity. The root cannot be dissolved. The entry remains an
ordinary frame with its existing incoming/outgoing connections. Direct members
move to the parent; nested entries are rebound there, while their own members
retain their owners. Node world position, rotation, size and visual units, and
connection curve positions are preserved. References declared as canvas IDs are
redirected from the dissolved canvas to its parent; literal strings and opaque
payloads are not guessed or rewritten.
The command requires movable known members and editable declared reference
fields. It checks the host policy for each member move/reference edit and rejects
stale entry identities, unsupported curve conversions or policy/schema failures
before publishing anything. A partial source must be completely captured before
dissolving; it never promotes only the members loaded so far. All changes publish
as one history/ledger unit and use the existing atomic protocol-2 edit path.
Undo restores the owning canvas, placements and references; redo dissolves it
again. No member/entry is deleted or given a new incarnation by this operation.
Experimental partial-model runtime: pass a validated prefix plus `loading` in
`EngineOptions`. Version 1 uses recovery format 7; version 2 carries snapshot-bound direct canvas
membership counts and uses format 8. Both keep the scheduler held. Version 3