by rpastuszak · 3y ago · 0 comments
One piece of feedback: the UI would feel more snappy if there was a way of applying optimistic updates/signalling to the user the loading state. I'm not an htmx expert but I think you can do that with alpine.
Example:
When I click on the feed item, there's a short delay before the UI updates itself with page content. Sometimes the delay can take a few seconds.
Ideally, I'd see a simple loading indicator or an animation signalling the loading state, even greying out the element would be enough.
(In that particular case you could probably cheat a bit with CSS, by styling the :active state of the list item element, and then adding a very slow transition. But, that doesn't solve the general issue)
Edit:
Thanks @anyone explaining that this is achievable with `hx-indicator`. I never learn by just reading the docs so I guess I need to build sth with htmx.
https://htmx.org/attributes/hx-indicator/
depending on how aggressive you want to get, you can use the preload extension to make the responses snappier:
https://htmx.org/docs/#view-transitions
for now css transitions are more widely supported though: