predictive preloading: pointer velocity predicts the click, preload the route first#630

opened23h agobyMMalek Gara-Hellal

use pointer velocity and trajectory to predict which link or row you are about to click and preload its route data before the click lands (ForesightJS does exactly this: https://foresightjs.com). the repo uses its own router (apps/player/src/lib/router.ts, not TanStack Router), so the hook is: on predicted intent call the page's react-query prefetch (queryClient.prefetchQuery for albums, artists, playlists) and preload the lazy page chunk. only on fine pointers (touch has no hover), cap concurrent prefetches, respect data saver, and measure the click-to-content time before and after on the mock server.