Add PDF box annotations with hover preview and click-to-edit - #196
Open
jlongvalRobotiq wants to merge 3 commits into
Open
Add PDF box annotations with hover preview and click-to-edit#196jlongvalRobotiq wants to merge 3 commits into
jlongvalRobotiq wants to merge 3 commits into
Conversation
- CommentTarget::Pdf gains a region flag (serde: region: true only when set; legacy files load unchanged) - b / Space+b enters box mode: hjkl/arrows move, HJKL fast, v/Space sets a corner, Enter opens the comment editor, Esc cancels; mouse drag also works - region comments render as an outline (converter), text comments unchanged - overlap rule: regions and text anchors may coexist - Markdown export emits 'page N · box|text x0,y0 – x1,y1 pt' per PDF comment - text inside the box becomes quoted_text
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
Add rectangular PDF annotations for figures, diagrams, and other regions that cannot be anchored conveniently to a text selection. Region comments use the existing comment editor, YAML persistence, comments viewer, and Markdown export; the PDF itself is not modified.
Interaction
bin standard PDF mode orSpace+Bstarts box drawing.Space+bretains upstream's zen-border toggle.hjkl/arrows, set a corner withv/Space, then confirm with Enter; alternatively left-drag a box and release.pdf_boxkeybinding context. Ctrl+click/right-click retain SyncTeX behavior.Implementation and compatibility
regionflag to PDF comment targets. Missing flags default to text annotations, and false is omitted when serializing. Existing storage locations and text annotation behavior are retained.Integrated current upstream main (
824cc7b), including per-page enhancement/zoom geometry and pixel-precision mouse handling. Deferred selection preserves the original mouse-down position.Verification
cargo test --lib: 577 passed.cargo test --test svg_snapshots: 92 passed, 2 ignored; no golden updates.cargo check --all-targetscargo build --releasecargo clippy --all-targetscompletes with warnings. Strict-D warningsis not clean on the local Rust 1.98 toolchain; for example, it flags the existing wildcard pattern insrc/parsing/markdown_renderer.rs:540.Added focused regressions for viewport-edge boxes, zoom/pan and differently enhanced pages in scroll mode, resize cancellation, click-versus-drag behavior, legacy YAML compatibility, disk-backed region persistence, text/box coexistence, per-page export locations, and outline/underline tile clipping.
Manual testing on Linux/Kitty covered drawing, saved comment preview, leaving a box/divider, and click-versus-drag editing. After integrating current main, a separate live smoke check confirmed the configurable drawing keys open the box comment editor. Cross-terminal VHS goldens were not regenerated; additional terminal coverage would be useful during review.