fix(channels): fix pin to bottom - #6247
Conversation
|
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: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe channel virtualizer now measures resize changes synchronously and remeasures rows in a microtask after child rendering. The near-bottom threshold is 1px. Documentation defines the updated scrolling and measurement behavior. New local Playwright tests cover consecutive sends, server acknowledgements, composer resizing, viewport contraction, and non-pinned scroll stability across desktop and mobile viewports. Merge Risk: ⚪ Minimal · up to Channel scrolling now uses a precise bottom threshold and synchronous/deferred measurements to keep pinned views stable while preserving positions when reading history. The covered send and resize scenarios indicate no remaining merge-blocking risk. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
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 |
Note
Medium Risk
Changes core virtualized scroll pinning and measurement timing for all channels; behavior shifts for users slightly above the bottom (1px vs 50px), though covered by new e2e tests.
Overview
Fixes channel message list bouncing away from the bottom during sends, acks, and layout changes by tightening when the list is considered “pinned” and when row geometry is measured.
NEAR_BOTTOM_THRESHOLDdrops from 50px to 1px so append-follow, composer/viewport resize, and saved snapshots share one strict end tolerance. A looser threshold could treat optimistic height estimates (e.g. after ID swap on ack) as still pinned and apply a backward scroll correction.In
ThreadList,useAnimationFrameWithResizeObserveris disabled so ResizeObserver-driven measurements apply in the current frame instead of the next, avoiding stale sizer/composer geometry that could drop the end anchor on send. RowmeasureElementruns in aqueueMicrotaskafter child effects render Markdown, so the virtualizer does not measure an empty row shell and temporarily shrink the scroll extent.Docs (
sticky-scrolling.md,channels.md) describe the 1px boundary and measurement timing. New Playwright e2e (local-channel-send-scroll.spec.ts) asserts zero bottom presentation violations across consecutive sends, wrapped/tall messages, mobile touch viewports, sends at various gaps from bottom, composer growth, and simulated keyboard viewport shrink.Reviewed by Cursor Bugbot for commit d237f62. Bugbot is set up for automated code reviews on this repo. Configure here.