Monorepo for Tangled โ€” https://tangled.org

Optimistic UI #278

open
opened by boltless.me

atproto request takes time. because the appview needs to update both DB and PDS on each request, most tangled interactions feels slower than traditional alternative services.

I don't know this is possible with HTMX, but optimistic instant UI updates can make UX way better.

For example, increment the reaction counter instantly on request, assuming the request succeed.

what would the failure mode here look like? some approaches i've seen: bsky's client applications tend to ignore errors in some cases (liking a post without internet access just fails without notice), but some other actions fail with a toast notification.

my opinion on this is that we avoid htmx magic, but instead make the atproto bits of the handler asynchronous:

Handler() {
    // do db work
    db.Set(newState)
    go pds.Set(newState) onError { db.Set(oldState) }
}

to notify the user of a failure, we could use htmx-wss to send a toast notification. the trickier part is to revert the client state update, for example: starring a repo when the PDS is down would require us to send a toast and "unstar" the repo so that the user can try again.

Makes sense. I like this approach.

sign up or login to add to the discussion
Labels
performance
area
appview
assignee

None yet.

Participants 2
AT URI
at://did:plc:xasnlahkri4ewmbuzly2rlc5/sh.tangled.repo.issue/3m3qz75kexs22