Currently, when a user clicks a citation in the chat, they can see the source text in a drawer or open the PDF. However, the PDF opens to the first page (or just the file) without pinpointing the exact location of the referenced information. This forces the user to manually search for the content.
Implement "Highlight Jump" functionality:
PDFPreview.tsxPDFPreview renders only to a <canvas>. We must enable pdf.js Text Layer rendering on top of the canvas. This allows text selection and searching.initialPage: Already exists? Need to verify it works reliably.highlightText: A string (the chunk content) to search for and highlight.highlightText is provided, search for this text in the Text Layer.SourcePreviewDrawer.tsxpageNumber and content (as highlightText) to the onOpenFile callback.ChatInterface.tsx / ChatView.tsxpageNumber and highlightText from the source.RagSearchResult already contains pageNumber. (Verified: It does).pdf.js might not extract a text layer that matches exactly what Tika extracted, or might have no text layer. In this case, we fallback to just Page Jump.