feat: research trust layer — click-to-highlight and BibTeX export#8
Merged
Conversation
Click any source in the panel to open the PDF with the matching passage highlighted in yellow. The viewer auto-navigates to the page containing the source text using PDF.js text search, then highlights matching words with a customTextRenderer overlay. Export BibTeX from the overflow menu: generates .bib entries from conversation sources with auto-extracted author, year, title from filenames. Each entry includes the source passage as a note. Source cards now show "Click to view in document" on hover. The document preview badge shows which page the source was found on. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Research trust layer: click-to-highlight sources and BibTeX export. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
vikranthreddimasu
added a commit
that referenced
this pull request
Apr 17, 2026
CI has been red on main since the research trust layer merge (#8). None of these issues were caught before merge, and every PR since has inherited the failure. This commit resolves both jobs. Backend (ruff): - chat.py model: wrap Field() description so the line fits in 120 cols. - chat stream route: drop the unused persist_warning flag. - conversation_store: drop unused `field` and `Path` imports. - conversation store + cross-notebook tests: drop unused locals / imports (c2 binding, VectorStoreManager import). Kept the ordering assertion by calling create_conversation without binding the returned value. Desktop (tsc): - types.ts: extend StreamSource and SourceChunk with the fields the backend actually returns (relevance_score, notebook_id). This removes the need for unsafe `as Record<string, unknown>` casts at read sites. - useChat / SourcePanel: read the typed fields directly now that the shape is honest. - DocumentPreview: use a proper `'str' in item` narrow for the pdfjs TextItem | TextMarkedContent union instead of an ad-hoc structural type. - SetupWizard: drop the unused fetchConfig import and the dead uploadedFilename state (only the setter was ever called). - ZoteroImport: drop the unused useAppStore import. Verified locally: `uv run ruff check .` clean; `npm run build` clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
vikranthreddimasu
added a commit
that referenced
this pull request
Apr 17, 2026
CI has been red on main since the research trust layer merge (#8). None of these issues were caught before merge, and every PR since has inherited the failure. This commit resolves both jobs. Backend (ruff): - chat.py model: wrap Field() description so the line fits in 120 cols. - chat stream route: drop the unused persist_warning flag. - conversation_store: drop unused `field` and `Path` imports. - conversation store + cross-notebook tests: drop unused locals / imports (c2 binding, VectorStoreManager import). Kept the ordering assertion by calling create_conversation without binding the returned value. Desktop (tsc): - types.ts: extend StreamSource and SourceChunk with the fields the backend actually returns (relevance_score, notebook_id). This removes the need for unsafe `as Record<string, unknown>` casts at read sites. - useChat / SourcePanel: read the typed fields directly now that the shape is honest. - DocumentPreview: use a proper `'str' in item` narrow for the pdfjs TextItem | TextMarkedContent union instead of an ad-hoc structural type. - SetupWizard: drop the unused fetchConfig import and the dead uploadedFilename state (only the setter was ever called). - ZoteroImport: drop the unused useAppStore import. Verified locally: `uv run ruff check .` clean; `npm run build` clean. Co-authored-by: Claude Opus 4.7 (1M context) <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.
Summary
Two features that close the loop from "AI found an answer" to "I can use this in my paper."
Click-to-Highlight Sources
customTextRendererBibTeX Citation Export
.bibentries from conversation sources{notebook-title}.bib, ready for LaTeX\bibliography{}Pre-Landing Review
No issues found. Frontend-only changes, no backend modifications.
Test plan
🤖 Generated with Claude Code