SalesforceCommerceCloud / pwa-kit

React-based JavaScript frontend framework to create a progressive web app (PWA) storefront for Salesforce B2C Commerce.
https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/pwa-kit-overview.html
BSD 3-Clause "New" or "Revised" License
284 stars 134 forks source link

[FEATURE] Improve behavior of keepPreviousData PLP/PDP #1449

Open ecRobertEngel opened 1 year ago

ecRobertEngel commented 1 year ago

Is your feature request related to a problem? Please describe. Currently for requests on PLP and PDP react-query uses keepPreviousData. This is great as long as you either navigate on a page this makes sense. e.g. on a PLP this works great for pagination on a PDP this works great for selecting colors or sizes

but: It feels very slow / laggy if you switch to a context there keepPreviousData does not make sense. e.g.: on a PLP switch to another category on a PDP switch to another product (using the recommenders at the bottom) sample page: https://pwa-kit.mobify-storefront.com/global/en-GB/product/22416787M

In those cases it might make more sense to not keep the data and show skeletons instead.

Describe the solution you'd like keepPreviousData should be set more dynamically and take into consideration if keeping the previous data really makes sense.

bfeister commented 1 year ago

@ecRobertEngel thanks, this is a good callout for UX improvement. I'll take a look at whether we can get a fix in for this

git2gus[bot] commented 11 months ago

This issue has been linked to a new work item: W-14508922