feat(html): let a page set its own body margin and background - #683
Merged
Conversation
The text view was the last one still on its first styling: a browser default monospace against a three-pixel grey rule, no page padding, and line numbers that drifted off their lines the further down the file you read - the script sizing the number cells rounded a fractional line height per cell. Restyle it against the palette the xml, filesystem and sheet views already use, pin the line height to a whole pixel, measure the lines with `getBoundingClientRect`, keep the numbers out of a selection of the page, and mark the hovered line across both columns. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJYhr3t6QBamsHRfZ7gPDw
Every view but the pdf one and the text one read the browser's default
sheet for the body box, so a file listing, a source view or an image
opened inset by an eight-pixel white border nobody had asked for.
Each stylesheet now states `body{margin:0;background:...}` itself -
spelled out even where `*{margin:0}` already covered it - and the image
and font pages, which shipped no body rule at all, get one. The xml view
takes the space back as padding on its own container; the font specimen
keeps its eight pixels, now as padding of its own.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJYhr3t6QBamsHRfZ7gPDw
andiwand
enabled auto-merge (squash)
August 10, 2026 18:41
andiwand
disabled auto-merge
August 10, 2026 18:42
This was referenced Aug 11, 2026
andiwand
added a commit
that referenced
this pull request
Aug 14, 2026
A frame took its placement from its wrap alone, so one anchored to the page floated into the running text: a letter's address, date and footer boxes landed between the paragraphs instead of in their fields. Only a frame anchored in the text reads the wrap now; one anchored to the page sits at its own coordinates on it. The reference output also picks up the shipped css and js, which had drifted from what the engine emits since #679, #682, #683 and #685 - the same html rendered differently there than freshly generated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8PCMZUVxuGstmmgQzEdif
andiwand
added a commit
that referenced
this pull request
Aug 14, 2026
A frame took its placement from its wrap alone, so one anchored to the page floated into the running text: a letter's address, date and footer boxes landed between the paragraphs instead of in their fields. Only a frame anchored in the text reads the wrap now; one anchored to the page sits at its own coordinates on it. The reference output also picks up the shipped css and js, which had drifted from what the engine emits since #679, #682, #683 and #685 - the same html rendered differently there than freshly generated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8PCMZUVxuGstmmgQzEdif
andiwand
added a commit
that referenced
this pull request
Aug 14, 2026
A frame took its placement from its wrap alone, so one anchored to the page floated into the running text: a letter's address, date and footer boxes landed between the paragraphs instead of in their fields. Only a frame anchored in the text reads the wrap now; one anchored to the page sits at its own coordinates on it. The reference output also picks up the shipped css and js, which had drifted from what the engine emits since #679, #682, #683 and #685 - the same html rendered differently there than freshly generated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8PCMZUVxuGstmmgQzEdif
andiwand
added a commit
that referenced
this pull request
Aug 14, 2026
…ut on the master page it names (#690) * fix(html): put a page-anchored frame on the page, not in the text A frame took its placement from its wrap alone, so one anchored to the page floated into the running text: a letter's address, date and footer boxes landed between the paragraphs instead of in their fields. Only a frame anchored in the text reads the wrap now; one anchored to the page sits at its own coordinates on it. The reference output also picks up the shipped css and js, which had drifted from what the engine emits since #679, #682, #683 and #685 - the same html rendered differently there than freshly generated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(odf): lay a text document out on the master page it names A text document took the first master page in the file. A paragraph may name the one its page uses (20.283), which is how a letter template asks for the margins that leave room for its letterhead - 9.85cm at the top of the DIN 5008 template, where the address boxes sit. One page box is all this renders, so only a name that still precedes every written word counts; taking a later one put a whole document on the landscape page a single section had asked for. Frames are passed over on the way: they are anchored, not written. 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.
🤖 Generated with Claude Code
Stacked on #682 — review that one first.
Follow-up to the text view: every view except the pdf one was reading the
browser's default sheet for the body box, so a file listing, a source view or an
image opened inset by an eight-pixel white border that is not ours.
Each stylesheet now states
body{margin:0;background:…}itself, spelled out evenin
document.css, where the*{margin:0}reset already covered it — the ruleshould be legible where you look for it.
image.htmlandfont.htmlshipped nobody rule at all and now get one.
Two pages take the space back deliberately rather than losing it:
start against the window edge;
Backdrops that were a choice stay as they were: pdf and video on their dark
grounds, a sheet on its canvas, a paginated document on its grey.
test/data.cmakeadvances the private reference-output pin: the twelve fontspecimen pages carry the new body rule.
otf/ttfare the only outputs thatchanged — the full suite is otherwise byte-identical on both repos.
Checked in Chrome: text, xml, file listing, image, sheet, paginated odt.