Fix: Comprehensive page navigation for crossref entries in both internal and external viewers (#8128) - #15504
Fix: Comprehensive page navigation for crossref entries in both internal and external viewers (#8128)#15504Sherry0121-AC wants to merge 54 commits into
Conversation
Review Summary by QodoAdd comprehensive page navigation for crossref entries across all platforms
WalkthroughsDescription• Implement logical-to-physical PDF page translation for crossref entries • Add page number support across all desktop platforms (Windows, macOS, Linux) • Enable internal and external viewers to navigate to correct pages in parent PDFs • Support crossref fallback when child entries lack direct file attachments Diagramflowchart LR
A["Child Entry with crossref"] -->|resolve parent| B["Parent Entry"]
B -->|extract pages field| C["Parse Page Number"]
C -->|PDF with labels| D["PdfPageLabelResolver"]
D -->|logical to physical| E["Physical Page Number"]
E -->|pass to OS| F["Platform-specific Viewer"]
F -->|Windows| G["SumatraPDF/-page"]
F -->|macOS| H["Adobe/Skim/Browser"]
F -->|Linux| I["Evince/Okular/Zathura"]
File Changes1. jabgui/src/main/java/org/jabref/gui/actions/ActionHelper.java
|
Code Review by Qodo
1.
|
fe94d90 to
969f699
Compare
…21-AC/jabref into fix-8128-crossref-pages
…21-AC/jabref into fix-8128-crossref-pages
koppor
left a comment
There was a problem hiding this comment.
For what is this PR? University credits or GSoC?
|
Your pull request conflicts with the target branch. Please merge with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line. |
We'll take a look soon. Currently we are a bit busy with other commitments. |
…21-AC/jabref into fix-8128-crossref-pages
No problem at all, take your time! Thanks for letting me know. |
|
Hi @calixtus @koppor @subhramit @Siedlerchr , the merge conflicts have been resolved and all checks are green. Are there any further issues to address, or is this ready to be merged? Thanks! |
koppor
left a comment
There was a problem hiding this comment.
Only checked some code. Unsure how it relates to the issue.
We use the default browser of the system. Why a separate browser handling?
| } | ||
|
|
||
| private static boolean contains(String appNameLower, String browserName) { | ||
| return appNameLower != null && appNameLower.contains(browserName); |
There was a problem hiding this comment.
Seems to be AI generated. Tell the AI to use JSpecify instead of == null checks
| @@ -0,0 +1,38 @@ | |||
| package org.jabref.gui.desktop; | |||
|
|
|||
| public final class BrowserUtils { | |||
| try { | ||
| startProcess(commands); | ||
| } catch (IOException e) { | ||
| LoggerFactory.getLogger(Linux.class).warn("Could not open PDF with page jump using fallback viewers", e); |
|
The requested changes were not addressed for 10 days. Please follow-up in the next 10 days or your PR will be automatically closed. You can check the contributing guidelines for hints on the pull request process. |
|
This PR is being closed due to continued inactivity. |
|
This pull requests was closed without merging. You have been unassigned from the respective issue #8128. In case you closed the PR for yourself, you can re-open it. Please also check After submission of a pull request in CONTRIBUTING.md. |
Related issues and pull requests
Closes #8128
PR Description
This PR fixes the issue where opening sub-entries (e.g.,
@InCollection) via thecrossreffield failed to navigate to the correct start page in external and internal viewers. By implementing a logical-to-physical page translation layer and optimizing the navigation pipeline, JabRef now correctly targets the intended page, gracefully handling PDF front-matter offsets when present. This ensures a consistent and accurate research experience across all desktop platforms.Steps to test
@Bookentry in JabRef and link a local PDF file to it.(Optional but recommended: Use a PDF with roman-numeral front matter to verify the new logical-to-physical page translation feature).
@InCollectionentry. Setcrossrefpointing to the parent book's citation key, and set thepagesfield to a specific range (e.g.,186--206).Screenshots:



![External Viewer Jump]
Screenshots: The external browser successfully navigating to physical page 200 (logical page 186) after pressing F4.
![Internal Viewer Jump]



Screenshots: The internal document viewer accurately resolving the parent file and jumping to the correct page.
Known Limitations
Checklist