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

shipped production is serving it opened this has it
opened this

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.ts exports a Renderer named once in RENDERERS. It draws <object type="application/pdf" data="{media}"> filling the code pane's height. No pdf.js and no script.
  • [ ] Inside the object, the fallback is an "Open the PDF" link to the media URL plus a Download button to ?download=1.
  • [ ] The header shows the file's size where other kinds show lines (today lines > 0 hides it, so a renderer with no lines needs a way to show size). Add no page count: it is not cheap.
  • [ ] The Rendered | Source | Raw | Download switch stays. Source shows the binary note with Download.
  • [ ] It works at 390 px and in both themes. The look is attached to the pull, and any new class is named in docs/design/areas/render.md, not docs/DESIGN.md. bun scripts/design-lint.ts passes.
  • [ ] A test asserts that a blob page for a PDF carries the object with the media URL, the type, and both fallback links, and that ?view=source does 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 to src/web/pages/repo.ts for 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.

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.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs