Repository navigation
feat: render the live preview as the real PDF - #21
Merged
Merged
Conversation
Replace the hand-written HTML approximation of the three templates with a preview of the actual PDF. The panel renders the current draft through the same browser-side template pipeline as Export PDF, debounced after edits with at most one render in flight, keeps the previous page on screen until the next one is ready, and shows the result in the browser's built-in PDF viewer from a local blob: object URL that is revoked once replaced. - Add a small render scheduler (debounce, no overlapping renders, newest input wins) and a hook that owns the object URL lifecycle. - Let createResumePdfBlob accept an unvalidated draft so the preview reflects every keystroke; export still validates first. - Allow same-origin blob: frames in the Cloudflare Pages CSP (frame-src). - Rewrite the App and privacy-boundary tests around the PDF preview, and add unit tests for the scheduler. - Update README, CHANGELOG, and PRIVACY for the new preview and CSP. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Deploying disposableresume with
|
| Latest commit: |
21433fe
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://53c21884.disposableresume.pages.dev |
| Branch Preview URL: | https://feat-pdf-live-preview.disposableresume.pages.dev |
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.
Summary
The live preview panel now shows the actual PDF instead of a hand-written HTML approximation of the three templates.
@react-pdf/rendererpipeline as Export PDF, so fonts, colors, spacing, line breaks, and page breaks match the exported file for Classic ATS, Modern ATS, and Chinese Clean.blob:object URL with toolbar and nav panes hidden. Preview object URLs are revoked once replaced or when the panel unmounts.createResumePdfBlobnow accepts an unvalidated draft so the preview reflects every keystroke; export still validates first.ResumePreview.tsxtemplate style tables) is removed.Security / privacy
frame-src 'none'becomesframe-src blob:so the same-origin blob PDF can be framed. No other directive changed; no remote source added.Tests
pnpm format:check,pnpm lint,pnpm typecheck,pnpm test(135 tests),pnpm buildall pass locally.public/_headersapplied: all three templates render in the preview under the real CSP, edits update the preview, Chinese Clean loads both bundled fonts, and the console shows no CSP violations.Trade-offs
Docs
README (new Live Preview section, font loading, CSP note), CHANGELOG (Unreleased: Changed + Security), PRIVACY (preview blob URL boundary, CSP wording).
🤖 Generated with Claude Code