- Images render inline via NSTextAttachment (scaled to 480pt, alt as
caption); the hover popover and its ImagePopoverView are gone.
- Vertical rhythm per the author's measurements: lineHeightMultiple 1.25,
1 line after paragraphs, 2 after headings (all block styles).
- Table cells breathe: mono pad 2→3 per side; decoration offsets measure
with the same pad so the grid still lands on the text.
- Margins: lineFragmentPadding 12→24 (reading + editing), inset height 24.
- Image URL resolution hoisted into blocks(for:) — the attachment loads
the resolved path, document() no longer re-resolves.
Frames arrive in CONTAINER space; the view draws text at
textContainerOrigin + frame. The missing +origin.y (inset height 20)
drew every decoration 20pt too high — hairline ending above the quote,
grid compressed over the table's top rows. Translate once, per-frame.
The reading canvas runs TextKit1 (textLayoutManager nil — the scroll-view
config path engages the TK1 bridge), so the TK2 fragment walk found
nothing and draw() bailed: no hairline, no grid. framesForRange() now
measures through whichever engine is live — TK2 fragments, else TK1
boundingRect per character line (lineFragmentRect returns degenerate
rects mid-layout; boundingRect is truthful, pixel-verified).
Headless pixel probe (temporary, deleted): quote hairline + table grid
lines render at the right coordinates.
The TK1-compat layoutManager reports wrong rects under TextKit2 — the
table grid drew compressed above its text, the quote hairline landed
mid-heading. fragmentFrames(for:) walks NSTextLayoutManager fragments
(the engine's own frames, document order): quote hairlines span the
block, HRs center on their line, table verticals span all rows and
horizontals underline every grid line.
NSTextBlock/NSTextTable layout is broken on this TextKit build regardless
of engine: textBlocks zero-width the line rect (quotes wrapped one
character per line), NSTextTable rows stack vertically with no grid
(tables rendered as concatenated text with a stray outline). The TextKit1
bridge attempt failed live too. Stop fighting the API:
- Presenter emits plain content: quotes indent-only, HR a thin invisible
line, tables mono-space-padded grid text with alignment honored.
- Each Block/Bound carries a Decoration payload (quote indent, rule,
table column offsets); ReadingCanvasView.draw renders hairlines,
rules, and table grids from measured layoutManager geometry.
- Tests assert decorations + column alignment instead of textBlocks.
Full suite green; lint clean.
Five root causes behind Alexander's calibration findings:
- Wrap to column: both canvases had a fixed 640pt text container —
clipped instead of wrapping when the editor column is narrower
(library + mentor open). widthTracksTextView = true now; measure
polish can return with calibration.
- Tables: TextKit2 stacks NSTextTable rows vertically (each row its
own content-width fragment — no grid). The reading canvas forces
the TextKit1 bridge (replaceLayoutManager); probe-verified grid +
column borders. Read-only canvas — nothing editing-grade lost.
- Heading-tail: a chunk like "# Title" followed by body lines (single
newline, legal markdown) dropped everything after line one. The
heading now renders, then the remaining lines as a soft-joined
paragraph.
- Stale reload (data-loss vector): ProseTextView seeded from
session.loadText (open-time snapshot) — after a reading⇄editing
swap the recreated editor showed the pre-paste text, and a keystroke
there flushed stale content over the user's real edits. Seeds from
session.text (live) now.
- Quote one-char-per-line: did not reproduce after the layout fixes;
root cause was the broken layout state above.
EditorSessionTests debounce flake (50ms margin under parallel load)
passed on both re-runs — timing margin, not a regression.
Full suite green (94 unit + UI smoke); lint clean.