Skip to content

[DRAFT] Fix PDF report section links in Apple Preview - #13225

Draft
benbowler wants to merge 2 commits into
developfrom
bug/13212-pdf-report-section-links-apple-preview
Draft

[DRAFT] Fix PDF report section links in Apple Preview#13225
benbowler wants to merge 2 commits into
developfrom
bug/13212-pdf-report-section-links-apple-preview

Conversation

@benbowler

@benbowler benbowler commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Related issue(s):

Relevant technical choices

  • The header chips' internal links are emitted by @react-pdf/render as named destinations of the form /XYZ null <top> null. Apple's PDFKit (Preview, and any macOS/iOS app embedding PDFView) ignores a destination's top coordinate when the left coordinate is unspecified and navigates to the top of the target page instead. The report is a single tall page, so the chips appear dead in Preview while working in Chrome, Firefox, Edge and Acrobat.
  • Fixed with a patch-package patch (the repo already patches two other packages) changing setDestination to pass the node's box.left (falling back to 0), producing /XYZ 0 <top> null: the canonical explicit form Acrobat writes, resolved identically by all tested viewers. Verified against Apple's engine with a headless PDFView harness and manually in Preview.
  • Submitted upstream as fix(render): specify the left coordinate in named destinations so internal links navigate in macOS Preview diegomura/react-pdf#3460; the patch can be dropped once a release containing it is adopted.
  • No test changes: @react-pdf/renderer is mocked in Jest, and patch-package fails the install if a dependency bump invalidates the patch.

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 7.4.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.
  • Ensure there are no unexpected significant changes to file sizes.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

@github-actions

Copy link
Copy Markdown

🤖 This comment is automatically updated by CI workflows. Each section is managed independently.

🎭 Playwright reports for 43e6433:

@benbowler
benbowler marked this pull request as draft July 30, 2026 10:37
@benbowler benbowler changed the title Fix PDF report section links in Apple Preview [DRAFT] Fix PDF report section links in Apple Preview Jul 30, 2026
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.

Can't click to section of PDF report + fix bottom spacing

1 participant