Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused production bug fix that preserves wrapped-editor measurements across edits and resizes to prevent viewport jumps, with targeted regression coverage and no schema, default, deployment, security, or static-analysis changes. The runtime impact is localized to the existing file-editor virtualization path. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 8b2838e and 5660af3959485f6c194600c0baf986bed0c90f96. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughVirtualized file layout updates now support partial invalidation, resize reconciliation, and zero-width safeguards. Editor updates synchronize changed documents and stale rows. Renderer updates clean caches, compute languages consistently, and expose additional package entry points. ChangesVirtualized editor behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to The editor now retains virtualization measurements across relevant edits and width changes and removes stale line elements so redo can locate the recreated caret. The targeted regressions are covered, with no remaining merge-readiness risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
5660af3 to
19d507e
Compare
19d507e to
379ebd9
Compare
379ebd9 to
cb77aa8
Compare
Dismissing prior approval to re-evaluate 7650243
Editing a large wrapped file in the Files surface still jumps in two cases that stayed open on #7907 after #10018: pressing Enter when the line count crosses a digit boundary (999 to 1000), and the first Redo after a run of Undos. Both leave the caret off screen.
Both fixes live in the patched
@pierre/diffseditor.offsetTopof 0, and scrolled the caret to the top of the rendered block. Update after merging main (2026-10-07):@pierre/diffs1.5.2 (chore(deps): upgrade @pierre/diffs to 1.5.2 and @pierre/trees to beta.6 #16644) clears the cached row elements on every line-count change, so this half is fixed upstream. The redo test in this PR passes on main's unmodified 1.5.2 patch and stays as a regression test. This PR now carries only the digit-boundary and width changes, ported to the 1.5.2 patch.Not changed: resizing the panel with the caret mid file can still jump. The browser's scroll anchoring and the virtualizer's own anchor both move the viewport after a native rewrap, which needs a change to the virtualizer's render order. That part of #7907 stays open.
Verification
vp test run apps/web/src/components/files/fileEditorVirtualization.test.ts: 28 tests pass. The width and digit-boundary tests now encode the estimate policy. The redo test failed on the 1.3.0 base withtranslateY(0px); on the 1.5.2 base it passes before and after. The 12 width and digit-boundary tests fail on main's 1.5.2 patch and pass here.scrollTop/L<caret line>comes from the native shadow-DOM selection.end, Undo ×8Before
Recorded on main today for the #7907 retest (comment).
Before recording, MP4
After
After recording, MP4
Screenshots after the boundary Enter and after the first Redo
Related to #7907. Implemented with Claude Code (Claude Fable 5).
Note
Keep wrapped file editor anchored on redo and digit boundaries
VirtualizedFile;Editornow removes deleted gutter rows from the line-element cache and always passes the edit start line to document-change invalidation instead of selecting the file start based on line-number digit widthCSSStyleDeclarationreads/writesdist.components.VirtualizedFileanddist.editor.Editorartifacts remove cached code-width state and change layout invalidation to use edit start line — callers relying on full-width cache invalidation on resize or digit-width-based file-start selection will see different measurement retention behaviorMacroscope summarized 5660af3.
Summary by CodeRabbit