feat(web): enable scroll restoration in TanStack Router

Adds scrollRestoration: true to createRouter configuration to preserve
scroll position when navigating between pages, improving navigation UX
when switching between views like sessions list and session details.
This commit is contained in:
weishu
2025-12-20 23:20:30 +08:00
parent eac7ff239a
commit be655f9fcf
+5 -1
View File
@@ -240,7 +240,11 @@ export const routeTree = rootRoute.addChildren([
type RouterHistory = Parameters<typeof createRouter>[0]['history']
export function createAppRouter(history?: RouterHistory) {
return createRouter({ routeTree, history })
return createRouter({
routeTree,
history,
scrollRestoration: true,
})
}
export type AppRouter = ReturnType<typeof createAppRouter>