Skip to content

fix(app): keep session scrolling responsive#321

Merged
graydawnc merged 2 commits into
paperboytm:mainfrom
bet4it:fix/session-scrollbar-responsiveness
May 28, 2026
Merged

fix(app): keep session scrolling responsive#321
graydawnc merged 2 commits into
paperboytm:mainfrom
bet4it:fix/session-scrollbar-responsiveness

Conversation

@bet4it
Copy link
Copy Markdown
Contributor

@bet4it bet4it commented May 26, 2026

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.

bet4it and others added 2 commits May 26, 2026 21:53
- 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>
Copy link
Copy Markdown
Collaborator

@graydawnc graydawnc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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's scrollHeight is estimated from defaultItemHeight=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!

@graydawnc graydawnc added this pull request to the merge queue May 28, 2026
Merged via the queue into paperboytm:main with commit 33242e8 May 28, 2026
3 checks passed
@bet4it bet4it deleted the fix/session-scrollbar-responsiveness branch May 28, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants