refactor(link-layer): migrate to EmbedPDF v2.6.2 annotation state for link rendering and improve link handling#5760
Conversation
…endering and improve link handling Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
There was a problem hiding this comment.
Pull request overview
Refactors the PDF viewer link overlay to render/navigate/delete links using EmbedPDF’s annotation state (aligned with the v2.6.1 update), replacing the previous pdf-lib-based link extraction approach.
Changes:
- Update EmbedPDF packages from
2.6.0to2.6.1. - Refactor
LinkLayerto read link annotations fromuseAnnotation(documentId).stateand use annotation actions/destinations for navigation. - Simplify
LocalEmbedPDF’sLinkLayerusage by removing now-unneeded props (pdfUrl, page dimensions).
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontend/src/core/components/viewer/LocalEmbedPDF.tsx | Updates LinkLayer invocation to match the new annotation-state-driven interface. |
| frontend/src/core/components/viewer/LinkLayer.tsx | Switches link extraction to EmbedPDF annotation state; updates navigation/deletion logic to use annotation targets/actions. |
| frontend/package.json | Bumps EmbedPDF dependencies to ^2.6.1. |
| frontend/package-lock.json | Locks EmbedPDF dependency tree to 2.6.1 artifacts. |
Files not reviewed (1)
- frontend/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/deploypr |
ConnorYoh
left a comment
There was a problem hiding this comment.
Hi @balazs-szucs great work as always!
|
|
||
| interface LinkToolbarProps { | ||
| link: PdfLibLink; | ||
| ann: PdfLinkAnnoObject; |
There was a problem hiding this comment.
I would prefer to still name link or annotationLink as that is its primary responsibility. I am also personally not a fan of abbreviating words. I have a terrible memory when reading through code :')
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
… link handling Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
|
/deploypr |
Description of Changes
Checklist
General
Documentation
Translations (if applicable)
scripts/counter_translation.pyUI Changes (if applicable)
Testing (if applicable)