nteract / semiotic

A data visualization framework combining React & D3
https://semioticv1.nteract.io/
Other
2.43k stars 133 forks source link

Restore scroll position for navigation; move vercel config to the root #596

Closed alexeyraspopov closed 2 years ago

alexeyraspopov commented 2 years ago

Currently, the new semiotic.nteract.io has two minor issues:

  1. When navigating, the page preserves scroll position, instead of going to the top of the new page
  2. When refreshing the page on non-Home page, the user gets 404 page

Trying to quickly fix these in the PR

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nteract/semiotic/8tzH4zARTw1Q2ZfzUD5DEJHifPSf
✅ Preview: https://semiotic-git-scrollandrefresh-nteract.vercel.app

alexeyraspopov commented 2 years ago

@emeeks @willingc it took some unexpected effort, but it works now: https://semiotic-git-scrollandrefresh-nteract.vercel.app/. The index.html fallback wasn't quite obvious, but I guess there is a lot of stuff from "now.json" being deprecated so the new vercel.json is only about the route rewrites. As for scroll restoration, it appeared to be tricky because I didn't expect the website to use a container scroll instead of a body scrolling. So I did some CSS tweaks to use body scroll. It should additionally improve scrolling experience since overflow scrolling is known to be not as optimized as the body scroll.