Repository navigation
fix(review): render large code files without highlighting - #42
Conversation
A large review file was syntax-highlighted in full and given a DOM node per line, which stalled the panel. The server's 2 MB read cap is a security bound, not a client-side highlighting budget. Above 128 KiB of content, or more than 4,000 lines, render the file as plain preformatted text with no gutter and say why in the panel. Below either threshold nothing changes. The plain path renders content as React text rather than innerHTML, so a large file containing markup is escaped, not injected 8000 .
Review, Sol 6.1, 2026-10-02No findings. Reviewed SHA fc11ff7. Read both changed files in full and checked surrounding rendering, CSS and server limits. No introduced security issues, public-repo leaks or scope creep found. Executed all four added test cases and exact 4,000/4,001-line boundary checks using an in-memory harness with real React server rendering; all passed. Did not run Vitest itself, the full suite, typechecking or browser performance/layout tests. No files or Git state changed. |
Review, Sonnet, 2026-10-03PR 42, fix(review): render large code files without highlighting Summary
CriticalNone. MajorNone. Minor
Nit
Test would fail without the changeYes: the new suite imports Public-repo hygieneClean in the diff: no names, Did not check
|
What
A large review file was syntax-highlighted in full and given a DOM node per line. Both scale with file size, so opening a big file stalled the panel.
Above 128 KiB of content, or more than 4,000 lines,
CodeViewnow renders the file as plain preformatted text with no line-number gutter, and says in the panel that highlighting is off. Below either threshold nothing changes.Two details worth a reviewer's attention:
<code>{content}</code>) rather than throughdangerouslySetInnerHTML, so a large file containing markup is escaped rather than injected. The test asserts<script>survives as text.shouldRenderPlainCodecounts newlines with a loop rather thansplit("\n"), so the size check does not itself allocate a large array.Review legs
check:leaksclean (386 files, 30 rules),check:dashesclean,lib-version-gateclean. The new suite is 4/4.Not tested
OSS-clean
Public repo. No personal or customer names, no internal agent names, no
/homepaths, no keys, no commercial or pricing content.