Skip to content

fix: preserve reading intent when following PDF links - #46

Merged
nkanf-dev merged 4 commits into
mainfrom
dev/pdf-link-navigation
Oct 4, 2026
Merged

nkanf-dev merged 4 commits into
mainfrom
dev/pdf-link-navigation

Conversation

@nkanf-dev

@nkanf-dev nkanf-dev commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Follow numeric, named and indirect internal PDF destinations in the reader where activated, including pages not already mounted.
  • Guard every asynchronous resolution with source/session/window/page/activation ownership. Newer links, explicit same-page choices, held-read preparation, owning QuickFlip and timeline preview entry retire older work. Raster Retry and retirement also cancel it.
  • Preserve other panes, scroll/zoom state and newer focus. Dismiss missing-destination feedback locally with Escape; check shared post-gesture click suppression before PDF capture so pinch ghost clicks cannot navigate. Keyboard links remain usable.
  • Integrate current main 85d30a3 CJK/font, long-filename and CI-trigger safeguards unchanged. Canvas layout callbacks now apply geometry only rather than replaying a full reading position.

Verification

  • Final tree 00cb5a6556ed9d0ce812c52489216e65f8e784dd: local lint, TypeScript/build, 185 unit tests and 326 UI tests passed. Wrangler deploy dry-run passed with an isolated writable XDG config directory.
  • Independent read-only review found and verified fixes for same-page, held-read delay, timeline preview, incidental geometry, Escape and touch-capture edge cases. Generated PDF fixture parsed to verify all annotation IDs/destinations, including one intentional missing named target.
  • Browser suite includes native click/Enter/arrow continuation, delayed worker response gates, numeric/named/reference links, latest intent, QuickFlip open/cancel/commit, timeline commit/cancel, save/reopen/source hashing, missing-link feedback and synthetic touch/click ordering across six projects.
  • Previous normal gate37178498237 passed Chromium (302), WebKit and all static/unit/UI checks; Firefox isolated one post-pinch keyboard activation failure (146 other cases passed). Mozilla's DispatchClickEvent implementation confirms a keyboard click can retain detail=1 with pointerId=-1. The shared guard now recognizes that standard non-pointing identity through React's nativeEvent and the native listener; exact UI regressions cover both paths and actual pointing clicks stay blocked. The browser assertion is unchanged.
  • Gate37179305608 at af72ee0 completed all jobs: Chromium305, Firefox148+10 stability repeats, WebKit211+20 repeats. One existing five-page grid axe check passed on retry because Save was re-enabled while its generic opacity transition still blended text below AA contrast. The source now transitions colors only, and computed-style/UI guards protect enabled opacity without changing the full axe assertion. Complete WebKit work took almost20 minutes; its job ceiling is now30 minutes, with all browser cases, per-test deadlines, repeats and assertions retained.
  • Exact release-head normal PR gate 37180597786 passed all jobs with zero retries: 185 unit,326 UI, Chromium305, Firefox148+10 stability repeats, WebKit212+20 stability repeats. The previous contrast flake is gone with the full axe check intact. Final desktop/grid, long mixed Chinese filenames, tablet/mobile and link-feedback screenshots were inspected. Cloudflare preview build succeeded. Main/production verification follows merge.

Files and contracts

Production: ReaderViewport, new usePdfLinkNavigation and transient readerNavigationIntent, shared gesture suppression, book/window explicit navigation signals, held-read preparation, TimelineBar preview-start callback, App geometry/preview adapters. Tests: generated three-page PDF/generator, fixture docs, reader-link UI/E2E, timeline UI; Playwright adds compact link coverage while retaining font coverage. README and browser evidence notes updated. No saved schema, dependencies, PDF bytes from user documents, thumbnail/worker renderer or CI gate reductions.

Limits

PDF destination coordinates/zoom modes are not interpreted. No claim to fix the separate pending PDF.js worker teardown rejection. Mobile browser coverage is emulation, not physical-device certification. Local browser launch/loopback restrictions remain; the normal CI browser gate is the execution route. External URI handling remains PDF.js's and no external link is followed by tests.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
leafspace dc71947 Commit Preview URL

Branch Preview URL
Oct 04 2026, 05:41 AM

Resolve numeric, named and indirect destinations in their originating reader with per-activation cancellation. Preserve same-page choices, held reads, QuickFlip, timeline previews, keyboard focus and touch suppression. Integrate current main font/layout safeguards and retain full PR/main gates.

Co-authored-by: Codex <noreply@openai.com>
@nkanf-dev nkanf-dev changed the title fix: follow internal PDF links in their originating reader fix: preserve reading intent when following PDF links Oct 4, 2026
nkanf-dev and others added 2 commits October 4, 2026 13:14
Recognize the native non-pointing pointer ID in both React and native click guards. Keep real ghost clicks suppressed and retain the browser activation assertion. Add responsive missing-link feedback evidence.

Co-authored-by: Codex <noreply@openai.com>
Keep hover color transitions while restoring enabled opacity immediately. Retain full accessibility checks and allow normal runner variance for the complete single-worker WebKit gate.

Co-authored-by: Codex <noreply@openai.com>
@nkanf-dev
nkanf-dev marked this pull request as ready for review October 4, 2026 06:01
Copilot AI balanced review requested due to automatic review settings October 4, 2026 06:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@nkanf-dev
nkanf-dev merged commit 78ad266 into main Oct 4, 2026
6 checks passed
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.

2 participants