Repository navigation
Jump from a PDF bibliography card to where the paper cites it - #767
Merged
Merged
Conversation
Bibliography cards could open the cited paper but not lead back into the text. The citation resolver now also indexes every in-text citation of each entry: hyperref links to its cite.* destination, or for numbered PDFs without them, "[n]", "[2, 7]" and "[4-6]" labels printed before the bibliography. Author/year links split across "Chen et al." and "2017", or wrapped onto the next line, count as one citation. The card footer gains "Jump to citation" (with "n of m" when cited more than once, stepping through each in turn), which scrolls to the citation and flashes the existing chat-citation highlight over it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bibliography links no longer wait for the whole-document citation index; pages fill in each card's jump once citationsOf resolves, and the scan reads pages in parallel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6d2990c. Configure here.
Range-loaded PDFs fetch pages on demand, so the citation index now reads six pages ahead like the text search instead of the whole document at once, and a page that fails to load contributes no citations rather than failing the scan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
Follow-up to #754 and #758. A bibliography entry's paper card can open the cited paper, but there's no way back to where the text cites it. In-text cards already have "Jump to reference" for the other direction.
What
createPdfCitationResolverbuilds a lazy index of every in-text citation of each bibliography entry.bibliographyLinks(page)returns it ascitations: one list of boxes per citation, in reading order, on the 0–1000 page grid.cite.*name.[n],[2, 7]and[4-6]labels in the text before the first bibliography entry. Text items are joined into lines first, so a label split as[+12]still matches.Verification
vitest run src/components/pdf src/views/PaperReaderView.test.tsx(78 passed). New tests cover: hyperref citations including split and wrapped author/year links; numbered citations (single labels, lists, ranges, split labels,[abc]/[2023a]ignored); Word-export citations excluding labels inside the bibliography; and the card button stepping through citations, plus no button for uncited entries.tsc -p tsconfig.app.jsonpasses.eslintshows only an existing warning./pdf/2004.05150, with/apiproxied to the public site:🤖 Generated with Claude Code
Note
Medium Risk
Adds whole-document PDF annotation/text scanning and highlight/scroll wiring in the reader; behavior is user-facing but confined to citation UX with solid test coverage.
Overview
Bibliography paper preview cards in the PDF reader can now jump back to in-text citations, mirroring the existing “Jump to reference” flow from in-text links.
The citation resolver gains a lazy
citationsOfindex: hyperref PDFs use link annotations tocite.*destinations (with adjacent/wrapped author–year fragments merged into one highlight); Word-style numbered PDFs parse[n], lists, and ranges in body text before the bibliography via newnumberedCitationBoxes.PdfBibliographyEntryLinkshows Open paper plus a Jump to citation control that cycles 1 of N when there are multiple cites; uncited entries omit the button.PdfViewerloads citation boxes per bibliography card, then reuses the chat citation highlight/scroll path via transientcitationJumpstate (last-requested highlight wins; new PDF or chat citation clears the jump).Reviewed by Cursor Bugbot for commit 4f2914d. Bugbot is set up for automated code reviews on this repo. Configure here.