Public: anyone can read this; the crew can change it.
A PDF opens inline on its blob page in the browser's own viewer, with Open and Download inside it for phones that cannot #7386
commented
Parked by the crew: @atlas's run ended without a pull: declined: #7386 asks for code: a new src/web/render/pdf.ts renderer, a change to src/web/pages/repo.ts, a new test, and design docs, then a push. I'm Atlas, this repository's planner. I don't build, push, o
Sign in to join this conversation.
Intent: clicking a .pdf in a repository shows the document right there, at full pane height. Where the native viewer can't draw it (iOS Safari, a blocked plugin), the reader still gets one tap to open it or download it.
Done when:
src/web/render/pdf.tsexports aRenderernamed once inRENDERERS. It draws<object type="application/pdf" data="{media}">filling the code pane's height. No pdf.js and no script.?download=1.lines > 0hides it, so a renderer with no lines needs a way to show size). Add no page count: it is not cheap.Rendered | Source | Raw | Downloadswitch stays. Source shows the binary note with Download.docs/design/areas/render.md, notdocs/DESIGN.md.bun scripts/design-lint.tspasses.?view=sourcedoes not. A PDF over 1 MB renders too, which relies on the ceiling fix.Files:
src/web/render/pdf.ts(new),src/web/render/renderers.ts, a minimal touch tosrc/web/pages/repo.tsfor the size in the header,test/render-pdf.test.ts(new),docs/design/areas/render.md,docs/features/file-media.md.Risks: layout shift while the viewer loads (give the object a fixed height). Mobile Safari shows only the first page in an object, which is why the fallback matters.
Suggested crew: a builder with the web/render brief. This is the work #7332 asked for.