Repository navigation
Add mobile PDF navigation and bounded document previews to Viewer - #678
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Students need to read entire slide decks on phones. Portal download permissions and 60-second media grants still apply when a reader jumps to a later page. This implements the Viewer portion of DAM-104 and DAM-105 phase 1.
PDF reader
mode="pdfjs"to render one page with a selectable, screen-reader-accessible text layer. Readers can jump by page number, swipe or use the keyboard. The two fit buttons announce the active mode, zoom buttons disable at their limits, and Retry returns keyboard focus to the reader. The old canvas stays visible until the new canvas and text are ready.Accept-RangesandContent-Lengthto enable on-demand reads.renew(signal)supplies a signed URL for the same immutable version. Portals can omitsrcand resolve the first grant on open. SetdocumentKeyto an immutable asset/version identifier so prop-driven changes tosrcorexpiresAtpreserve the page and worker. Concurrent ranges share a renewal, and a 401/403 retries the affected range in place. A separateoriginalLinkslot lets the application provide its own permission-checked action. The default reader exposes no original-file link.unsupportedFallback. Native frames require a verified PDF endpoint. They show loading feedback until the iframe loads, and offer Retry after a browser error or timeout (30 seconds by default). Browsers hide cross-origin HTTP status. PDF.js accepts octet-stream responses only for PDF filenames.viewerKindexcludes SVG.Documents and integration
useDocumentPreviewsupports lazy grants, optional version and expiry,autoOpen, cancellation and retry. Text and Markdown honor the MIME charset and display their first 2 MiB with a truncation notice.srcnormalization and the widened text classifier. The integration guide covers deployment, CORS, CSP and short-lived grants.Validation
yarn verify:fullpassed locally.pdfjs-distand#pdfjsreferences.Bundle impact
With minified split ESM and React external, the initial Viewer entry and its static imports total 9,232 bytes gzip. Opening the PDF reader adds 162,701 bytes gzip and a 403,179-byte gzip worker. Fonts, character maps and scan decoders load on demand.
🤖 Claimed by kvz on
studio1/node-sdksince 2026-11-28 · resume:codex resume 01a2225d-7217-7113-ad88-07483c94f530