Save, restore and revision conflicts
Loading interactive example…Open in new tab ↗
- Save captures the canonical JSON and current revision in memory.
- Edit the text or choose Remove list.
- Try captured revision rejects the now-stale update without changing the drawing or its undo/redo history.
- 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,
},