UX: Immediate Intent vs. Optimistic Update

https://romshark.github.io/ux-immediate-intent/

Comments

romsharkNov 27, 2026, 8:20 PM
I've grown tired of explaining to frontend devs why "optimistic updates" are harmful and why immediate intent is always better, so I invested a couple hours of my life and some amount of Claude tokens to explain this once and for all.

Let's not make software bad by design, let's make good reliable software we can trust.

P.S. maybe I'm wrong? Challenge me in the GitHub issues!

fillmoreNov 28, 2026, 3:02 AM
Thanks for sharing. I think your page illustrates that different types of content warrant different idioms. Agreed that a pill tracker needs to have accurate state. But reactions/likes do not, these can be fire and forget, best effort interactions. Or they may be so low latency that immediate intent behavior actually resembles a bug (blip in the UI). They may not even be built over reliable protocols.

An alternative is something I've seen on Slack. Optimistic state followed by a "rollback" (maybe there is a more conventional term for this), if a message isn't sent after a few seconds.

gf000Nov 28, 2026, 9:41 AM
As a user, I absolutely hate that.

I liked or disliked something as a deliberate action, especially on Facebook it will even have my name attached to it. I want to know what its state.

Actually, relatedly - actions should be cancelable. So an accidental like should be unliked immediately and clearly. On Facebook I literally had to go to activity history to see whether an accidental like that I unchecked actually got removed or not. Though Facebook is probably the worst big website out there..

romsharkNov 28, 2026, 12:37 PM
> As a user, I absolutely hate that.

Same here :)

> Actually, relatedly - actions should be cancelable.

Good point! I should probably add a section about that too. Thanks!

romsharkNov 28, 2026, 3:17 AM
> Thanks for sharing.

You're welcome!

> But reactions/likes do not, these can be fire and forget, best effort interactions.

> They may not even be built over reliable protocols.

I wonder why so many people think this way? IMHO, if I put a like somewhere - I actually care. If I wouldn't care for it to be there - I wouldn't have pressed that button. So if you don't think those likes are important, why are you having them in the first place? If you think providing a worse UX to a user on a slow mobile network is acceptable sacrifice for bad design and bad engineering, then maybe I don't want to be your user :)

> Optimistic state followed by a "rollback"

I think this makes user interfaces worse, not better :) I don't want rollbacks, I want to be well informed on what's actually going on.

IMHO good software starts with teams and designers that actually care for their users.

pynappoNov 28, 2026, 4:28 AM
> I wonder why so many people think this way? IMHO, if I put a like somewhere - I actually care. If I wouldn't care for it to be there - I wouldn't have pressed that button. So if you don't think those likes are important, why are you having them in the first place? If you think providing a worse UX to a user on a slow mobile network is acceptable sacrifice for bad design and bad engineering, then maybe I don't want to be your user :)

There is an insane amount of content on short-form social media feeds. Most people see content that has a lot of likes already. I have thousands of pieces of content I've given likes to; I've probably forgotten to give likes to a lot of similar content hundreds of times, but I've only seen a like fail a handful of times.

At least to me, failing to like things seems very rare and inconsequential. 90% of the time, it means that the algorithm is going to feature that type of content a bit less for me for a little bit, and the other 10% of the time i might miss something i wanted to send or show to someone later.

romsharkNov 28, 2026, 1:09 PM
We should not forget, that the perceived UX degradation might not be uniformly distributed across the entire user base. It can be disproportional. Users on slow mobile networks with high packet loss may experience far worse UX than those on a fiber-optic network at home. Add to that geographic distance and potentially services in the middle such as VPNs.

In the end it might not be "1 out of 1000 actions per user", but "1 out of 1000 users". So why make your software worse for them, if you can do a better job for everyone at little or no extra cost?

gherkinnnNov 27, 2026, 11:33 PM
Your argument is good and I agree.

That said, I have grown tired of over-clauded websites.

romsharkNov 27, 2026, 11:35 PM
Thank you! regarding the over-clauding - reload the page (purge cache!) and check out the new design, I just re-iterated on it and made it less sloppy :)
ameliaquiningNov 28, 2026, 9:17 AM
I assumed they were talking about the prose.
franz899Nov 28, 2026, 9:09 AM
You're not wrong, its a pattern that looks nice in demo and presentation but delivers worst real world UX. Great page
romsharkNov 28, 2026, 12:03 PM
Can you provide an example when it delivers worse UX in the real world? Feel free to file an issue :)
andersmurphyNov 27, 2026, 8:49 PM
Awesome example of why "optimistic updates" shouldn't be used outside of games (even then getting shot through walls is incredibly frustrating).

Immediate intent is definitely the way to go.

eviksNov 28, 2026, 12:57 PM
You can ask Claude to challenge you!
Timon3Nov 29, 2026, 2:34 AM
Thanks for illustrating your points so well! I agree with most of your arguments, except IMO there's some nuance on point 3 (The user leaves during the request).

For actions such as "like" on bad connections, this approach can waste a lot of time. Personally I've had plenty of cases on terrible mobile connections where my submission of some request went through, but the response timed out - but since I don't know whether the request has finished sending, I can't leave the tab on mobile, or it might get unloaded!

So in cases like this, queuing w/ background sync is much, much better than showing users the "Leave this page? Your like has not been saved yet" dialog. If I have a spotty connection, don't make me wait for the action to finish!

dutchCourageNov 28, 2026, 12:36 AM
This is nicely done, I like the animated examples!

I somewhat disagree with the premise. I would distinguish between Web behaviors and App-like behaviors.

On the web, when submitting a form or clicking a "cancel subscription" button, we absolutely need confirmation that the thing we want to do has happened, otherwise it's lost.

When building a web app, the right way to go is generally offline first. I would argue that the behavior you show in the to-do list examples is very much optimistic updates, even when you choose to display that syncing is in progress.

It's also the right way to go for the pill example. What if I take my pill while commuting underground with bad reception. I'd prefer the action to be saved locally and synced later.

The "like" action is an exception here. Ideally it would also be instant and synced later, but the approach most apps take is that they can afford to lose a "like" if something goes wrong. It's not a critical action. They trade off accuracy for simplicity of implementation.

romsharkNov 28, 2026, 12:47 AM
> This is nicely done, I like the animated examples!

Thank you, appreciate it!

> When building a web app, the right way to go is generally offline first.

If the source of truth for that web app is a centralized server then I don't quite agree because IMHO offline-first increases code complexity and it's rarely justified. However, offline-first vs thin-client is a-whole-nother topic :)

> I would argue that the behavior you show in the to-do list examples is very much optimistic updates

It's not optimistic if you're clearly stating that whatever the changes you made are not yet persisted to your source of truth (the server database).

> even when you choose to display that syncing is in progress.

This makes all the difference, you're not being optimistic here, you don't claim it's there, you're being realistic and honest about it being in a premature state.

> The "like" action is an exception here. Ideally it would also be instant and synced later, but the approach most apps take is that they can afford to lose a "like" if something goes wrong. It's not a critical action. They trade off accuracy for simplicity of implementation.

IMHO, this is the wrong trade-off. It takes just as much (or little) code complexity to show immediate intent, as it takes to do proper optimistic updates (because you still need the rollback on failure, otherwise your optimistic update is even more misleading) and I'm happy to be proven wrong if that's not true. So if the cost is roughly the same - why make it worse by design?!

My take is: You don't want software that _appears_ to be fast, you want _fast_ software. And if you can't make fast software, then at least don't make misleading software.

ryan_beetheNov 28, 2026, 5:03 PM
> It takes just as much (or little) code complexity to show immediate intent

I think this depends on how optimistic updates are implemented. There's no reason why the logic to handle a request in the server can't be reused to produce optimistic updates in the client. I've built systems that way. Whereas the immediate intent is actually a slightly different code path and does require more code. But I agree that the rollback logic is needed in either case (and it should be structurally guaranteed, not something hand-written per request).

I really like your website though, I'll be bookmarking it. I'd love to see a lot more offline apps exist, because I think on principle I want all my devices and all their applications to be usable so long as they have power. But I think developers and users are so used to online-only apps, we need to spend time thinking through what a good UX is for offline apps, and this is a great illustration of the importance of that UX.

dutchCourageNov 28, 2026, 7:56 AM
"optimistic updates" aren't less optimistic if you indicate that the UI is being synced. It's not about telling the truth or not. It's about giving instant feedback and showing the UI state as it would be if the action went through, which is exactly what you do in your to-do list example. That allows the user to keep doing more actions before they've received confirmation from the server that their first action was accepted.

For the "like" action, it's just more satisfying if it feels instant.

romsharkNov 28, 2026, 12:46 PM
> For the "like" action, it's just more satisfying if it feels instant.

Lies are sweet, aren't they? :) Again, I believe you should make the software fast, not make it pretend to be fast. You can absolutely make the like be confirmed sub 100ms and in that case you can skip the immediate intent because it's fast enough (see demo). Even if you have an 80ms ping, you can still do the job of putting the like in a durable queue server-side under 20ms.

Yet instead what people do is lie to the user and risk losing data and this bad practice just became normal practice over time. The like just goes straight into /dev/null, and at best there's a rollback which only makes the user wonder "what the ?! I just pressed it!".

IMHO, we keep treating symptoms without addressing the root causes.

AeseirNov 28, 2026, 1:41 AM
>If the source of truth for that web app is a centralized server then I don't quite agree because IMHO offline-first increases code complexity and it's rarely justified. However, offline-first vs thin-client is a-whole-nother topic :)

IMO that is probably the best reason to do it.

If you know you will be offline first, and you know complexity will be high, then you will more likely focus on abstracting that complexity enough and shifting it forwards in development cycle, so subsequent usages don't have the complexity to deal with only the abstraction. Far too many teams go from easy -> medium -> high, and go "fuck we have to refactor too much, lets slap a tech debt label on it and move on"

btw like the post very simple but effective.

romsharkNov 28, 2026, 2:06 AM
If you can afford that added complexity - go for it, have fun :) I learned to not underestimate the amount of complexity in distributed systems and that in most centralized web apps this complexity simply isn't worth it. You can hide that complexity behind advanced sync engines, but you cannot completely prevent it from coming to bite you eventually. That's my personal opinion, so feel free to disagree :)
andersmurphyNov 28, 2026, 6:53 AM
So in an offline first app how do I know my bid/booking has actually gone through? You don't. Unless, you do immediate intent/show in progress. At that point what has all the additional complexity of offline first bought you?
dutchCourageNov 28, 2026, 7:35 AM
This is not a valid use case for optimistic updates or offline first. You need external confirmation that the action went through. No app will show "payment accepted, booking confirmed" unless it actually happened.
andersmurphyNov 28, 2026, 12:13 PM
> At that point what has all the additional complexity of offline first bought you?
dutchCourageNov 28, 2026, 2:30 PM
Instant navigation, instant actions and an app you can use offline. I'd hate for my to-do list or my podcast app to have to make network calls for any action I take. It doesn't mean that all actions should happen offline. Some actions are inherently online.

Take the case of an email app: Mark as read: complete the action offline and sync later. Move to folder: same. Send an email: very much an online action, save the draft and send later. Don't show an email as sent if it isn't.

romsharkNov 28, 2026, 3:05 PM
> Don't show an email as sent if it isn't.

In my personal experience, a lot of devs who practice optimistic updates actually would show you the email as sent, even though they just put it in a local queue for later sync, and if things go wrong they rollback like "whoopsy, it wasn't, nevermind". If you don't do that - good, you're not using optimistic UI by my definition :)

See https://romshark.github.io/ux-immediate-intent/#takeaway-5

PanzerschrekNov 28, 2026, 4:39 AM
> Get there for real, with a faster backend and servers close to your users.

This doesn't work as expected if network connection isn't stable. One should not assume minimal latency.

andersmurphyNov 28, 2026, 7:06 AM
In practice the network has mostly been used as an excuse for slow backends. 200ms roundtrips are perfectly snappy when your server has sub 1ms response times. Especially if you can keep those responses sub 1k MTU.
AeseirNov 28, 2026, 2:08 AM
forgive my ignorance, but what is the difference between this and pessimistic UI with state?
romsharkNov 28, 2026, 2:19 AM
Good question! There's overlap between immediate intent and pessimistic UI. By my interpretation, pessimistic UI doesn't require any sort of feedback between the invocation of the action and displaying the final result. Pessimistic UI can basically be clicking a button, seeing no changes for a while, and then finally seeing the result (success/error). Immediate intent rules that out and requires immediate feedback on the intent.

That said, I suppose interpretations may differ.

AeseirNov 28, 2026, 5:20 AM
My 5 cents.

That is Pessimistic UI with active states. I would probably add something along those lines to your page, as it will create more link between what you trying to communicate and common venacular.

andersmurphyNov 28, 2026, 6:57 AM
I've never heard the term "pessimist UI with state". Where did you pick it up from?
fugaziboutitNov 28, 2026, 3:30 AM
This really depends on how edge-case-y a failure is. If it succeeds 999 times out of 1000, you absolutely should display the optimistic state but throw a toast message for a failure.

The alternative is making the other 999 users wait for something that virtually always succeeds. There's no justification from a UX POV for keeping those 999 users on the green path in a wait loop -- it's annoying on the vector of 'some people have weaponised shoes therefore we must all take off our shoes at the airport.'

gf000Nov 28, 2026, 10:49 AM
Do you actually have to wait for it? I would be much happier with a button that spins and I just scroll forward depending on whether I care or not.

Like that's also the physical world analogue to things. There is a big bucket of water on the ground, I push it over it will leak out over time. I can either watch it, or go on my way.

But I won't see an empty bucket on the wet ground immediately

romsharkNov 28, 2026, 12:49 PM
What if that 1 out of 1000 is consistently the user on the slow mobile network with high packet loss? Should I automatically be considered less relevant as a user if I'm on a bad network? (Spoiler: that's a lot of people).

Networks are inherently unpredictable and unreliable. If you ask me, caring only for the happy path is simply poor engineering and bad design.

shoolyNov 28, 2026, 2:33 PM
This is pure fantasy. In real world there's _always_ going to be someone who has terrible connectivity _no matter_ what you do. Providing 99.9% of users with degraded experience just to satisfy 0.1% is a perfect example of "poor engineering and bad design", because you no longer care about the actual users - you only care about sticking to a certain philosophy.
romsharkNov 28, 2026, 3:07 PM
> Providing 99.9% of users with degraded experience just to satisfy 0.1%

How is immediate intent providing degraded experience? Can you provide an example and explain? Otherwise I consider that a straw man argument.

omeid2Nov 28, 2026, 3:25 AM
I like the presentation and like everything there can be too much of Optimism in Optimistic UIs.

I would call this State Transparent Optimistic ui. STO!

romsharkNov 28, 2026, 1:12 PM
Too much terminology, too little consensus :) Maybe the lack of well defined standards is one of the key problems here?
greatgibNov 28, 2026, 12:49 AM
It is the AI generated slope standard page template. Turn me down immediately and for good reason:

You have a wall of text, and image and animations, 2km long, all blinking in my face, when just one graph and 10 lines of text would have carried the same content in a better way.

romsharkNov 28, 2026, 12:59 AM
Awaiting your fork/PR! I'm sure there's many people who have more time and ability to make an even better demo :)

P.S. make sure you're viewing the latest version by purging your browser cache for this site.

greatgibNov 28, 2026, 8:42 PM
[dead]
SpivakNov 27, 2026, 11:59 PM
Now do why showing the user the actual error is better than "something went wrong" every time.
AeseirNov 28, 2026, 6:59 AM
Abosolutely not.

Users need to only know IF they can do something about it e.g. you forgot input.

Past that point it not only becomes noise but its a big nono from security perspective. Attackers can use that information.

shoolyNov 28, 2026, 2:20 PM
Absolutely not.

It's good to inform users why something failed, even if they can't do anything about it. For example, if a post was just removed, it's better to show "Failed to like: the post no longer exists" instead of a generic "Failed to like". Otherwise, the user will just keep trying to like the post again, and again, without understanding why it doesn't work.

I'm not even going to waste my time commenting on that "security perspective" part of your comment. What an insane take.

romsharkNov 28, 2026, 3:17 PM
> For example, if a post was just removed, it's better to show "Failed to like: the post no longer exists"

Why does your UI provide a like button for a removed post in the first place?

I mean, I get it, it could be a stale view you're interacting with; and yes, your error message is better than a generic one. But that doesn't mean you're exposing all error details to the user, you're just providing better error responses.

I guess the misunderstanding is coming from the "actual error" not being clearly defined.

P.S. The stale view can be solved by having live updating pages using SSE like the CQRS architecture that https://data-star.dev promotes. But if you're dealing with eventual consistency on a big scale then yes, it might not be solvable and better error messages is the best you can do.

romsharkNov 28, 2026, 12:35 AM
You can't always be honest on that one because you don't want to expose too much private information to external attackers, right? Anyway, that's another topic :)
rabeehanzlaNov 28, 2026, 5:50 AM
[dead]