fix(app): keep session scrolling responsive#321
Merged
graydawnc merged 2 commits intoMay 28, 2026
Conversation
- Remove scrollSeekConfiguration + MessageScrollSeekPlaceholder. The skeleton placeholder kicked in on any drag over 600 px/s and gave a false "loading" impression even though all messages are already in memory; mainstream chat UIs (Slack, Discord, iMessage) render real content during fast scroll. - Map thumb position to row index and call Virtuoso scrollToIndex instead of writing scroller.scrollTop directly. The pixel-ratio approach couldn't reach the true top/bottom because Virtuoso estimates scrollHeight from defaultItemHeight (64), while real markdown rows expand it 2-3x once measured. scrollToIndex lets Virtuoso re-converge on the actual extent. - Simplify the ResizeObserver content target now that no placeholder intercepts firstElementChild. - Add useEffect cleanup so window pointer listeners released even if the component unmounts mid-drag (e.g. session switch). - Restore the boolean annotation on showAvatar that tsc strict mode required. Tests: add e2e for track click-to-jump and for drag-to-bottom reaching the actual list end (the latter fails on the pre-fix pixel-ratio implementation). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
graydawnc
approved these changes
May 28, 2026
Collaborator
graydawnc
left a comment
There was a problem hiding this comment.
Hey @bet4it — thanks for the solid work on this, the custom scrollbar is a really nice addition. Pushed a follow-up (03522ac), wanted to flag the reasoning:
- Dropped the scroll-seek skeleton. Messages are already in memory, so the placeholder reads as fake "loading".
- Switched drag to
scrollToIndex. Virtuoso'sscrollHeightis estimated fromdefaultItemHeight=64, but real rows are 2–3× taller, so pixel-ratio drag couldn't reach the actual bottom. Index-based fixes it. - Bonus: pointer-listener cleanup on unmount, plus e2e for track-click and drag-to-bottom (the latter fails on the pre-fix code).
Thanks again!
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.
On long session detail views, the custom scrollbar thumb could drift out of sync with the mouse while dragging, making the list feel broken and hard to navigate. This change keeps the thumb position tied to the pointer during drag operations, syncs it back to the virtualized message scroller after interaction, and uses lightweight scroll-seek placeholders so large sessions remain responsive while scrolling. It also adds e2e coverage for dragging the session scrollbar in a 1500-message session.