feat(desktop/pdf): fit-page, 90° rotation + hand/pan tool, ink-drag canvas preview (#321)#344
Merged
Merged
Conversation
# Conflicts: # desktop/src/ui/PdfCanvas.tsx
physercoe
previously approved these changes
Jul 20, 2026
physercoe
left a comment
Owner
There was a problem hiding this comment.
APPROVE. Rotation × annotation geometry verified correct against pdf.js viewport math for all four rotations (pdfPtToView/viewToPdfPt inverse pair; rotation-0 byte-identical so existing anchors unaffected). Ink preview is ref-only until pointer-up; hand/pan tracks via window listeners (WebView2 lesson). Rebased onto main and resolved the PdfCanvas drilled-t→local-useT() merge (kept #321 rot, dropped the t prop to match main). Cosmetic minor: ToC/internal-link jump lands page-top while rotated (goToAnnotation is correct).
# Conflicts: # desktop/src/ui/PdfCanvas.tsx
physercoe
approved these changes
Jul 20, 2026
physercoe
pushed a commit
that referenced
this pull request
Jul 20, 2026
…ic-tail merges Since v0.3.79: - fix(terminal): tell xterm the pty is ConPTY on Windows so a repainting TUI's intermediate frames no longer pile up in the scrollback (2b26a16). - 8 epic-tail PRs merged: #341 terminal connect-phase + SSH split-duplicate, #342 PDF struct-tree a11y + annotation shortcuts, #343 token burn-down / plural / responsive, #344 PDF fit-page / rotation / hand-pan / ink, #345 perf (page memo, debounce, chart cap, sync dirty-tracking), #346 modal migration + dirty-close guards, #347 vault TOTP / ed25519 / coded errors, #348 read reconcile / AuthorNav / table nav / frame check. Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.
Closes #321
Implements the last remaining tail of the PDF reader polish issue — the two items left open in the issue comments (fit-page mode + rotation + hand/pan tool; ink-drag preview re-rendering the whole page per pointermove).
What
Fit-page + rotation + hand/pan (
PdfCanvas.tsx)PDF_SCALE_KEYmechanism.termipod.pdf.rotation, same shared-across-PDFs pattern as zoom). User rotation stacks on the page's own (page.rotate + rotation) for canvas/text/link rendering; the pre-measured page footprints just swap axes at 90°/270° (no re-measure); render-task cancellation and live-DPR re-rasterization are unchanged. Annotation overlays, creation hit-mapping (note/area/ink/text-selection), area-screenshot capture, and annotation/dest jump offsets all map through rotation-awarepdfPtToView/viewToPdfPthelpers — rotation 0 degenerates to the old multiply + y-flip, so stored annotations are unaffected. Thumbnails rotate with the pages.read.zoomFitPage,read.rotateCw,read.panTool); three new stroke icons (fit-page,rotate-cw,hand).Ink-drag preview
lineToper move) instead of a draft state that re-rendered the whole page component on every pointermove. React state (the annotation store) is touched once, on pointer-up. The area-rect draft preview is unchanged.Why
How verified
npm run build(sync:tokens + tsc --noEmit + vite build) — green.scripts/lint-desktop-tokens.sh— clean (no new hex/primitive/phantom tokens; hand-tool CSS uses cursor/user-select only).pdfPtToView/viewToPdfPt) round-trip-tested for 0/90/180/270 incl. corner expectations; rotation-0 output verified identical to the previous mapping.