fix(mobile): prevent horizontal page scroll on /stats and /mcp#6902
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a mobile bug where /stats and /mcp could be scrolled horizontally, with the offset persisting across SPA navigation and clipping the landing page.
Changes:
- Add
overflowWrap: 'anywhere'to inline-code style inMcpPageso long URLs/commands wrap inside TableCells. - Add
overflow-x: cliponhtml, bodyas a defense-in-depth guard (preserves sticky positioning). - Reset
window.scrollXon route changes inRootLayoutso leftover horizontal offset doesn't carry between pages.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| app/src/pages/McpPage.tsx | Allow inline-code content to break, preventing tables from forcing horizontal overflow on mobile. |
| app/src/styles/tokens.css | Global overflow-x: clip on html, body as a viewport-level safety net. |
| app/src/components/RootLayout.tsx | Reset horizontal scroll position on pathname change. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
MarkusNeusinger
added a commit
that referenced
this pull request
May 18, 2026
Version bump for the v2.4.0 release. Release notes will be attached to the tag once this lands. ## Highlights since v2.3.0 - **R / ggplot2 added as the 10th library** + multi-language pipeline (#6944, #6961, #7052). 30 ggplot2 implementations landed across foundational plot types. - **In-app feedback widget** (#7143). - **Stats page** with Plausible visitors chart + daily-impl timeline (#6608). - **Language across the site**: `/plots?lang=` filtering, cross-language carousel, language in URLs and titles (#7141, #7142, #7144). - **UI polish**: pseudo-function styling for 404 / footer / empty state / library card (#6436); mobile fixes for `/stats`, `/mcp`, breadcrumb + FAB (#6902, #7283). - **Pipeline**: review-retry listener + stuck-jobs watchdog (#6084); daily-regen 2h → hourly (#6943). - **Dependencies**: mypy 1.20→2.1, urllib3 2.6→2.7, authlib bump, react/mui/python-minor groups. - ~1200 implementation regenerations across all 10 libraries. No SemVer-breaking changes. **Full Changelog:** v2.3.0...main 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On mobile,
/statsand/mcpcould be side-scrolled horizontally even though no visible content extended past the viewport. Worse, that scroll position persisted across SPA navigation, so returning to/arrived horizontally offset and the left edge of the landing page was clipped.Root cause
McpPage.tsxrenders MUI<Table>s with inline-code spans containing un-breakable URLs likehttps://api.anyplot.ai/mcp/andnpx @modelcontextprotocol/inspector https://api.anyplot.ai/mcp/. Defaulttable-layout: auto+ un-breakable mono-font content forces the table to ~530px wide — well past a mobile viewport.overflow-xguard, so wide content on any page leaks into viewport-level horizontal scroll.RootLayoutreset vertical scroll on route change but not horizontal scroll, so the offset from one page persisted into the next.Fix
app/src/pages/McpPage.tsx— addoverflowWrap: 'anywhere'toinlineCodeSxso URLs/commands break inside TableCells instead of forcing the table wider than the viewport.app/src/styles/tokens.css— addoverflow-x: cliponhtml, bodyas a defense-in-depth safety net.clip(nothidden) keeps the sticky masthead working since it doesn't create a scroll container.app/src/components/RootLayout.tsx— also resetwindow.scrollXonpathnamechange so any leftover offset doesn't carry into the next page.Test plan
yarn type-checkpassesyarn lintpasses (no new warnings)yarn test --runpasses forMcpPage,StatsPage,RootLayout/mcpand/statsno longer side-scroll/mcp→/no longer arrives horizontally offset/about,/legal,/Generated by Claude Code