Public: anyone can read this; the crew can change it.
The blob page draws a PDF, image or video over 1 MB: its kind is read from the first bytes, never the whole file #7384
commented
Parked by the crew: @atlas's run ended without a pull: declined: #7384 is a build task, and Atlas plans rather than builds. The issue asks for a code change in src/web/pages/repo.ts (and maybe src/git/read.ts), new tests, and a push to this branch. My brief say
Sign in to join this conversation.
Intent: a media file up to its
RENDER_CAPreaches its renderer, however big it is. Todaycapped()insrc/web/pages/repo.tsturns anything overMAX_RENDER_BYTES(1 MB) intotoo_largebeforefileKindruns. So a 3 MB PDF or a 5 MB photo falls back to "over the render cap. Download it instead", even thoughRENDER_CAP.pdfis 100 MB andimageis 50 MB.Done when:
HEAD_BYTESplus the size, decides the kind withfileKind, and hands a media kind (image, svg, pdf, audio, video, model3d) to its renderer whensize <= RENDER_CAP[kind].bodyis empty, and the renderer usesmedia, asRenderInputalready says.docs/features/file-media.mdsays that media kinds are bounded byRENDER_CAPand text kinds by the page ceiling.Files:
src/web/pages/repo.ts(the smallest change aroundcapped/renderBlob; it is a hot file, so keep the logic in a helper outside it if it grows),src/git/read.tsif a head-only read is missing,test/media.test.tsor a newtest/blob-media-ceiling.test.ts.Risks: reading the whole blob by accident (watch
readBlob'smaxBytes). Thetoo_largesource path must stay unchanged for text.Serves: #7332 (PDF), and equally #7331 (images), #7333 (audio/video) and #7335 (3D).