The webui uses the declarative <BrowserRouter>, leaving back/forward scroll restoration to the browser (a small custom component, src/layout/scroll-to-top.tsx, only covers scroll-to-top on forward navigation, which the declarative router does not provide). The limitation: on a same-document pop the browser restores the stored offset synchronously at popstate, while the outgoing page is still in the DOM — react-router v7 commits the new location inside startTransition a frame later — so the landing position is clamped to the outgoing page's height and never corrected. Navigating back from a short page to a long, deeply scrolled list therefore lands well above where the user left, and no layout work can fix it since the destination is not rendered when the browser restores.
The intended fix is migrating the default app to a data router (createBrowserRouter + RouterProvider) and mounting react-router's first-party <ScrollRestoration/>, which restores after the destination commits; that also replaces the custom component (forward links switch from the preserveScroll state to the built-in preventScrollReset).
The webui uses the declarative
<BrowserRouter>, leaving back/forward scroll restoration to the browser (a small custom component,src/layout/scroll-to-top.tsx, only covers scroll-to-top on forward navigation, which the declarative router does not provide). The limitation: on a same-document pop the browser restores the stored offset synchronously at popstate, while the outgoing page is still in the DOM — react-router v7 commits the new location insidestartTransitiona frame later — so the landing position is clamped to the outgoing page's height and never corrected. Navigating back from a short page to a long, deeply scrolled list therefore lands well above where the user left, and no layout work can fix it since the destination is not rendered when the browser restores.The intended fix is migrating the default app to a data router (
createBrowserRouter+RouterProvider) and mounting react-router's first-party<ScrollRestoration/>, which restores after the destination commits; that also replaces the custom component (forward links switch from thepreserveScrollstate to the built-inpreventScrollReset).