Skip to content

Fix flaky timeline scroll-to-bottom restores#254

Open
ymichael wants to merge 6 commits into
mainfrom
bb/fix-flaky-scroll-to-bottom-thr_ruftvnkiuw
Open

Fix flaky timeline scroll-to-bottom restores#254
ymichael wants to merge 6 commits into
mainfrom
bb/fix-flaky-scroll-to-bottom-thr_ruftvnkiuw

Conversation

@ymichael

@ymichael ymichael commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Summary:

  • Cancel a pending saved-row restore when an explicit scroll-to-bottom request happens, so a later ResizeObserver settle pass cannot pull the timeline back up.
  • Add a latched user-detached-from-bottom state so streaming/layout drift can save bottom intent, while actual manual scrolls still save the visible row.
  • Flush the final scroll anchor from the effect-captured scroll element during unmount, since refs can already be nulled.
  • Add regression tests for stale saved-row restore undoing scroll-to-bottom, streaming drift on unmount, and fast unmount after manual wheel scroll.

Validation:

  • pnpm exec turbo run test --filter=@bb/app -- src/components/ui/bottom-anchored-scroll-body.scroll-preservation.test.tsx
  • pnpm exec turbo run typecheck --filter=@bb/app

@ymichael

Copy link
Copy Markdown
Owner Author

Temporarily reverted the branch changes in b13269a so the PR branch has no net diff from main while testing scroll behavior. The original fix commits remain in history and can be restored by reverting this revert commit.

@ymichael

Copy link
Copy Markdown
Owner Author

Updated the branch with a smaller candidate after baseline testing: the PR now keeps main's scroll-preservation capture semantics and only cancels a pending saved-row restore on explicit scroll-to-bottom. This is ready for another manual test pass.

@ymichael

Copy link
Copy Markdown
Owner Author

Added the latched-detach candidate in a6c5812. This version should preserve bottom when streaming/layout drift leaves the scrollport temporarily off-bottom, but still preserve a row after actual user scroll, including fast switch-away before a scroll event. Ready for the next manual test pass.

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.

1 participant