Repository navigation
fix(desktop): keep the timeline settle write out of the resize pass - #5771
chessing234 wants to merge 2 commits into
Conversation
`useVirtualizedViewportResize` called `settleAtBottom` synchronously from its ResizeObserver callback. That path runs `pinToBottom` -> `scrollToIndex`, which shifts Virtua's rendered range, re-measures rows and can toggle the scrollbar -- resizing the observed element at a deeper depth of the pass that is delivering to us. The browser detects the re-entrancy and logs "ResizeObserver loop completed with undelivered notifications" continuously on a live channel. Defer the settle to the next animation frame, mirroring the rAF defer the sibling observer in `useVirtualizedBottomSettle` already uses, and skip deliveries whose geometry is unchanged -- the callback took no `entries`, so a resize that round-tripped to the same layout still scrolled. Lift the callback into `createVirtualizedViewportResizeHandler` so the frame handling is testable without a DOM. Refs block#5717 Signed-off-by: Taksh <takshkothari09@gmail.com>
Signed-off-by: Taksh <takshkothari09@gmail.com>
🔐 Codex Security Review
|
joahg
left a comment
There was a problem hiding this comment.
🤖 The approach looks sound: the settle write is deferred to one rAF, cancelled on disconnect, and the frame re-checks the held-target and at-bottom refs so a reader who scrolled away keeps their position. I found no correctness problems, but this changes Desktop timeline scroll behavior that users see, so Joah isn't approving it and it needs a design or core-team reviewer. The author is outside the core maintainers, so a human Buzz maintainer needs to review it too.
Refs #5717.
A scroll write inside the viewport resize observer can re-measure virtualized rows and deliver another resize in the same pass. The browser then reports
ResizeObserver loop completed with undelivered notifications.Changes
Verification