Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigate to url before GETting shadow endpoint #6348

Closed
Maxson52 opened this issue Aug 27, 2022 · 3 comments
Closed

Navigate to url before GETting shadow endpoint #6348

Maxson52 opened this issue Aug 27, 2022 · 3 comments

Comments

@Maxson52
Copy link

Describe the problem

When navigating to another page one the client-side navigation has taken over, any shadow endpoints will be loaded before updating the URL in the browser. This makes for a less than amazing UX as it can seem like link clicks didn't register or the site is broken, especially when a shadow endpoint takes a while to load.

Describe the proposed solution

A solution could be to update the URL in the browser before executing the GET of the shadow endpoint. One (possible) downside would be the page title from <svelte:head> wouldn't update until the shadow endpoint finishes which could cause some confusion.

Alternatives considered

Just use the navigation store to show the end user that there is content being loaded.

Importance

nice to have

Additional Information

No response

@kristjanmar
Copy link

Are you using sveltekit:prefetch on your links? That makes the endpoints run as soon as the user hovers over the link.

I use prefetching and then the nprogress library to show a visual indicator of page loading, so a blue progress bar shows at the top of the screen as soon as the person starts navigating.

@Maxson52
Copy link
Author

Maxson52 commented Aug 28, 2022

Using prefetch definitely helps in many situations. A solid alternative solution.

But there are still times when data takes longer to load (or there's less time to prefetch for one reason or another) and it would make the experience better to have the URL change and then show the loading indicators I think.

@Conduitry
Copy link
Member

This current behavior is intentional. See the discussion in #4070 where this was changed.

@Conduitry Conduitry closed this as not planned Won't fix, can't repro, duplicate, stale Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants