Mobile: stop the conversation scrolling sideways - #71
Merged
Conversation
Reported from a phone: the rendered conversation scrolls horizontally, and the scroll is not needed. Two separate causes, measured at a 390px viewport rather than read off the CSS — the page itself never scrolled, `.cxv-body` and the answer did. **The prompt band, 6px.** #49 gave the band a full bleed with `margin-right: -14px` matching `.cxv-body`'s 14px padding, but the phone breakpoint narrows that padding to 8px. The band stayed 14px wide into an 8px gutter, so the reading column was 6px wider than its own scroller. The gutter is now `--cx-gutter` and the bleed is `calc(-1 * var(--cx-gutter))`: one number per breakpoint, and the band cannot drift from it again. **Prose that could not wrap, 282px.** A URL and a long identifier are each one unbroken word, and one long word makes a paragraph wider than a phone pane. `.markdown` sets `overflow-y: auto`, which makes the other axis a scroller too, so the answer itself became draggable sideways. Prose now wraps (`overflow-wrap: anywhere` on p/li/blockquote/headings and on inline code, not on code inside `pre`). What deliberately still scrolls, inside its own box: `pre` (796px of content at this viewport) and `table` (217px). Wrapping a line of code to fit would change what it says, and `overflow-x: hidden` on a parent would clip the columns of a table people need to read. Verified with playwright at 320/390/768px, at 100% and 200% reader zoom: no horizontal scroll room on the page, on `.cxv-body`, on `.cxv-col` or on the answer, and `pre`/`table` still scroll. Desktop reader and the Overview card are pixel-identical before and after apart from the animated status dot in the footer (56 of 1.15M pixels, an 8×8 box). Server and web suites green. Co-Authored-By: Claude Opus 5 <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.
Reported from a phone: the rendered conversation scrolls horizontally, and the scroll is not needed. Measured at a 390px viewport with playwright rather than read off the CSS — the page never scrolled; the reading column and the answer did, for two unrelated reasons.
What was actually overflowing
.cxv-body(the reading column)margin-right: -14px, matching.cxv-body's 14px padding — but the phone breakpoint narrows that padding to 8px. 14px of bleed into an 8px gutter = 6px wider than its own scroller..markdown.cx-md(the answer).markdownsetsoverflow-y: auto, which makes the other axis a scroller too, so the answer became draggable sideways.Found causally, by neutralising each suspect on the live page and re-measuring, not by guessing from the stylesheet:
The fix
--cx-gutteron.cxv-body(14px, 8px on a phone) pays out both the padding and the band's bleed, so the two cannot drift apart at a breakpoint again.overflow-wrap: anywhereonp/li/blockquote/headings and on inlinecode— not on code insidepre.pre(796px of content at this viewport) andtable(217px). Nooverflow-x: hiddenon a parent anywhere — that hides the symptom and clips columns people need to read.Verification
320 / 390 / 768px, each at 100% and 200% reader zoom — no horizontal scroll room on the page, on.cxv-body, on.cxv-col, or on the answer;preandtablestill scroll:Before → after, same 390px viewport (the long identifier now wraps onto a second line instead of running off the edge; the table still scrolls in its own box):
/tmp/hscroll-before-table.png/tmp/hscroll-after-table.pngUnchanged elsewhere, which matters because #37 made this renderer shared: the desktop reader and the Overview card are pixel-identical before and after apart from the animated status dot in the footer — 56 differing pixels out of 1.15M, in one 8×8 box. Desktop geometry is identical too (band right edge still flush with the column's,
.cxv-body972 client / 972 scroll).Server and web suites green.
🤖 Generated with Claude Code