Undo and conflicts
NodalMerge exposes app-layer undo/redo helpers plus conflict/rejection signals so your UI can remain user-friendly under concurrent edits and authority rules. This page explains how to use those surfaces without assuming perfect single-writer conditions.Undo model
Undo in the SDK is app-layer behavior built on compensating operations. Initialize an undo manager:Important undo limitation
Destructive operations are intentionally constrained for undo safety. Plan UX accordingly when working with delete-heavy flows, especially text/list destructive edits. Treat undo as product-layer behavior, not guaranteed universal CRDT inverse for every operation type.Conflict surfacing
Use conflict hooks to surface concurrency outcomes:- Operator diagnostics
- Developer debugging
- User-facing “what changed” feedback in sensitive workflows
Rejection handling (authority/policy)
Use typed rejection events for policy/capability-denied actions:UX strategy for collaborative safety
Recommended pattern:- Apply optimistic local interaction
- Track undo groups with sensible capture windows
- Surface conflicts non-destructively
- Surface rejections with actionable UI
- Keep canonical updates visible and auditable
Practical heuristics
- Use smaller undo scopes for high-risk areas
- Group rapid keystroke-like edits with capture windows
- Log rejection/conflict metadata for support tooling
- Test undo behavior under multi-client concurrent scenarios
Testing checklist
Before shipping:- Undo/redo across reconnect boundaries
- Undo behavior with concurrent remote edits
- Conflict event handling in active collaboration sessions
- Rejection handling for insufficient capability scenarios
- UI clarity when canonical outcome differs from optimistic expectation
Common mistakes
- Assuming all operation types are perfectly reversible
- Treating rejections as generic transport errors
- Ignoring conflict signals in shared-edit surfaces
- Overly broad undo scope that creates surprising reversions