Skip to content

Stop the command listings overflowing their card - #31

Merged
barkz merged 1 commit into
mainfrom
fix/command-listing-overflow
Sep 12, 2026
Merged

barkz merged 1 commit into
mainfrom
fix/command-listing-overflow

Conversation

@barkz

@barkz barkz commented Sep 12, 2026

Copy link
Copy Markdown
Owner

The bug

What you can do and the Glean Personal listing were 96-character, space-aligned text code 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:

  • They wrap instead of scrolling, at any width
  • The two continuation rows (a line of spaces, then an arrow) are gone
  • GitHub gets the same fix; those blocks scrolled sideways on a phone there too

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-type split after the dashes. word-break: keep-all suppresses that, with overflow-wrap: break-word left 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

Before After
Widest code line on the page 96 chars 70 chars
Listings that scroll sideways 2 0

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

"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>
@barkz
barkz merged commit 0dee93f into main Sep 12, 2026
7 checks passed
@barkz
barkz deleted the fix/command-listing-overflow branch September 12, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant