Skip to content

feat(text): read a text file in a quieter gutter - #682

Merged
andiwand merged 1 commit into
mainfrom
feat/text-view-look
Aug 10, 2026
Merged

feat(text): read a text file in a quieter gutter#682
andiwand merged 1 commit into
mainfrom
feat/text-view-look

Conversation

@andiwand

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

The text view was the last one still on its first styling. text.css was five
lines: a browser-default monospace, a three-pixel grey rule for the gutter, and
no padding anywhere, so the file started in the top-left corner of the window.

It now uses the palette and the type the xml, filesystem and sheet views were
moved to — tokens, ui-monospace at 13px, a hairline rule, a washed gutter,
tabular-nums numbers.

Two things beyond the paint:

  • The numbers drifted off their lines. text.js sizes each number cell to
    its line so a wrapped line keeps its number, and it read offsetHeight, which
    is rounded. At a line height of 20.8px every cell was off by .2px and the
    columns were seven pixels apart by line 33. The line height is now a whole
    pixel and the measurement is getBoundingClientRect().height, which is not
    rounded.
  • The gutter is ours, not the file's, so it is user-select:none — select
    the page and you get the text without a column of numbers down the left.

The hovered line is marked across both columns: each line begins a viewport to
the left of itself and pads the text back, so its background reaches under the
number. Overflow to the left of the page does not scroll, so nothing moves.

No markup changed — the reference outputs are byte-identical, text.css and
text.js are not part of them.

Verified in Chrome on txt/open_document_reader_h.txt (code, unwrapped) and
txt/lorem ipsum.txt (prose, wrapped), including that the editor still inserts
lines and keeps the two columns aligned.

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
@andiwand
andiwand enabled auto-merge (squash) August 10, 2026 18:33
@andiwand
andiwand merged commit 4ab9d5d into main Aug 10, 2026
36 checks passed
@andiwand
andiwand deleted the feat/text-view-look branch August 10, 2026 18:40
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>
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