47
optimistic UI
Paint the success first. If the server refuses, roll back. Do not make the user wait on a like.
What is optimistic UI?
Optimistic UI updates local state before the response. The rollback path is the feature. Without rollback you have a lying interface.
Why does optimistic UI matter when vibe coding?
Models either wait on every click or fake the success with no undo. Name optimistic update and name the rollback in the same sentence.
How do you do optimistic UI?
Likes, stars, toggles: optimistic. Payments and deletes of other people’s data: wait. Always toast on rollback, not on success.
How do you ask a model for optimistic UI?
Make (action) optimistic: flip UI on click, roll back and offer retry on failure. Do not wait for the response to paint. Do not lie if it failed.
What goes wrong with optimistic UI?
Optimistic create of a priced order. Money waits for the server.