Repository navigation
fix(diff): keep scroll restore armed through layout shifts - #10615
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 27fc413c-bd8b-4f6e-823f-4734f29a4174
📒 Files selected for processing (2)
src/renderer/src/hooks/useVirtualizedScrollAnchor.marks-restore-signal.test.tssrc/renderer/src/hooks/useVirtualizedScrollAnchor.ts
Verify that a converging restore withstands layout shifts and continues retrying, while unmarked user scroll disarms the restore attempt. Stabilize marks and offset objects across renders to preserve the bookkeeping state that guards restoration retries.
…10615) * fix(diff): keep scroll restore armed through layout shifts * test: add scroll-restore convergence and user-scroll disarm cases Verify that a converging restore withstands layout shifts and continues retrying, while unmarked user scroll disarms the restore attempt. Stabilize marks and offset objects across renders to preserve the bookkeeping state that guards restoration retries.
Summary
Screenshots
No visual change to capture; this restores the existing scroll-position behavior.
Testing
npx oxfmt --check -c .oxfmtrc.json src/renderer/src/hooks/useVirtualizedScrollAnchor.ts src/renderer/src/hooks/useVirtualizedScrollAnchor.marks-restore-signal.test.tsnpx oxlint src/renderer/src/hooks/useVirtualizedScrollAnchor.ts src/renderer/src/hooks/useVirtualizedScrollAnchor.marks-restore-signal.test.tsnpx tsc --noEmit -p config/tsconfig.node.json --composite falsenpx tsc --noEmit -p config/tsconfig.web.json --composite falsenpx vitest run --config config/vitest.config.ts src/renderer/src/hooks src/renderer/src/components/sidebar --reporter=dot(2,036 tests)npx electron-vite build --mode e2e--repeat-each=3(4/4 passed)expected 1 to be greater than 1) and passes with the fixAI Review Report
An independent read-only AI review found no issues. It checked the pending-restore state machine, verified that unmarked user input still wins through the listener disarm, confirmed marked restore and virtualizer writes remain programmatic, and confirmed
WorktreeListis behaviorally unchanged because it does not passrestoreSignal.Cross-platform review covered macOS, Linux, Windows, SSH, and folder workspaces. This renderer-local DOM state change touches no shortcuts, labels, paths, shell behavior, Git behavior, transport, or platform-specific Electron APIs.
Security Audit
No security-sensitive surface changed. The patch adds no input handling, command execution, path handling, authentication, secrets, dependencies, IPC, or network behavior.
Notes
WorktreeListremains on the legacy every-measurement restore path, so the one-shot signal consumption fixed here cannot strand the sidebar consumer.