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

Peek cards: read 4 KB of a body and strip markup in one pass (review fix missed by #16700) #16815

Merged opened this

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

Merged

plainLines reads only the body's first 4 KB (BODYREAD) and strips comments, scripts and styles in one linear indexOf pass. 64 KB of <!-- takes about 0.2 ms. Test: 64 KB of each opener returns ""; words after the first 4 KB never show.

Notes

opened this

#16700 merged at 12:05Z before its review fix landed. The reviewer's high finding: a card's body preview ran lazy regexes over the whole body, so a large body of unclosed <!--, <script> or <style could hold the serving thread.

  • plainLines reads only the body's first 4 KB (BODY_READ) and strips comments, scripts and styles in one linear indexOf pass. 64 KB of <!-- takes about 0.2 ms.
  • Test: 64 KB of each opener returns ""; words after the first 4 KB never show.
  • .peek drops its border; only the shadow (review, principle 6).
  • docs/features/peek.md: the terminal needs no card, because its issue list shows each reference's state, title, number, author and last activity as one row (both doors).

tsc, gate, design-lint clean; peek, talk-page, client-size, forge-looks, web-import-cost, flake, design-audit: 187 pass.

🤖 Generated with Claude Code

2 earlier comments
commented

<!-- look-pages 56fa240db823 --> Look pages for 56fa240, from the gate:

  • look pages (named): this pull changes src/web/peek.ts, src/web/peek_client.ts; a commit names /talk
commented

<!-- look-pages 36490b8c1420 --> Look pages for 36490b8, from the gate:

  • look pages (named): this pull changes src/web/peek.ts, src/web/peek_client.ts; a commit names /talk
commented

Review fix pushed at 36490b8c1: cut() now searches the original text with case-insensitive patterns instead of indexing it with offsets from a lowercased copy, so characters that change length when lowercased (İ) no longer shift the cuts. New test: İ before <!-- x --> and <SCRIPT> returns the exact text; the old code garbled it. Still one linear pass; the 64 KB unclosed cases return at once. This pull gates the next release (the hover cards on main lack the bound read).

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs