op·ti·mis·tic UI
/ˌɑːp.tɪˈmɪs.tɪk ˌjuːˈaɪ/ (op-tih-MIS-tik yoo-EYE) noun
- Showing the result of an action immediately, before the server confirms it, and rolling back only if the request fails. Tapping like fills the heart instantly; if the request fails, it un-fills and shows a toast.
Origin
By analogy with optimistic concurrency control in databases, which proceeds as if conflicts are rare and checks afterwards.
In practice
Only safe when the server usually agrees and the request is idempotent. Plan the rollback and its message before shipping the happy path.
Say to your AI
Make the like button optimistic: update the UI immediately, send the request with an idempotency key, and roll back with a toast if it fails.
In plain words
- update the screen before the server responds
- don't make users wait for the server
- the like button should feel instant
- instant feedback when clicking
See also perceived latency idempotency undo over confirmation