Stop the command listings overflowing their card - #31
Merged
Merged
Conversation
"What you can do" and the Glean Personal listing were 96-character space-aligned code blocks. A <pre> scrolls rather than wraps, so below roughly 830px of content width the commands ran past the edge of the card and had to be dragged sideways to read — which is what they did on any window narrower than about 850px. Both listings are command/effect pairs, so they are tables, not code blocks. As tables they wrap, they never scroll, and the two ugly continuation rows (a line of spaces and an arrow) are gone. GitHub gains the same fix — those blocks scrolled sideways on a phone there too. The builder tags a table whose every row leads with a code span as a command table, so the stylesheet can give the command column half the width and style it as code rather than bold prose. Two line-breaking details in that column: hyphens are Unicode break opportunities, so "--object-type" split after the dashes until word-break: keep-all went on, with overflow-wrap as the fallback for a token wider than the column. The quickstart block kept its terminal framing but lost its widest line: the "or use a token" aside moved into prose below it. The widest code line on the page is now 70 characters, down from 96, and a test fails if any block goes past 80 again. Tests: 1,090 -> 1,094. Co-Authored-By: Claude Opus 5 (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.
The bug
What you can do and the Glean Personal listing were 96-character, space-aligned
textcode blocks. A<pre>scrolls rather than wraps, so below roughly 830px of content width the commands ran past the card edge and had to be dragged sideways to read — which happened on any window narrower than about 850px.I had measured the earlier fix at 1280px, where they fit, and missed it.
The fix
Both listings are command/effect pairs — tabular content that was being held in a code block by space alignment. They're tables now:
The builder tags any table whose every row leads with a code span as a command table, so the stylesheet can give the command column half the width and set it as code rather than bold prose.
Two line-breaking details
Hyphens are line-break opportunities in Unicode, so
--object-typesplit after the dashes.word-break: keep-allsuppresses that, withoverflow-wrap: break-wordleft as the fallback for a token wider than the column.Quickstart
Kept its terminal framing but lost its widest line — the "or use a token" aside moved into prose underneath, where it reads better anyway.
Result
A new test fails if any code block on the built page goes past 80 characters again, so this can't come back quietly.
Verified by rendering the section alone at 1100px and 900px.
Ran 1094 tests — OK(1,090 before).🤖 Generated with Claude Code