PDF fitted first-page poster (declared poster slot) - #6029
Draft
lukemelia wants to merge 6 commits into
Draft
Conversation
PdfDef declares a poster screenshot slot whose capture-only component paints page 1 with pdf.js (pinned CDN build, loaded only inside the capture render — the live viewer stays a native <object> with no PDF engine in the app graph). The component fetches the document bytes, contains page 1 in the capture box at the device scale, and signals readiness through the data-screenshot-pending contract. keyBy 'file-content' skips re-rasterizing on metadata-only edits; useAsThumbnail routes the capture to the fitted cell through the view model's thumbnail seam, with the typed page placeholder as the fallback for uncaptured or capture-errored documents. Part of CS-12526. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…wiring' into cs-12526-pdf-fitted-first-page-poster-poster-slot
Contributor
Host Test Results 1 files ±0 1 suites ±0 2h 5m 10s ⏱️ + 2m 40s Results for commit 939049a. ± Comparison against earlier commit 97acc19. Realm Server Test Results 1 files ±0 202 suites ±0 1h 14m 15s ⏱️ +59s Results for commit 939049a. ± Comparison against earlier commit 97acc19. For more details on these errors, see this check. |
…wiring' into cs-12526-pdf-fitted-first-page-poster-poster-slot
…wiring' into cs-12526-pdf-fitted-first-page-poster-poster-slot
…wiring' into cs-12526-pdf-fitted-first-page-poster-poster-slot
…wiring' into cs-12526-pdf-fitted-first-page-poster-poster-slot
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.
What this does
Stacked on #6028 (image renditions + thumbnail seam).
PdfDefdeclares aposterscreenshot slot at the recommended thumbnail box (170×250 @ dsf 2),keyBy: 'file-content',useAsThumbnail. The capture-only component (file-formats/pdf-captures) fetches the document, paints page 1 into a canvas with pdf.js, contains it in the capture box at the device scale so text stays sharp, and signals readiness viadata-screenshot-pending.pdfjs-dist@4.10.38), loaded only inside the capture render — the same delivery the 3D family's live viewer uses for three.js. The live PDF viewer stays a native<object>; no PDF engine enters the app's dependency graph.Test plan
Realm-server e2e (extends the file-capture suite): writes the licensed
pdf-simple.pdffixture, asserts the poster manifest entry (thumbnail flag, PNG bytes) and that the file's prerendered fitted HTML embeds the durable poster URL. CI-validated (the cached-fixture suite doesn't run locally).🤖 Generated with Claude Code