commerce icon indicating copy to clipboard operation
commerce copied to clipboard

Search page loading state does not reappear after initial search

Open TonsiTT opened this issue 1 year ago • 2 comments

Searching for something in the search bar will take you to the /search route and show the loading state. However, further searches from the /search route do not show the loading state again. It is more of an issue. on slower internet devices where it would seem as if the webpage is stuck since there is no indicator otherwise to show it is fetching data in the background and getting new results

Any way to force the loading state again after the search parameter in the URL changes?

TonsiTT avatar Jul 27 '23 19:07 TonsiTT

I have Chrome throttled to 100 kbit/s in this video. I think I see what you're talking about here. You'll see when I switch from shirt to hat, the titles on the cards change nearly instantly, but the pics take a few seconds to reload with the right images.

Is this what you're seeing or something different?

https://github.com/vercel/commerce/assets/446260/9ec02872-c1b3-4dc5-a751-813d3e954451

manovotny avatar Aug 02 '23 02:08 manovotny

When you initially go to shirt, there is a loading skeleton, as seen in the photo. However, going from shirt to hat, it doesn't reappear. If fixed, it would solve the issue of reloading with the correct images. IMO, a skeleton should reappear every time the search param changes like shirt to hat

image

TonsiTT avatar Aug 02 '23 06:08 TonsiTT

We'll likely move to this pattern: https://buildui.com/posts/instant-search-params-with-react-server-components

leerob avatar Mar 31 '24 14:03 leerob