Repository navigation
feat(paper-writing): add a resizable LaTeX workbench with PDF annotations - #3870
Merged
Merged
Conversation
3 tasks done
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
Extend Paper Writing with independently collapsible, resizable LaTeX source and PDF panes, plus PDF review tools. Include the local-window recovery fix in a separate commit so refreshing during an active turn no longer leaves only the user message visible.
Type and Areas
Motivation / Impact
Opening a workspace
.texfile provides source editing alongside a compiled PDF. Either pane can be closed and restored independently while retaining document state. The source toolbar adds outline navigation, snippets, find/replace, main-file selection, and compiler diagnostics.Body snippets inserted with the cursor or a selection in the preamble now go after the visible
\begin{document}boundary. This avoids placing\sectionbefore\documentclassor replacing the preamble. Selections already in the body and included chapter files retain cursor-based insertion.PDF review supports highlights, notes, comment replies and edits, ink, colors, resolve/delete, undo/redo, workspace saves, and controller-side export. Review state is retained beside the source and embedded in exported PDFs; exports use standard PDF annotations. Existing output replacement uses content-hash checks. Recompilation retains page coordinates and warns when the PDF changes.
Reloading a local window during an active turn previously created an empty replay shell without scheduling replay outside Peer Device Mode. Explicitly stale sessions now use the existing fenced journal replay, including duplicate-cursor handling and live suffix delivery. Ordinary local sessions retain their existing read behavior, and older hosts without a journal keep their persisted-content path.
Verification
GitHub Actions on
b1025b72d4: all 14 checks passed, including the three-platform Rust/CLI matrix, both Linux binary producers, and the final validation gate. CI run. Frontend CI passed 1,263 test files and 14,813 tests.564 tests passed across 19 focused files on the latest upstream base (
57afe3d9e8). Exact command fromsrc/web-ui:node scripts/run-vitest.mjs run \ src/tools/editor/pdf-review \ src/tools/editor/components/{LatexEditor,PdfViewer,CodeEditor}.test.tsx \ src/tools/editor/services/{MonacoModelManager,editorViewResidency,EditorDocument}.test.ts \ src/tools/editor/languages/latex.language.test.ts \ src/tools/editor/utils/latexDocument.test.ts \ src/infrastructure/file-export/savePdfFile.test.ts \ src/infrastructure/api/service-api/LatexAPI.test.ts \ src/app/workbench/ContentResourceView.shortcuts.test.tsx \ src/flow_chat/store/FlowChatStore.test.ts \ src/infrastructure/peer-device/runtimeSessionEventGate.test.ts \ src/flow_chat/services/flow-chat-manager/{PeerSessionRefreshModule,EventHandlerModule,TextChunkModule}.test.tspnpm run lint:web: passed with 0 errors and 28 nonblocking warnings.pnpm exec tsc --noEmitfromsrc/web-ui: passed.pnpm run i18n:audit,pnpm run theme:color-audit:all,pnpm run appearance:contract-audit,pnpm run theme:visual-contract, andpnpm run check:repo-hygiene: passed.pnpm run fmt:rs,git diff --check, and the Git object-size check againstupstream/main: passed.check:web:appearanceis blocked by an existing typography violation in unchangeddesign-system/packages/ui/src/components/Dialog/Dialog.module.css:77(--openbitfun-line-height-snug). The same file and violation are present on the upstream base.Reviewer Notes
pdf-lib1.17.1 (MIT) for standard PDF annotations and embedded editable review data.Screenshot uses a sample paper in an isolated UI fixture:
Checklist