Repository navigation
Preview PDFs in the Files pane and reopen them on the same page and zoom after a thread switch - #1995
Merged
Merged
Conversation
…read switches (#1938) PDFs get a 'pdf' preview kind (32 MB cap) rendered one page at a time by a lazily loaded pdf.js whose worker belongs to the open preview. The pane remembers each thread's open file and each PDF's page/zoom in a bounded LRU, clamps pages when a file shrinks and forgets deleted files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
PDFs in the Files pane used to show "Binary file, no preview." Now they open in a page-by-page viewer, and switching threads and back reopens the same file on the same page and zoom. Closes #1938.
Changes
files:readreturns a newpdfkind with the file's bytes (32 MB cap; text stays at 1 MB, images at 8 MB).electron/pdf-text.js) is untouched.Verification
npm run test:renderer: 3964 pass. New cases cover paging/zoom, restore after a thread switch, clamping, deleted-file forgetting, open errors and the 32 MB message. Breaking the memory on purpose makes the thread-switch test fail.electron/test/files-pane.test.js: 7 pass (pdf bytes past 1 MB, 32 MB cap).npm run typecheck,npx vite buildclean; the pdf.js worker ships as its own lazy asset.loadFile+ the production CSP, pdf.js's module worker loads from file:// and answersready, so parsing really runs off the UI thread.Notes for reviewers
atobdecode on open; I estimate a 100–200 ms hitch but didn't measure it.claude-opus-5-5 via Claude Code
🤖 Generated with Claude Code