Skip to content

🖌️ Mark clicked PDF text after leaving the viewer - #224

Open
JFWooten4 wants to merge 2 commits into
mainfrom
cloud-kicker-reading-place
Open

JFWooten4 wants to merge 2 commits into
mainfrom
cloud-kicker-reading-place

Conversation

@JFWooten4

Copy link
Copy Markdown
Member

Summary

Add a return-to-reading cue that follows the text the reader last clicked or selected. On window blur or tab hide, the viewer places a blue text highlight and a left-pointing triangle along the PDF page's right edge, in contrast to the amber search-result arrow on the left. The cue stays visible on return until the reader clicks another location in the document.

The cue retains page-relative coordinates so it survives zoom and page render-window recycling, resets when the document is rotated, is ignored during printing, and requires no new browser permissions or persistent text storage.

Verification

  • Verified a nonempty five-file diff from the live main parent, with the viewer HTML wired to the new module and stylesheet.
  • Added regression tests for nearest-text selection, normalized and clipped page geometry, focus/visibility wiring, rerender behavior, and separation from search cues.
  • Full browser interaction has not been manually exercised in Chrome in this environment.

Write PR descriptions automatically.

JFWooten4 and others added 2 commits November 5, 2026 20:12
Remember the last mouse-clicked word or selected text location and reveal a temporary blue highlight with a right-edge pointer when the viewer loses focus. Keep the cue visible on return, restore it after page rerenders, and clear stale coordinates after rotation. Add positioning and wiring regression tests.

Co-authored-by: ChatGPT 6 <noreply@openai.com>
Include the new nearest-text and focus-marker regression suite in the repository's explicit npm test command so pull-request builds execute it.

Co-authored-by: ChatGPT 6 <noreply@openai.com>

Copy link
Copy Markdown
Member Author

CI verification on the latest branch head (5a915f782f5ba4970d6ce5eb6cc29a7f10b3ed76) completed successfully: https://github.com/PDF-magic/viewer/actions/runs/42142447691

The workflow ran npm test (including tests/reading-return-cue.test.mjs), npm run build, and npm run check, alongside the existing shell and Python checks. The new cue was not manually exercised in a Chrome GUI.

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