Skip to content

Save, restore and revision conflicts

Loading interactive example…Open in new tab ↗
Opening the live canvas…
  1. Save captures the canonical JSON and current revision in memory.
  2. Edit the text or choose Remove list.
  3. Try captured revision rejects the now-stale update without changing the drawing or its undo/redo history.
  4. Restore saved snapshot explicitly replaces current content. Undo restores the edits you had before replacement; redo reinstates the saved content.

The fixture includes nested lists and checklists. Their structure, formatting and checked state are serialized, rather than flattened into display text.

Capture a revision before waiting for asynchronous work. A stale agent response must be reviewed or replanned; do not silently retry with the latest revision. The separate Restore button here expresses a deliberate replacement decision.

This example stores its snapshot in memory only. Reset or reload clears it. File storage, transport and server-side authorization belong to the host.

See Persistence and imports for validation, migrations and failure contracts, and Agents for integration guidance.

Source

dart
actions: {
  'Save': snapshot.save,
  'Remove list': (session) =>
      session.removeElements(['picnic-list']).requireAllowed(),
  'Try captured revision': snapshot.applyCaptured,
  'Restore saved snapshot': snapshot.restore,
},