Skip to content

Start slightly-wide blocks at the prose's edge, at 100 columns of code - #3788

Merged
max-sixty merged 8 commits into
mainfrom
diff-default-width
Oct 24, 2026
Merged

max-sixty merged 8 commits into
mainfrom
diff-default-width

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

data-width="wide" becomes one width for any block a little wider than the reading column. Such a block starts at the prose's left edge and extends right, up to 840px (--wide, down from 1080px), which shows 100 columns of code in a diff with four-digit line numbers. Where the room on its right runs short, the block narrows and keeps the prose's edge. Below the column's width it is the column, and right-to-left pages mirror all of this. available is unchanged: it takes all the room, centred on the prose.

The maintainer asked for the generally accepted treatment of slightly-wide content rather than a rule for diffs. They accepted either sharing the prose's left edge or centring with line numbers hanging in the margin. Sharing the edge depends only on the block's box, so one rule covers every kind of block. Hanging the gutter would need each widget's own text offset: 61px into a diff, about 48px into lf-code, a table's cell padding. Tufte CSS's fullwidth figures and tables, Tufte-LaTeX's fullwidth environment and Quarto's -right column variants all extend from the text's left edge into the right margin.

  • Diffs: lf-diff and lf-worktree-diffs declare x-space: wide and have no rule of their own. lf-code declares nothing, so an author adds data-width="wide" for long lines.
  • Boards: lf-board now declares available. At 840px a four-column board scrolled its last column. On a column page a board now spans both margins, and the triage example looks as it does on main.
  • Blocks already marked wide: every figure, chart, image and table marked wide is now 840px from the prose's edge rather than 1080px centred, so wide tables wrap their cells sooner. examples/alert-review.html caps its tabs at var(--wide), so those tabs are narrower.
  • Comment markers: a wide block extends up to 120px into the right margin, so a marker level with it can sit over the block's line ends.
  • Docs: the authoring contract is in page-layout.md, "Bounds and widths". The browser/layouts.css header records the decision and the centred geometry it replaces.

Checks:

  • In the delivered page, a diff, a code block and a table each measure 840px at 1280, 1440 and 1920 in Chromium and at 1440 in Firefox, and their left edge matches the prose's to 0.00px. At 1000 the block is 836px with the same edge, and on a phone it is the column. Nothing scrolls sideways at any width.
  • The table-placement test covers all three engines and both text directions, and the render-gate and page-rendering tests pass test by test. pnpm run check:browser passes.
  • leaf-dev stills --authored ran on 26 states likely to move.
  • Not run: dark-scheme captures, since the change moves boxes and touches no colours.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 7 commits October 22, 2026 22:24
`lf-diff` and `lf-worktree-diffs` declared no `x-space`, so on a column page a
patch filled the 720px reading column: about 88 columns of code, where Markdown
lines wrapped two or three times. Both now declare `wide`, so a diff takes the
capped 1080px evidence width (about 136 columns; 128 inside a worktree card)
wherever the window has room, and an author no longer has to remember
`data-width`.

`wide` rather than `available`: across the last 400 commits of three repos,
0.1% of code lines pass 133 columns, so code gains nothing from more width,
while Markdown that keeps a paragraph on one source line would read as lines of
220 to 300 characters at 1920 to 2560px windows. `data-width="available"`
still asks for everything on a page that wants it.

`lf-worktree-diffs` declares it too because a diff inside an `lf-worktree`
card stands in from the column and so is kept to the card; the collection
breaks out instead and its diffs fill it. Commentary inside the card keeps the
reading measure. A diff in a section or `details` breaks out; one in a list
item, callout or arranged box keeps to that box, as before. Sidebar pages are
unchanged, since a diff there already filled the body.

The worktree-diffs example drops its own CSS that widened the column for its
diffs, and the page-layout and page-authoring references name a diff among the
blocks that declare their width instead of one that needs `data-width`. The
stills catalogue gains the gallery's long-line patches and the worktree
collection, which no state reached.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A block given `wide` (x-space or data-width) now starts at the prose's
start edge and grows toward the end, up to --wide, which drops from
1080px to 840px: the width at which 100 columns of code read unwrapped in
a diff, the widest code gutter Leaf draws. It grows only into the end
side's free room, so where that runs short it narrows and keeps the
prose's edge. `available` keeps spanning both margins about the prose's
axis.

The centred 1080px breakout matched neither the title's nor the prose's
left edge, which the user found ugly for code needing only a little more
than the column. Hanging a block's gutter into the left margin, so its
text met the prose's edge, was rejected: where a block's text starts is
each widget's own fact, so it would need a rule per widget. This reverses
the 2026-10-16 record in layouts.css that rejected a shared left edge.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A board, a granted obligation, an authored wide section and a wide table
now start at the prose's start edge at 840px rather than centring at
1080px. The undeclared widget beside the board is a code block, since a
diff now declares wide. A wide table joins the table placement test in
both directions and every engine.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
An iframe and an lf-ask granted wide now grow past the prose's end, so
the gate tests measure growth there. The frame sized wider than the prose
but short of the room is now 110%, since 130% of the column passes the
840px cap and the cap keeps it on its grant.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
At 840px a four-column board scrolled its last column, as the triage
example's did in a sidebar page's body. A board is a surface whose
columns use what room there is, as boards in project tools fill the
window, so lf-board declares `available` rather than the slightly-wide
width. On a column page it now spans both margins; in a sidebar page's
body it fills the body, as it did at 1080px there.

The width test now reads all three kinds on one page: the board fills
the room, a diff starts at the prose's edge and stops at --wide, and a
code block keeps the column.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing lf-board to available leaves the diagram test asserting that the board stops at --wide. On this head, that test fails with a board width of 1872px against the new 840px cap. Its board assertion and explanation need to reflect the new available behavior while retaining the diagram's natural-width and scrolling checks. I can push that mechanical test update if helpful.

Comment thread skills/leaf/references/page-layout.md Resolved
…wide starts at the start edge

The board now declares available, so the diagram test's control declares wide itself; the reference and the site said left and right where RTL pages mirror. Formats the test file with the repository's hook.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 85cc561 into main Oct 24, 2026
5 checks passed
@max-sixty
max-sixty deleted the diff-default-width branch October 24, 2026 06:37
leaf-agent added a commit that referenced this pull request Oct 24, 2026
The [main CI
run](https://github.com/max-sixty/leaf/actions/runs/40072986191) failed
three layout cases because their assertions still expected the old
`wide` measure. #3788 changed `--wide` from 1080px to 840px and aligned
wide blocks with the prose's start edge. The rail test now checks the
current measure plus its page padding; the pictured-options test checks
that widening gives both pictures more room without requiring the old
480px size.

The fourth failure in that run, a margin marker corner assertion, was
updated by #3796 and passes on current `main`. The three changed cases
failed before this patch and pass after it in focused Chromium runs (`uv
run pytest -q -n0` with those node IDs). The preceding main run at
a550f98 passed these tests before #3788 landed.

Co-authored-by: leaf-agent <[email protected]>
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.

2 participants