From 6565a506667b342795b5c04e5255fd011f2b36aa Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 16 May 2026 10:26:09 +0000 Subject: [PATCH] fix(mobile): prevent horizontal page scroll on /stats and /mcp Long URLs in MCP page tables (e.g. `npx @modelcontextprotocol/inspector ...`) have no break opportunities, forcing the auto-layout table wider than a mobile viewport. The viewport scroll then persisted across SPA navigation, so returning to / arrived with the page horizontally offset and the left edge clipped. - inlineCodeSx: add `overflowWrap: anywhere` so URLs/commands wrap inside TableCells instead of pushing the table past viewport width. - tokens.css: add `overflow-x: clip` on html/body as a safety net for any other wide element. `clip` (not `hidden`) keeps the sticky masthead working since it doesn't create a scroll container. - RootLayout: also reset window.scrollX on route change so a leftover offset from one page doesn't carry into the next. --- app/src/components/RootLayout.tsx | 7 +++++++ app/src/pages/McpPage.tsx | 3 +++ app/src/styles/tokens.css | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/app/src/components/RootLayout.tsx b/app/src/components/RootLayout.tsx index df5595124d..7f04c7048a 100644 --- a/app/src/components/RootLayout.tsx +++ b/app/src/components/RootLayout.tsx @@ -49,6 +49,13 @@ export function RootLayout() { window.scrollTo(0, 0); }, [pathname, hash, navigationType]); + // Always reset horizontal scroll on route change. If a previous page leaked + // page-level horizontal scroll (e.g. a wide table on mobile), the offset + // otherwise persists into the next page and clips its left edge. + useEffect(() => { + window.scrollTo({ left: 0, top: window.scrollY }); + }, [pathname]); + return (