Skip to content
quarry View Ticket
Login

View Ticket

2026-09-24
00:55 • Ticket [a82ff129be] Window large file pages the way diffs already are status still Closed with 1 other change artifact: 41459c653a user: zeitgeist
2026-08-31
15:32 • Closed ticket [a82ff129be]. artifact: c8161d05c9 user: ai-local
11:53 • New ticket [a82ff129be]. artifact: f7bbb70d5a user: ai-local

Window large file pages the way diffs already are

Closeda82ff129be7ca850a04cc8453ab92b8dda2f227fCreated 91.5 days agoUpdated 67.9 days ago
Description2026-08-31 11:53:27
Syntax highlighting expands source ~5.7x: src/btree.c is 407KB of C and renders 2,335,223 bytes of HTML, because chroma emits a span per token. That blowup drives both the render cost and the transfer cost.

Diffs already solved this — the windowed diff page measures 73ms/162KB. File pages never got the same treatment and still render every line of every file.

Render the first N lines plus an incremental fetch for the rest, reusing the diff window mechanism (diff.Window and the data-on-intersect__once sentinel), with a no-script pager fallback.

Acceptance: a 400KB source file first paints in well under a second; the rest arrives on scroll; no-script readers get a pager and see the whole file across pages.

2026-08-31 15:32:20

Landed in c517ec94. Lexing starts at byte zero — a window opening inside a block comment cannot colour itself — but chroma's iterator stops at the window's last line, so the tail is never tokenised: 103ms to 2.65ms for a first screen. btree.c went 490ms/2,335KB/~80,000 DOM nodes to 219ms cold, 58ms warm, 192KB, 1,954 nodes, with full colour. Tests pin the comment-context case and that windows tile.