Tracked changes rails sync with new virtualization#2
Open
aaron-hirundo wants to merge 10 commits into
Open
Conversation
|
This change request has over 100 files and exceeds the review limit. Consider splitting it into smaller CRs for faster and more effective reviews You can still request a review by commenting |
…genpal#57) Three changes to handle 30+ page documents without crashing: 1. Page virtualization: Documents with 8+ pages only render visible pages plus a small buffer. Off-screen pages are lightweight shells with correct dimensions for scrolling. IntersectionObserver lazy-loads content as pages scroll into view and depopulates distant pages. 2. Increased measurement cache sizes: Text width cache 5K→20K, paragraph cache 1K→5K. Prevents cache thrashing on large documents that generate tens of thousands of unique measurements. 3. rAF-coalesced layout: Rapid keystrokes within the same animation frame are coalesced so only the final document state triggers a full layout pass, reducing redundant work during fast typing. Tested with an 81-page generated document: DOM elements reduced from 22,738 to ~8,800 (93% page virtualization), no console errors, editing works correctly mid-document. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The paragraph measurement cache existed but was never called. Now measureBlock() checks the cache before measuring paragraphs (for blocks without floating image zones). On a 36+ page document, subsequent edits skip measurement for all unchanged paragraphs — only the edited paragraph gets re-measured. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ff2eedf to
ad8412d
Compare
* fix: preserve tracked changes round-trip * feat: isolate direct xml save workflow and diagnostics * feat: review plugin v1 with tracked changes panel and actions * refactor: share direct-xml planner and review presentation helpers * fix(review): unify revision decision path and enable header/footer selection --------- Co-authored-by: Jedr Blaszyk <jedrazb@gmail.com> Co-authored-by: Aaron Dov Malkin <adov@Aarons-MacBook-Pro.local>
Author
|
baz review |
Comment on lines
+11
to
+35
| const NAMESPACES: Record<string, string> = { | ||
| wpc: 'http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas', | ||
| mc: 'http://schemas.openxmlformats.org/markup-compatibility/2006', | ||
| o: 'urn:schemas-microsoft-com:office:office', | ||
| r: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships', | ||
| m: 'http://schemas.openxmlformats.org/officeDocument/2006/math', | ||
| v: 'urn:schemas-microsoft-com:vml', | ||
| wp14: 'http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing', | ||
| wp: 'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing', | ||
| w10: 'urn:schemas-microsoft-com:office:word', | ||
| w: 'http://schemas.openxmlformats.org/wordprocessingml/2006/main', | ||
| w14: 'http://schemas.microsoft.com/office/word/2010/wordml', | ||
| w15: 'http://schemas.microsoft.com/office/word/2012/wordml', | ||
| wpg: 'http://schemas.microsoft.com/office/word/2010/wordprocessingGroup', | ||
| wps: 'http://schemas.microsoft.com/office/word/2010/wordprocessingShape', | ||
| }; | ||
|
|
||
| function buildNamespaceDeclarations(): string { | ||
| return Object.entries(NAMESPACES) | ||
| .map(([prefix, uri]) => `xmlns:${prefix}="${uri}"`) | ||
| .join(' '); | ||
| } | ||
|
|
||
| function serializeNoteParagraphs(paragraphs: Paragraph[]): string { | ||
| const serialized = paragraphs.map((paragraph) => serializeParagraph(paragraph)).join(''); |
There was a problem hiding this comment.
Duplicates the exact NAMESPACES + buildNamespaceDeclarations logic from serializer/headerFooterSerializer.ts; every addition/removal will need to be updated in two places and increases maintenance. Can we import and reuse the shared namespace helper (or move the constant into a utility) instead of copying it here?
Finding type: Code Dedup and Conventions
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.
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Implements page virtualization and layout throttling to optimize the rendering of large documents. Enhances the DOCX synchronization logic to handle footnotes and endnotes while ensuring the review rail overlay remains aligned with virtualized content.
IntersectionObserverto lazily render pages and implements layout coalescing viarequestAnimationFrameto improve performance.Modified files (7)
Latest Contributors(0)
buildDirectXmlOperationPlanto support accurate document synchronization.Modified files (3)
Latest Contributors(1)