fix(content): stop wide markdown tables breaking the mobile layout - #5984
Conversation
Library and blog posts render GFM tables straight into the prose container with no width bound. Comparison tables run up to nine columns, so on a phone the table set the article's content width and body copy was clipped at both edges with no way to scroll to it — the table simply ran off the canvas. 19 of 20 library posts contain a table. Wraps tables in an `overflow-x-auto` container so that scrolling is confined to the table's own axis, and gives the table a `min-w` so columns do not crush to one word per line inside it. Both surfaces share `mdxComponents`, so this covers blog posts too. Also adds `lib/**` to Tailwind's content globs. `lib/content/mdx.tsx` emits classes like any component, but only `app`, `components`, and `pages` were scanned, so a class unique to that file was silently never generated — `min-w-[520px]` here, and already `list-outside`, `text-[19px]`, and `text-[0.9em]` on the existing paragraph and list styles. Verified against a real browser: without the glob the rule is absent and computed `min-width` stays `0px`. Generated CSS grows 538 bytes minified (+0.26%), all additions, nothing removed.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Tailwind now scans Reviewed by Cursor Bugbot for commit 1f4147b. Configure here. |
Greptile SummaryFixes wide Markdown tables on mobile:
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/content/mdx.tsx | Adds localized horizontal scrolling for wide Markdown tables and fully resolves the prior table-props typing concern. |
| apps/sim/tailwind.config.ts | Extends Tailwind content discovery to utility classes used by components under the Sim app’s lib directory. |
Reviews (2): Last reviewed commit: "chore(content): type the table renderer ..." | Re-trigger Greptile
Uses `ComponentPropsWithoutRef<'table'>` so the destructured and forwarded props are checked. The surrounding renderers in this file still take `any`; converting them is a separate cleanup, not something to fold into a mobile layout fix.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 1f4147b. Configure here.
Summary
Reported on mobile for /library/ai-agents-in-procurement.
overflow-x-autocontainer so scrolling is confined to the table's own axis, plus amin-wso columns don't crush to one word per line inside itmdxComponentsmap viacreateContentRegistry, so one fix covers both surfacesThe Tailwind part
min-w-[520px]initially did nothing.apps/sim/tailwind.config.tsscanned onlyapp,components, andpages— notlib— solib/content/mdx.tsxwas invisible to Tailwind and any class unique to it was never generated.That was not a stale-cache artifact; I isolated it in a clean worktree with
.nextremoved:min-widthmdx.tsxfix only0pxmdx.tsxfix +lib/**glob520pxIt also means existing styles in that file were already silently dead —
list-outside,text-[19px],text-[0.9em],my-0were all missing from the generated CSS, which is why the file leans on inlinestylefor font sizes. Adding the glob grows the CSS by 538 bytes minified (+0.26%), all additions, nothing removed.Verification
Driven in a real browser (Chromium, iPhone viewport + tablet + desktop) against pages with 3, 4, and 9 column tables:
No page scrolls horizontally at any viewport, and narrow tables gain no scrollbar on tablet/desktop, so there's no regression for tables that already fit. Blog verified by temporarily un-drafting
blog/copilotlocally (it'sdraft: true, so it 404s otherwise) — same wrapper, same result.Note
The scroll edge has no visual affordance (fade or shadow) hinting the table scrolls. Worth a follow-up, but out of scope here.
Type of Change
Testing
Tested manually in a browser across three viewports and four posts, as tabled above.
Checklist