WICG / soft-navigations

Heuristics to detect Single Page Apps soft navigations
https://wicg.github.io/soft-navigations/
Other
46 stars 6 forks source link

Product option choice considered a soft navigation #7

Open yoavweiss opened 1 year ago

yoavweiss commented 1 year ago

crbug/1371927 outlines a few examples where the heuristic's result is arguably a false positive: product options where the user clicks to e.g. change the item's color result in a URL change and a DOM modification, and hence are considered a soft navigation.

More research is needed to see if this can be avoided.

yoavweiss commented 1 year ago

After looking at the examples again, I'm less confident that it's a false positive:

So it seems like it may be reasonable to consider this a soft navigation to a similar (yet different) product page.

^^ @anniesullie

tunetheweb commented 1 year ago

I agree. To me there's a user interaction, a state change, a UI change, and a URL change. That to me seems like it should be a soft nav.

The only concern is if there is not a navigation history. On the Walmart example, for example, clicking back does not take me to the previous option selection.

So, rather than a URL update, should we insist on a URL pushState and exclude replaceState? Perhaps that should be a separate issue though...

anniesullie commented 1 year ago

So it seems like it may be reasonable to consider this a soft navigation to a similar (yet different) product page

Would love to collect a list of issues like this where it's a bit subjective whether it's a navigation and hear working group feedback!

yoavweiss commented 10 months ago

The reliance on contentful paints should potentially help here. If we see a bunch of cases where the change is "too small" to be considered a navigation, we could add a limit based on the %age of viewport changed. However, experiments with that approach did not prove particularly useful.