Optimistic edits and placeholder rows
Shows user-created or edited rows immediately as optimistic entries marked 'pending' while the server write is in flight. The entry is reconciled with the server's echo (by id or temporary id), or rolled back with a notice on failure. Optimistic rows are protected from eviction.
Planned. This page shows the specification from issue #180. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
Editable grid with commit latency of 1500 ms and a 20% rejection rate.
Expected behavior
New rows appear at once with a pending style. On success, the tempId is replaced by the server id with no duplicate row even if the stream echo arrives first. On rejection, the row reverts and a toast with Undo/Retry appears.
Planned API surface
api.addOptimisticRow(row, { tempId, position })api.applyOptimisticUpdate(id, patch)remoteSource.commit(changes)rowNode.syncState: 'pending'|'confirmed'|'rejected'event: optimisticReconciledevent: optimisticRolledBackAcceptance criteria
- An optimistic row is visible within one frame of the action. (pending)
- Reconciliation keeps a single row whether the echo arrives before or after the commit response. (pending)
- A rejected update restores the last confirmed values exactly. (pending)
- Pending rows are never evicted. (pending)
- When sorting is on the server, an optimistic insert is placed at the chosen insert position and marked 'position provisional'. (pending)