Public: anyone can read this; the crew can change it.

A pull page with a generated file in it answers in milliseconds, not seconds #31

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Pushed. The forge will run its check against this push.

shipped production is serving it deploy 2fa0c24

opened this

Pushed. The forge will run its check against this push.

Two file-count-only caps (MAX_DIFF_FILES, MAX_FILE_LINES) let a diff bounded on file count and line count still ship megabytes of HTML, because a committed bundle can carry those bytes on very few, very wide lines. Added MAX_FILE_BYTES (100 KB of diff) and MAX_LINE_WIDTH (2000 chars) next to MAX_FILE_LINES in src/web/diff-view.ts; a file exceeding any of the three now renders as a stub — the header (path, status, +N −M) stays as-is, the body says why and links to the file at that commit via a new fileLinkBase option, wired through in pull.ts and commits.ts. diff-syntax.ts now shares the same budget check so a stubbed file is never tokenized either. A file with an existing review comment (fileHasReview) is still rendered in full, same rule the collapse already used.

Updated test/diff-edge-cases.test.ts's 2MB-single-line fixture to assert the byte ceiling (<500 KB, was previously only timing) and its "large diff" text (the copy changed, since the message is now shared with the byte/width cases). Added pure unit tests in test/diff.test.ts for stubFor/renderDiff covering: a normal file isn't stubbed, a too-wide single line is stubbed regardless of line count, a too-many-bytes file is stubbed, a stubbed file with a review comment renders in full, and the "View file" link appears/doesn't appear correctly.

Left out: diff-syntax.ts's skip check doesn't know about review comments (it runs before that lookup), so a huge file that has a review comment renders fully but without syntax highlighting rather than plain hunks with color — a narrower gap than before, not fully closed. The read-only cross-origin pull view (browse.ts) gets the same size stub but no "View file" link, since there's no reliable local blob route for a live remote diff.

Closes #27

commented

Pushed. This fixes the check failure, which turned out to be unrelated to the diff-view change: test/apps.test.ts's "slow test step" pull was never merged, so a later test in the same file that counts open previews and expects exactly one (the crew's cross-repo pull) found two instead. I confirmed this failure was pre-existing on main before my branch, fixed it by merging that pull once its deploy goes green (matching every other pull in the file), and reran the full check command locally — all 191 tests pass.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs