From be655f9fcf51a30dcab6306e0f351dc7f2cdcdd0 Mon Sep 17 00:00:00 2001 From: weishu Date: Sat, 20 Dec 2025 21:45:45 +0800 Subject: [PATCH] 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. --- web/src/router.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/router.tsx b/web/src/router.tsx index 933fbf1e..c74e1e29 100644 --- a/web/src/router.tsx +++ b/web/src/router.tsx @@ -240,7 +240,11 @@ export const routeTree = rootRoute.addChildren([ type RouterHistory = Parameters[0]['history'] export function createAppRouter(history?: RouterHistory) { - return createRouter({ routeTree, history }) + return createRouter({ + routeTree, + history, + scrollRestoration: true, + }) } export type AppRouter = ReturnType