Optimistic UI - Displaying Success Before Checking for Errors

Optimistic UI - Displaying Success Before Checking for Errors

The concept of Optimistic UI has been around for quite some time, yet it might go unnoticed in our daily interactions with technology. The principle is simple: display the expected successful outcome first, and then check for any errors that may have occurred.

This approach is particularly useful when the likelihood of an error is low. By displaying the success state immediately, we avoid keeping users waiting for a second or two while the system checks for potential issues.

Examples of Optimistic UI in Action:

  • Liking a post: Upon clicking the like button, the app instantly displays the updated like count, even before the server has confirmed the action. If an error occurs during the like process, the app can then revert the displayed like count and notify the user.
  • Adding a Todo item: When a user adds a Todo item, the app immediately adds the item to the list, providing a sense of accomplishment before the data is actually saved to the database. In case of any saving errors, the app can inform the user and potentially retry the operation.

Considerations for Using Optimistic UI:

While Optimistic UI offers a smooth and responsive user experience, it’s important to exercise caution when applying it. This approach is best suited for actions with a low probability of errors and where immediate feedback is crucial.

Scenarios where Optimistic UI may not be ideal:

  • Financial transactions: Involving large sums of money, such as transferring funds or making purchases, demands absolute accuracy. Displaying a success message before confirming the transaction could lead to confusion and potential financial losses.
  • Critical actions: Actions that have significant consequences, such as deleting important files or modifying sensitive data, require thorough verification before presenting any success messages.

Reference:

True Lies of Optimistic User Interfaces

Facebook Post