Skip to content

🖌️ Add notes to highlighted PDF passages with text export - #223

Open
JFWooten4 wants to merge 1 commit into
mainfrom
roseluck-selection-notes
Open

JFWooten4 wants to merge 1 commit into
mainfrom
roseluck-selection-notes

Conversation

@JFWooten4

Copy link
Copy Markdown
Member

Summary

Add a lightweight annotation workflow to the PDF viewer without changing native text selection or the minimap's navigation behavior.

  • Select a passage on a PDF page to reveal a small + Note action beneath the selection, then enter, save, or cancel a note.
  • Keep multiple independent passage notes, with green text-range highlights that can be clicked to edit or delete their associated note.
  • Persist notes locally under the PDF fingerprint (falling back to its source URL) so they reappear on reopening the document; reanchor highlights as virtualized text layers rerender.
  • Place a ⇩ export control immediately to the left of the minimap's existing arrow/control row. It downloads a portable UTF-8 .txt file containing the document title, source link when available, page numbers, quoted passages, and note text, in reading order.
  • Include source-only unit tests for note identity, anchor recovery, export formatting and viewer control placement in the standard test command.

Behavior and scope

Only selections whose endpoints belong to a single rendered PDF page are annotatable. The button is disabled until a note exists, and notes remain local to the browser unless exported. Export does not modify the PDF file itself. Text content is written using DOM text nodes and plain text output (no HTML injection).

Verification

  • Compared the branch with main: one new commit, six intended files changed; the note module, test, stylesheet, and export control all exist on the branch.
  • Automated checks to be reviewed on the new PR.

Write PR descriptions automatically.

Attach editable notes to selected PDF passages, preserve document-scoped highlights across rerenders, and export quoted notes in reading order.

Co-authored-by: ChatGPT 6 <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant